Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - axon

Pages: [1] 2
Projects / Re: kode.pas
« on: February 09, 2015 »
i don't know how many are interested (if anybyody at all), but there's been a quite interesting thread at about fpc and exe size optimization:

886 bytes for an exe with opengl/shader.. which is, according to some of the posts in that thread, smaller than using msvc or gcc for the same thing..

not bad..

Projects / Re: kode.pas
« on: January 30, 2015 »
thanks ! :-)

yeah, been coding and developing my  own libraries for years now, slowly but steadily, and all the different pieces are starting to fall into place and fit well together.. everything is coded from scratch, and quite low-level, so i had to learn a lot of things during the process: gdi/xlib, vst/ladspa, cairo/opengl, etc.. and then make sensible and portable wrappers on top of all that, so i seldom (if ever) have to touch that low-level stuff again :-D

got rid of another 100 bytes or so from the 4k base/framework, by using crinkler.. 753 bytes.. and i haven't really gone very deep yet.. it's still pure pascal, no assembler.. yet..

update: do-nothing exe (just calls ExitProcess), pure pascal, compressed with crinkler.. 443 bytes..

Projects / Re: kode.pas
« on: January 09, 2015 »

related to this, i just did some experiments.. tried to make as small a exe file as i could, with freepascal.. yeah, i code in pascal! shocking, i know :-) .. a do-nothing exe, compressed with bero's exe packer: 1061 bytes.. a test-exe, with opengl, texture generation, a rotating textured quad, minimal synthesizer and audio playback, and some very simple runtime (executable) code generation: 2286 bytes..

now i'm converting most of the s4k stuff (my never-used 4k framework in c, to pascal.. a tree/graph based thing, which is almost like a language itself (nodes, conditionals, flow control, sub-routines, callbacks, stack for passing variables between nodes, etc), and a simplistic forth-like language/expression-evaluator.. things are looking good.. the goal is to get the "engine" below 2k.. and use the graph/node tool for making (and exporting) size-optimized data structures for this "engine"..

update: just shaved off almost 200 bytes, so that a do-nothing exe is now 864 bytes.. :-)

Projects / Re: kode.pas
« on: January 04, 2015 »

Projects / kode.pas
« on: December 29, 2014 »
i've been quite busy with my various bands and musical projects, but now i'm getting back to my favourite activity - coding.. there's been lots of progress the last few days.. (couldn't get embedded images/videos to work, so, just links :-\)

modular system, work in progress:

various other tests/prototypes/experiments, using the same code-base:

kode.pas, the (ever-growing) codebase/library/framework:

'modern' opengl, glsl:

gui / plugin framework:

syn_thesis005, semi-modular phase/waveshape-modulation synth:

s4k, an older project (4k intro tool) of mine, in c (msvc), that i will 'steal' many ideas and concepts from:


2015 is soon here, and i'm planning/thinking about/considering doing something to 'celebrate' that it's 20 years since my first demoscene related release (as 'axon' from 'xenon development' and early 'excess').. a demo or something.. or perhaps a 'modernized' remake/remix of an old intro/demo..

maybe it could be interesting to try to gather a few people, and form a (new) demo-group or something?


A current WIP for a certain party in Easter. Gonna be an invite so I'll actually have to finish it this time too :P

There will also be a huge-ass Displayhack article on it after it's done describing workflow/custom tools/effect implementations/why it's going to be open-source :)

looking forward to this...

Projects / Re: s4k
« on: March 27, 2012 »
It works here on my crappy work machine.  It spins very fast though.  Much faster than in the editor.

first, thanx for testing, and cool that it works..

i'm not sure, but i think the spinning speed can be for two reasons.. either that i have modified the project file somewhat after i compiled the exe.. likely if it spins about ten times faster... or it's because the editor uses a timer callback for timing (around 60hz, i think), while the intro just runs in a loop, and is probably synced with screen refresh rate.. but i'm still working on the timing and sync, it's currently a bit shaky..

Projects / Re: s4k (editor+intro exe)
« on: March 27, 2012 »
i would be very grateful if somebody could try this: intro.exe (2899 bytes), and see if it works on your machine.. if everything goes according to plan, it will draw a textured, rotating sphere, directly to the desktop (forgot to turn on the S4K_FULLSCREEN flag).. and play some ugly 'music'.. there's mainly basic stuff going on in there, so hopefully, it will work pretty much everywhere.. but theory and practice seldom match too well, so... it would be good (or bad) to hear any reports, if it works or not, and where it causese problems.. also, if you're interested, here's the editor.exe (580k), and the test2.s4k (1255 bytes) project file. (the .h file exported from this was used to compile intro.exe)

Projects / Re: s4k
« on: March 23, 2012 »
tons of changes, tweaks and fixes...
and some new things:
polyphonic audio synthesis and sequencing

Projects / Re: s4k
« on: March 21, 2012 »
screen recording while editing, including a nice crash :-)
canstudio and youtube both tried to ruin the quality and framerate as much as they could...

saved project file: (2k)
new s4ke.exe (725k)

EDIT: Embedded the youtube video for you. There's a "YOUTUBE" tag for embedding them. If you try and modify this post, you should be able to see the format - raizor

Projects / Re: s4k
« on: March 21, 2012 »
I'm trying to figure it out by your screen shots....  Even some saved examples to work with would be helpful... maybe even preferred.

I can't produce any output from it.

See attached screenie... I tried to copy your screen shot, but there are parameters that I can't see.

hmm, by the screenshot, i can't quickly see what the problem is... in theory, the 'intro_init' node should be executed when you click compile (this has changed a bit in a newer version, called when starting playback instead)..  but i will make some very simple examples later today, and post them, so you can try them out.. and also a new s4ke.exe..

Projects / Re: s4k
« on: March 21, 2012 »
whoa. just being able to actually edit something without any instructions is impressive :-)

ok, well, this it my (probably) fifth attempt at writing something about it, i know it's necessary, but words doesn't come out as i think them inside my head, especially not in a foreign language, and things are still a bit abstract.. so... it became a lot of babbling, confusing more than explaining.. being ashamed about it, i wanted to delete this completely, but decided to "ow, fuck it", and post it anyway.. better than nothing, eh? as mentined everywhere else, ask about anything if you want to know more..

< waffle ON>

to understand the editor, you probably need to understand some of the internals i guess, so...

the main concept:

an intro consists of a bunch of arrays, all sized 256 because they're being indexed with bytes, alÝmost everything is based on bytes...

the most imporatnt structure is the 'graph', which holds up to 256 'nodes', connected in a kind of hierarchy, kind of like a binary graph. each node has 4 elements: type (which defines what the node actually does), arg (the argument to the node type), and references to two nodes, son and brother. the two last ones, son/bro, defines the execution flow, the brancing, of the intro..

execution starts by 'calling' (executing/parsing) some specific node, let's say 'intro_frame'.. after a node has done its job, it recursively calls first the son, and then, its brother.. so it's a depth-first traversal of the graph (or perhaps it can also be called a 'tree'?). some nodes [varies] this, and calls the son/bro either conditionally, a number of times, or other things...more on that later..

in the editor (the large grid), nodes are the colored blocks, son-nodes are below, and brothers to the right of each node.. a black line either at the bottom or the right inside the node indicates that this assumption is not valid for that node.

so, that was the traversal. but just parsing through the graph's nodes doesn't do much, that's what the node type/arg is about.. there are a bunch of node types for influencing the parsing:

- empty
  return to the caller, exit/quit the graph parsing, finito

- noop
  nothing, just call son/bro
- proc
  callback function
  arg : proc-index (array of pointers to callbacks)
- expr
  arg : list-index (array of pointers to lists of bytes)

- cond
  conditional, just like scripts, but after its execution, if the top of the stack is positive, the son is called, else the brother
  arg: list
- repeat
  call son a specified number of times, before calling brother
  arg: number of times

- loc
  set location (like a bookmark)
  arg: loc-index
- call
  jump to location (bookmark)
  arg: loc-index
- [cycle]
  deprecated, because of some changes in graph parsing
  arg: number

- [pattern]
  deprecated, because of some changes in graph parsing
  new ideas are bubbling, so it will be re-introduced, but slightly different
  arg: list

- wait
  calls son only every x time
  arg: num

- poly
  'polyphonic registers'
  mainly for
  call son for every polyphonic voice (or layer, can be used for other things than audio), but switches 'polyphonic register bank' before calling..
  more info later, as this is still in the baby-stages..
  arg: num

- voice
  same as poly, but one specific voice/layer
  arg: num/voice
the rest are (mostly?) open-gl specific nodes... i wanted these to be 'callbacks' originally, so that nodes were only for traversing the graph and handling array indexes, procs for calling functions/code, and expression for doing math with floats..
but, they need a parameter (shader number, etc), and callbacks have none (the byte arg in proc nodes are used for selecting which procedure).
but, there are some ideas bubling around, so these may change...
- vertex shader: define vertexshader
- fragment shader: --"-- fragment shader
- compile compile: compile currently selected vertex/fragment shader
- select shader: select/use shader
- init texture: init texture with last selected bitmap
- select texture: use texture
- render target: not finished...
- begin mesh: start mesh definition..
- end mesh: finalize mesh
- render mesh: and render it
- init bitmap: procedural generation, two for loops /x/y) is being run, and the son node is called for each pixel. scripts have access to the X/Y for the current pixel (0..1), eventually the result for a previous script, and save the result to R,G,B,A registers..
- select bitmap: not much use yet...

as you can see, there's a lot of "work in progress", half finished stuff, etc...

the final thing that need explanation, the expressions/scripts:

this is like a tiny, simplified virtual machine, parsing bytecode, the vm has 256 virtual registers (an array of floats), and a data-stack.. and that's it, really
the various opcodes available in expressions (and conditionals):

push/pop: for moving floats between the stack and the registers
add,sub,mul,div,sin,cos,rand etc: do some math on the top-of-stack values
dup, drop, rot, etc: manipulate the stack


so, that was a little introduction (probably completely confusing and non-understandable) to the s4k system..

the editor tries to edit the various arrays directly, and show as much detail of selected node and stuff as possible, and you can edit names for the array elements, to make it easier to remember which array element does what..

you edit the nodes and other arrays, compile to convert everything to bytes, and then play to get it started.. play searches for a location node called 'intro_init' and calls this before starting its main loop.. then looks for 'intro_frame', which is called for every frame..

especially the list editor is a little shaky at the moment.. it can edit text by having a " character as the first one (which will be skipped, no ending ") to directly copy/paste the text (for shaders, etc). if no " is found first, it parses each word and convert them individually to bytes.. script opcodes are translated to their corresponding value (for bytecode interpreter), and register names to their indexes.


the editor will eventually/later also export a .h file, "used_elements.h", or "optimize.h" or whatever, with a bunch of "define USED_OPCODE_PUSH, #define USES_NODE_CALL, etc, and the intro source code is filled with relevant #ifdef/#endif's.. so things you don't use in the editor, will not be compiled into a final 4k intro...

and, added music and audio yesterday, using nodes and expressions for both the sequencing and audio generation... seems to work really great! when this is a bit more stable, i'll start formalizing the nodes and opcodes and stuff..

and also, as mentioned, a few project files for testing and showing off things, would be really great, but, if the nodes and/or opcodes change, that would make the files useless... need to formalize, make a final decision about the nodes/opcodes, and perhaps have some version info in the project file first...

< waffle OFF >

Projects / Re: s4k
« on: March 20, 2012 »
@all: thanx for all encouraging comments!

@voltage: working on it.. i hate writing docs and instructions, so, unfortunately it takes a little time, to get something that is understandable for other people than myself.. a day or two, and i'll try to come up with something..

Projects / Re: s4k
« on: March 18, 2012 »
more progress.. load/save, shaders, textures, bitmaps, meshes, timing, (primitive) procedural texture generation.. i doubt anybody will understand much of the editor without a walkthrough of the s4k 'engine' (coming soon, when things get a little bit more stable), but here's an .exe if you feel adventurous.. it's not too stable yet, shader compilation when preview window is closed crashes (gl context vs fltk)...  almost no error checking or anything is done.. so you can easily make infinite loops, or callbacks with null pointers.. and, you might need msvcr100.dll.

Projects / Re: s4k
« on: March 13, 2012 »
a lot of progress on this project, but i didn't want to spam the forums, so i haven't posted every little update here, only on my blog... the editor is getting into shape.... i can now completely edit a graph, its hierarchy, and all its connections, expressions, conditions, callbacks, etc, 'compile' the scripts and other lists, and run it, all from within the editor.. also, there's a opengl preview window, so now i can start doing proper intro specific code, play with glsl, mess around with audio and synthesis code, etc.. last few things currently being added, are load/save project file(s), and export to .h... planning a "how it works, behind the scenes" type of post.. and as soon as i have added project load/save, i will post a binary, so you can test the editor yourself.. but i am still debating with myself about how to release the final, finished project... a fully opensource thing, or the editor exe and playback routines only (libs or sources)... input and suggestions and comments welcome..  another screenshot below, but it's a few days old, so quite a lot of things have already changed since i took it...

- axon

Projects / Re: s4k
« on: March 01, 2012 »
the tool for setting up the graph/vm is progressing..
next up is making it interact with a real, running graph/vm
(the data in the screenshot is just a test i use while coding the editor)

Projects / Re: s4k
« on: February 24, 2012 »
aanndd.. a blog entry here, with some more new things..

Projects / Re: s4k
« on: February 22, 2012 »
This is a fantastic project :) Duckers/Outracks and I are doing something similar for synthesis using a graph compiler for signal routing and a vm-based synth, but it only applies to music.

Keep us posted; I'd really like to see where this goes :) .


been thinking a lot about the audio/music part lately.. my 'problem' is that the synthesis stuff (phase-modulation/distortion, waveguide, perhaps formants/phonemes), and the number of voices i have in mind, would need quite a few state-/config-variables per voice, so i'm experimenting with how to do that with only 256 'virtual registers' (and a stack).. banks of such registers, and/or sub-graphs is some of the ideas i'm playing around with.. but then, i don't want too much pointer-juggling in there either... so, we'll see.. currently i can have a callback func/proc to update each voice, so perhaps i should postpone the audio stuff until the other things are more mature..

also, i'm re-organizing things a little, trying to make it smaller, and also to make it easier to also compile a dll, so i can make an editor (or a vst plugin) in any other language/ide (like pascal/lazarus, or whatever)..

will post updates when i have something new..

your synth project, is that strictly private, or are you open for discussing ideas?

Also, we should talk about a Trondheim pubmeet :D Lots of sceners here; Duckers, Mortzerr, Neuratix, Quisten, Zeila, Wic, myself.. the list goes on :)

i have to be a little bit careful about what i plan/promise, because of my health, but that would absolutely be cool !!

Projects / Re: s4k
« on: February 19, 2012 »
ok, zipped up the sources and put them here:
yes, the year in that filename is wrong.. :-/
they're a bit messy at the moment, right in the middle of some more testing and experimentation (as always).. and, didn't include the msvc project files.. next time..

i'll be glad to hear any comments or suggestions or complaints, or whatever..

Projects / s4k
« on: February 19, 2012 »
[have been thinking/doubting, back and forth about posting this, feels a little too much like shameless self-promotion.. but finally decided to just jump into the deep water, and see what happens..]

a mixture of a sneak-peak and a mock-up, of what i've been doing lately.. it's early, it's work in progress, lots of things will change and twist as i go on..but it feels like it's flowing in the right direction..


  • it's mainly a hierarchial tree/graph system, and a script/expression parser, inspired by what blueberry is talking about here ( and here (, and some other ideas
  • the editor thing shown in the screenshot, is just something i threw together in lazarus in an hour, took a screenshot of, and then colorized a little with gimp.. messing around, experimenting, trying out things, to see if my ideas would be doable, and practical.. so it's not a working thing, but an idea, a prototype..
  • the 1136 bytes final exe is from a test thing with a few simple expressions and procs/callbacks, for testing, but it does the main work with tree/scene-parsing and expression evaluation.. and its compressed with crinkler of course..
  • some simple code is in there (but not used for anything yet), for glsl shaders (compile/select), textures (upload/select), meshes (display lists/glu), ..
  • also, i have an ugly, simple synth, but i hope to use the tree/graph system for the music/synth too..
  • it should be more or less prepared for easy porting to linux (etc), but i haven't given that side much effort yet, just tested a little with gcc/mingw..
  • i'm considering releasing everyting as some kind of open source project, but i might want to make something with it myself first, and see if the ideas work...
  • and then i have to come up with some actual effects. and music... :) 

- axon
(is the handle 'axon' still available?)

oh,. and this is my forst post here (excluded the 'hello world' during registration), so please be easy on me if i do something wrong, or break any rules or whatever ... i'm just very eager to get back 'into the scene'  ;D

Pages: [1] 2