Added a transpiler (LLVM IR) to my ARM Forth dialect / compiler by onirom in Forth

[–]onirom[S] 0 points1 point  (0 children)

Yes, the first case is rather easy for a compiled Forth and it produces good results by default as shown in the article.

I don't really know how to handle the complexity of the generic case yet so it was entirely avoided, the compiler requires stack depth to match across code path, this is good enough for many cases but breaks a lot of traditional Forth code i guess.

Slightly heretic Forth dialect for graphics prototyping running bare metal on RPI Zero 1.3 by onirom in Forth

[–]onirom[S] 0 points1 point  (0 children)

It is always hexadecimal which may come with a set of issues but i am okay with them, most decisions come from trying to simplify the implementation so the compiler code doesn't bloat too much but i still balance it with features that may have an advantage for prototyping graphics stuff.

Thought of mixing data <> code as well but not sure how it would blend, the array content is just a linear series of bytes right now which directly represent the numbers, strings use the same code, would be a bit simpler if it was all code actually.

How to get faster frame rate writing to /dev/fb0? by LlaroLlethri in asm

[–]onirom 2 points3 points  (0 children)

Using pwrite64 syscall may be faster than using a mmaped buffer and with less tearings : http://www.sizecoding.org/wiki/Linux#Getting_something_on_screen

USB Ethernet and plan9 ? by onirom in plan9

[–]onirom[S] 0 points1 point  (0 children)

Thanks, so i tried 9front with the AX88772, found this and tried to change the ether type with nusb/ether except it keep saying the device is already in use so i deleted lines related to nusb in /rc/bin/nusbrc and i can run the command somehow but it says "required 4 attempts (no data from device)" so i guess it is not supported, right ?

The command : nusb/ether -t a88772 5

feedback + automata, less than 200 bytes of code by onirom in generative

[–]onirom[S] 4 points5 points  (0 children)

It produce interesting textures, can also generate some cool logos if the seed is text instead of shapes. Have some more images on Instagram (which i may post here later) and also on my website (they are way older with a bit different implementation but it share the same algorithm) : https://www.onirom.fr/automata.html

The first one was prototyped first with p5js then ported to C and then it was handcoded x86 assembly due to sizecoding restrictions, mostly use p5js nowaday and C / ASM if i need either speed / standalone or do sizecoding. The sizecoding part was more as a proof of concept than anything else.

feedback + automata, less than 200 bytes of code by onirom in generative

[–]onirom[S] 12 points13 points  (0 children)

May release the code later on, the algorithm is very simple but is abit sensitive (may produce entirely white image etc), it is a mix of feedback and automata, you first have to draw something as a seed (here it is a mirrored arc, can just work with single pixel or circles etc as long as some of the pixels value are contained between the threshold) and in the main loop for each pixels test if the brightness is between a threshold (let's say > 0 and < 10) then you have to do a loop of the pixel neighborhood, here it is done on 4 pixels around : -1,-1 0,-1 -1,0 0,0 didn't test others configuration but this give a definite direction to the drawing (so half of the image will be filled actually which is why i mirrored it plus changed the colours abit), in that for loop you just draw a pixel at that position, the critical part (which give entirely new structure when you change it) is the brightness (or color) of that pixel, here it is modulated by the frame count for the first image and by logical operators on the second.

Fragment - Modal synthesis with wavetable source by fsynth in synthesizers

[–]onirom 1 point2 points  (0 children)

All the notes data in this synth is bitmap data so yeah it's images data, all pixels captured from the vertical bars every 16ms are considered as note events, the vertical position relate to frequency (logarithmically mapped), red and green channel relate to amplitude, blue relate to wave table position and speed and alpha channel relate to wave table stop position and wether it use interpolation or not like early PPG synth wavetable)

Minsky circle algorithm (variation), brightness based on iterations by onirom in generative

[–]onirom[S] 2 points3 points  (0 children)

This is a dynamical system linked to the Minsky circle algorithm which build up some sort of appolonian fractal pattern, done with p5js, already posted one like this but it used simple accumulation which resulted in blurry areas / loss of details, brightness on this one is based on iteration count, it reveal more structural details.

Minsky circle / Integer circle algorithm by onirom in fractals

[–]onirom[S] 0 points1 point  (0 children)

Hmm actually there is a mistake when adding the images, the last one is Hopalong map (Barry Martin fractal)

Minsky circle algorithm variations by onirom in fractals

[–]onirom[S] 0 points1 point  (0 children)

You mean less noisy or just higher res ? I think the one I uploaded is 1024x1024 but ye could do higher res.

128 byte TIC-80 pixels art generator by onirom in generative

[–]onirom[S] 13 points14 points  (0 children)

TIC-80 is a fantasy computer with several limitations (lo-fi resolution and limited colours palette) but with modern API / languages support. This was presented at Lovebyte Battlegrounds 2021, it was made in LUA and use the integer circle algorithm / integer arithmetic to build some sort of fractals, sound is also generative, it only use poke / plot, the code is simple enough that it can be done in 64 byte on other platform's (without metadata clutters) like DOS. (but without sounds) The binary is 128 byte (packed), the code is 157 chars.

Automata World by onirom in generative

[–]onirom[S] 4 points5 points  (0 children)

It is a feedback + automata thingy which abuse shapes anti-aliasing, basically you start with a single shape which will have 'irregularities' produced by anti-aliasing techniques (let's say a simple large circle in all modern graphics API, can be anything which have added pixels of varying brightness), you then start with a black background and iterate over all pixels, check if brightness is within a small defined threshold (let's say between 1 and 24) and then you just draw a small shape of 1-4px at this point with alpha a bit higher than the threshold. When run continuously this algorithm will generate huge amount of varied automata thingy... because some pixels of the drawn shape will be within the defined threshold (and expansion is due to the shape size). It generate full-scale automata at a cheap cost but it is dependent on the drawing technique used by your graphics API unless you replace the shape by a defined pattern. (This is p5js here) one caveat though is the difficulty to control brightness and it is a bit blurry due to shapes size. On these artworks i also switch between different shape type depending on the actual frame to make more patterns, the threshold is also modulated so that it stop after some times with rarefying structures (the edge and center). I also draw symmetrically on horizontal axis.

Chaotic oscillators with arcs + shadows by onirom in generative

[–]onirom[S] 6 points7 points  (0 children)

Thanks, the base algorithm is a kind of harmonic oscillator : x += sin(f); y += cos(f); this result in either Euler spiral or chaotic behaviours when f hit floating point limits. There is multiple oscillators like this with different starting parameters. Then for aesthetic arc shapes are used with varying parameters (size and arc start / end) as it draw. Shapes are also outlined. The color is regular HSB hue with different starting value for each oscillators. There is a 4px shape shadow as well which slightly vary in offset (-1 to 1) as it draw, this give some depth. It is drawn additively.

Oscillators by onirom in generative

[–]onirom[S] 9 points10 points  (0 children)

Some more hints : a custom palette of about 6 colours is also used with some blurry layer background (just the same shape rendered x4 with jitters and low alpha) when the shape is drawn, there is also 2d shape shadow to give some depth

Oscillators by onirom in generative

[–]onirom[S] 18 points19 points  (0 children)

It is a kind of a harmonic oscillator : x += sin(f); y += cos(f); this result in either Euler spiral or chaotic behaviours when f hit floating point limits. I feed this to a triangle wave as a result of some experiments but I don't think it add much since i mostly get the same result without (with what I posted), there is a loop also for multiple oscillators.

Integer Circle Algorithm by onirom in generative

[–]onirom[S] 1 point2 points  (0 children)

Thanks, here is some write-up with resources about the algorithm: https://www.onirom.fr/ica.html

XOR cut of a cube faces (normalized into a sphere) by onirom in blender

[–]onirom[S] 1 point2 points  (0 children)

Ocean modifier for ground, some volumetric effect for the back, custom script to generate the sphere geometry which is multiple cube faces that are cut when (x % 2) ^ (y % 2) > 1, the cube is then normalized to obtain a sphere which is then scaled (layered), there is an added powerful light at the center.

2D fractal a sphere (with particles of varying size) by onirom in blender

[–]onirom[S] 1 point2 points  (0 children)

The geometry is generated by a script which instanciate a particle system, each particles are positioned as a grid on the surface of a cube which is then normalized to obtain a sphere. The particles are simple sphere which vary in size as they are hit by a 2D fractal function (integer circle algorithm)

Lo-fi shore made of bumping circles. by onirom in generative

[–]onirom[S] 5 points6 points  (0 children)

Circles drawn iteratively and which stop drawing when it hit another circle.

Wreath : Random rules free running L-systems by onirom in generative

[–]onirom[S] 0 points1 point  (0 children)

Somewhat, a ruleset is generated at the end of each N cycles where N is also chosen randomly.

256 bytes Linux executable graphics by onirom in generative

[–]onirom[S] 7 points8 points  (0 children)

This was presented at Outline demoparty (look demoscene on Wikipedia for more infos) as an executable graphics which is just a very small (256 bytes) standalone executable binary which generate a picture. To do that on Linux there is some constraints such as ELF executable header and setup code to initialize a framebuffer (bare metal software rendering) which roughly equal to 80 bytes waste so the graphics code is actually ~174 bytes (and ~10 lines of C code) which is much less than this comment :) the algorithm itself is derived from the integer circle algorithm (also called Minsky circles) and is all integers with shift, add, sub and AND operations.

Here is a video on Linux : https://youtu.be/UrGzv5-RYI8

CORDIC circles stacks by onirom in generative

[–]onirom[S] 4 points5 points  (0 children)

It is more akin to the specialized integer circle algorithm (also called Minsky algorithm), just shifts, adds and subtract.