RS-MET icon indicating copy to clipboard operation
RS-MET copied to clipboard

Snowflake - fun with fractals

Open RobinSchmidt opened this issue 7 years ago • 79 comments

i'm working on a new module that can create waveshapes that trace out a closed curve (i.e. loop) in 2D with a self-similar boundary. here's an example:

image

here are the x- and y-coordinates as function of time:

image

as can be seen, the waveforms are periodic, i.e. they end where they begin, indicating a nicely loopable repetitive waveform. someone posted on facebook a link to the gif from here:

https://www.reddit.com/r/visualizedmath/comments/7xtxgb/hilbert_curve/

which got me interested in what the fuck is going on there. a bit of research revealed that they are drawing a Moore curve there:

https://en.wikipedia.org/wiki/Moore_curve

and doing some more research was dragging me into a rabbit hole. the moore curve is one of the infinitely many curve types that a Lindenmayer-system:

https://en.wikipedia.org/wiki/L-system

will be able to generate. so i implemented one. among the possible curves is also the koch snowflake:

https://en.wikipedia.org/wiki/Koch_snowflake

which i elected for the name of this new upcoming generator.

RobinSchmidt avatar Feb 24 '18 01:02 RobinSchmidt

here are more examples:

http://mathforum.org/advanced/robertd/lsys2d.html

not all of the curves shown there loop back to their beginning though, but with some care in setting up the L-system, this can be ensured (it's a useful property when it's going to be used as audio oscillator waveform). here's a little web-app to play around with L-systems until my new module is ready:

http://www.kevs3d.co.uk/dev/lsystems/

RobinSchmidt avatar Feb 24 '18 01:02 RobinSchmidt

i have no idea, how it will sound like, but i'm pretty sure, it will make for great visuals on the scope :-)

RobinSchmidt avatar Feb 24 '18 01:02 RobinSchmidt

The stereo 1D image version of the waveform looks like a supersaw. If you can do subtle modulation of the details of the waveform this could make for an interesting chorusy waveform.

elanhickler avatar Feb 24 '18 04:02 elanhickler

i currently can't see any straightforward way to modulate the synthesis (i.e. rendering) parameters as these parameters are either strings or an integer (the number of iterations) and also, re-rendering of the (wave) tables is computationally expensive as hell. the only continuous parameter is the angle, but it doesn't seem to make much sense to modulate it - it must be set to a very specific value in accordance to chosen L-system rules in order to get a closed loop.

but maybe some real-time post-processing can be slapped on the waveform. maybe an allpass with different frequency for left and right channel. i think, that would shift the overtones a bit back and forth

RobinSchmidt avatar Feb 24 '18 13:02 RobinSchmidt

...but perhaps it could make sense to do a kind of crossfading between various similar pre-rendered wavetables (for example, those obtained from the same L-system with different number of iterations) as in the waldorf sense of wavetable synthesis

RobinSchmidt avatar Feb 24 '18 14:02 RobinSchmidt

the only continuous parameter is the angle, but it doesn't seem to make much sense to modulate it

thinking about it some more, i think modulating the turning angle in realtime (if that would be computationally possible in any meaningful way) would give results similar to just modulating a post-processed 2D rotation of the resulting picture. maybe not quite the same, but similar

RobinSchmidt avatar Feb 24 '18 14:02 RobinSchmidt

perhaps it could make sense to do a kind of crossfading between various similar pre-rendered wavetables

..when i integrate this generator into my upcoming dream-synth with its 4 sources that are crossfadable via a vector pad, i could set all 4 sources to similar L-system shapes and modulate the x/y coordinates of the vector mixer pad

RobinSchmidt avatar Feb 24 '18 15:02 RobinSchmidt

Make it modulatable, I can't imagine it is more expensive than my synths Radar, and Spiral Generator.

elanhickler avatar Feb 24 '18 15:02 elanhickler

hmmm...i really need to think about it. maybe it's possible to make the turning angle of the L-system modulatable. ...because it's actually not a parameter of the L-system itself but of the "turtle graphics" interpreter (which interprets the output string of the L-system as drawing commands, i.e. "go forward", "turn left", "turn right"). i think, the turtle can be modified to produce one point at a time (instead of rendering the whole table of points at once). i have an idea how that may be possible....but first things first

RobinSchmidt avatar Feb 24 '18 16:02 RobinSchmidt

first audio signals produced. image maybe in a few hours or tomorrow, it's ready to actually play with it and explore the range of possibilities (some important basics like state-recall are still missing). first impression of the sound: it has a sort of organ-like quality to it with more iterations having the effect of adding in more upper registers or something - which is actually not really surprising at all, when thinking about it.

edit: so, as one option for modulation, it may really make a lot of sense to modulate a crossfade between various iterations of the system, i.e. various levels of detail. and the lower-detail versions are not necessarily much duller since the shapes of the details and basic shapes are non-sinusoidal - they can even have edges, so it's not like crossfading with a lowpassed version

RobinSchmidt avatar Feb 24 '18 20:02 RobinSchmidt

i just found a link that i need to save: http://algorithmicbotany.org/papers/#abop i feel like having stumbled upon a whole new branch of mathematics that has nothing to do with what i have seen before (apart from some introduction into formal languages in computer science lectures during study). ...but all the "normal" math stuff - geometry, linear algebra, calculus, complex numbers - even number theory - all that seems to be irrelevant here - but somehow it's still math. math is sooo diverse. amazing! but maybe it's not mathematics but algorithmics? but that latter term seems to be not be widely used

RobinSchmidt avatar Feb 25 '18 06:02 RobinSchmidt

even the fractals that i have encountered so far were based on a totally different mechanism. in the most general case, you had a vector valued function y = f(x) where x and y are vectors in the same space and f is some nonlinear function that maps an input vector onto an output vector...and then you apply that function again and again and again to some initial vector...that makes a nonlinear recursive system. and for some systems, the iteration diverges for some initial vectors and doesn't diverge for others. the boundary between those classes of starting points has a fractal shape. the well known mandelbrot set:

https://en.wikipedia.org/wiki/Mandelbrot_set

is a famous example of that (the complex-number formulation of the function f(z) can straightforwardly be translated into a function mapping 2D vectors onto 2D vectors). but all of this is rooted in "normal" math ...this L-system stuff here is conceptually completely different

RobinSchmidt avatar Feb 25 '18 06:02 RobinSchmidt

the complex-number formulation of the function f(z) can straightforwardly be translated into a function mapping 2D vectors onto 2D vectors.

i think:

z_new = f(z) = z^2 + c

translates to:

x_new = f(x,y) = x^2 - y^2 + cx  // cx == Re(c)
y_new = f(x,y) = 2 * x * y + cy  // cy == Im(c)

when you want to do it without complex numbers. iterate that and observe, if the vector explodes or not. paint starting-points for which it doesn't explode black and points where is does explode white and you get a basic (black/white) picture of the mandelbrot set. artistic renderings often take into account, how fast it diverges and choose a color according to that value.

edit: wait: no! the mandelbrot set is the set of (complex) values of c for which the iteration (started at z=0) doesn't diverge. i always confuse that

RobinSchmidt avatar Feb 25 '18 07:02 RobinSchmidt

maybe it's not mathematics but algorithmics?

...but why does it feel so totally different? i think, maybe it's because one of the most fundamental concepts of math - the equation - does not really play a big role there? ...and also because it's not numeric (it operates on strings)

RobinSchmidt avatar Feb 25 '18 08:02 RobinSchmidt

by the way - i just noticed that my text editor seems to behave buggy as hell. does it work for you as it should in the comment section of chaosfly?

RobinSchmidt avatar Feb 25 '18 16:02 RobinSchmidt

ooookaaaay....the fun can begin! there are still a couple of quirks and bugs but at least it's now possible to explore L-systems. i created a new repository with presets and i already created some quite interesting shapes here:

https://github.com/RobinSchmidt/Presets/tree/master/Snowflake

very interesting is to load MooreCurve4, play a very low note and put an EngineersFilter after that, set it to bessel lowpass (of somewhat high order) and tweak the cutoff frequency. if that reminds you of the gif of the rolling circles (https://i.redd.it/9pa7fosfjjgz.gif) that initially sparked my interest in all this stuff, it should. it's a sort of replication of what's going on there (just with a bessel filter instead of a perfect linear-phase brickwall filter which would correspond to the gif). very satisfying. ok...tomorrow maybe a bit more exploration and playtime and then back to work on the multicomp gui. but i just had to do this

RobinSchmidt avatar Feb 25 '18 23:02 RobinSchmidt

btw. - can you recommend me a software for doing screen capture videos? i may want to make some in the future as well....

RobinSchmidt avatar Feb 25 '18 23:02 RobinSchmidt

endless variation of interesting shapes, not necessarily self-similar image

RobinSchmidt avatar Feb 26 '18 02:02 RobinSchmidt

damn! you are right! i have to make the turning angle modulatable. this is not like just rotating the whole picture. it's actually much more interesting. if you want to try it, i recommend to load the patch PentaT (it's the patch that created the pic above) and move the "TurningAngle" slider by hand. of course, there are lots of artifacts now because changing the angle triggers a re-rendering. but if i implement it in a way that expects the angle to be modulated, i think, that could make for a great effect - both sonically and visually.

RobinSchmidt avatar Feb 26 '18 03:02 RobinSchmidt

by the way - i just noticed that my text editor seems to behave buggy as hell. does it work for you as it should in the comment section of chaosfly?

It has been buggy from the beginning.

btw. - can you recommend me a software for doing screen capture videos? i may want to make some in the future as well....

if you have a good or modern video card: https://obsproject.com/ (you have to set video card capturing option if you have a modern video card, nvidia GTX or radeon RX to take advantage of video card based capture).

if you have an old or crappy video card: https://getsharex.com/

elanhickler avatar Feb 26 '18 17:02 elanhickler

DO NOT USE THE AUDIO CAPTURE FROM EITHER PROGRAM! The audio sucks... I haven't figured out how to record good audio from them. Use another software for uncompressed audio capture.

edit: oh but then you need a program to align the audio and video. If you don't have that, then best to capture audio with the video software. Also, always capture audio with the video software so it is easier to align audio/video if you record audio separately as well.

elanhickler avatar Feb 26 '18 17:02 elanhickler

i have many ideas, how to extend the turtle-graphics and lindenmayer-system syntax in meaningful ways to allow for even more variation of the geometry. i think, a whole new synthesis paradigm can be created from this...i'm very excited about this stuff (as you have undoubtetly noticed). i think, i'll call it Fractal Geometry (FG) synthesis. ..it needs a catchy name

ah: and thank you for the links!

RobinSchmidt avatar Feb 26 '18 19:02 RobinSchmidt

an evil alien from independence day :-O

image

... and this patch also sounds good (AlienFace.xml). edit: i mean, "patch" is a bit exaggerated. these presets are "raw" oscillator waveforms, i.e. starting points

RobinSchmidt avatar Feb 28 '18 15:02 RobinSchmidt

pooooost auudioooooooooooo

looks great.

can i sell any of this as a soundemote product? what do you want to do? do you want to work together at all?

I can make you big bucks. My company will grow.

elanhickler avatar Feb 28 '18 15:02 elanhickler

i do not yet have the means to produce video with audio - but will hopefully do soon. you can try it yourself. just build ToolChain, plug in Snowflake into the first slot (and trigger a (preferably low) note) and skip through the presets (just download the preset repo into standard preset folder C:\Users[Username]\AppData\Roaming\RS-MET\Presets). maybe plug a BreakpointModulator into another slot and route it multiplicatively to the amplitude for basic amp-enveloping (but it behaves sometimes a bit buggy).

...i want to fix a couple of bugs and then also get back to the multicomp gui. ...but it's really a rabbithole. i'm just scratching the surface. using filters on the output is also sometimes very useful - especially for the moore curve. if you want to preserve the shape best, use bessel (lowpass) filters - check out MooreRotor.xml - and slap a bessel lowpass on it and open it slowly. instant scifi drones :-D

RobinSchmidt avatar Feb 28 '18 16:02 RobinSchmidt

...and i really need to write up a tutorial at some point to explain what (the fuck) is going on there, so a sound designer can actually know what (the fuck) he's doing. it's very unlike common synthesis methods

RobinSchmidt avatar Feb 28 '18 16:02 RobinSchmidt

can i sell any of this as a soundemote product? what do you want to do? do you want to work together at all?

i want to use it as one of the generators in my upcoming dream synth - but yeah, sure, if you want to also make a synth from it for your oscilloscope-music synth series, we can certainly work together on that. maybe you can commission the further development of the algorithms and/or we do some revenue sharing or something. we have to figure something out that is practical and fair for both of us

I can make you big bucks. My company will grow.

that would be great!. ...could be advertised as novel synthesis method. ...fractal pattern synthesis

RobinSchmidt avatar Feb 28 '18 17:02 RobinSchmidt

ok, it is good to know you are open to the idea. Nothing has to happen right away, I will let my mind work on this.

elanhickler avatar Feb 28 '18 18:02 elanhickler

i just fixed a bug - there was a sort of buzzing artifact when CyclicReset was 0. it didn't sound necessarily bad, but it was wrong anyway. this is fixed now. the MooreRotor had it before - it's gone now

RobinSchmidt avatar Feb 28 '18 22:02 RobinSchmidt

Ok this is pretty cool. I tried it. You need phase and frequency modulation! You also need LFOs and my feedback system.

You need to...... just copy what I'm doing with Jerobeam stuff 😄

Or I can take your core module and put it inside an OMS product and give you the same (or similar royalties) deal I gave Jerobeam.

elanhickler avatar Feb 28 '18 23:02 elanhickler

I will have suggestions before I make it a Soundemote product.

  1. Add a control for "the length of the pattern" from 0 to 100%, but the frequency should remain the same. Essentially, moving this control will give you a "slowly being drawn" effect on an oscilloscope.

  2. Can you think of a way, without a filter, to add/remove harmonic content? Like some modulation of some part of the algorithm that happens to make the shape less spikey, more rounded. If not, then make a dedicated non-resonant filter for snowflake.

elanhickler avatar Mar 01 '18 00:03 elanhickler

Or I can take your core module and put it inside an OMS product and give you the same (or similar royalties) deal I gave Jerobeam.

yes - that sounds good. i think, you have the surrounding environment already in place and would just have to plug in the core sound generator at the center. what is your arrangement with jerobeam?

Add a control for "the length of the pattern" from 0 to 100%, but the frequency should remain the same. Essentially, moving this control will give you a "slowly being drawn" effect on an oscilloscope.

how would that work? are you talking about traversing the pattern only partially and then reset? "slowly being drawn" is something i would just associate with playing a low frequency but i guess i'm misunderstanding you here

Can you think of a way, without a filter, to add/remove harmonic content? Like some modulation of some part of the algorithm that happens to make the shape less spikey, more rounded. If not, then make a dedicated non-resonant filter for snowflake.

yes, just a few hours ago i was thinking about that. for many patterns, the number of iterations adds harmonic content (well, for some you get totally different patterns, but that may also be due some mistakes in defining it via this turtle/lindenmayer syntax - i'm just learning all that myself - but for the AlienFace patch, increasing the iterations indeed adds harmonic content in a useful way). ...sooo a continuous number-of-iterations would be nice. when it's set to 3.5, you'd get a 50/50 crossfade between 3 and 4 iterations. well, this is my idea. but a non-resonant bessel filter can be plugged after it anyway. also, regular resonant filters (like my ladder) are also nice. you loose some of the symmetries that bessel filters would preserve but it often looks good anyway (and sometimes because of it). but yes, in the back of my head i was already thinking about making a modulatble bessel filter. (the current implementation is expensive to modulate and doesn't really use a modulatable topology - you can modulate it anyway, but i think, i should make a dedicated version with good modulatability properties desgned in)

RobinSchmidt avatar Mar 01 '18 03:03 RobinSchmidt

some modulation of some part of the algorithm that happens to make the shape less spikey, more rounded.

i also want to include cubic interpolation later. it currently works like that: the drawing algorithm (the "turtle") generates a sequence of x,y points, between which i linearly interpolate to generate the time signal. using cubic interpolation instead would also round edges. ...and one could also crossfade beween linear and cubic interpolation. and/or left/right/nearest neighbour interpolation. there, the signal would jump from spot to spot, so on the scope only the corner points would be visible and in the time-signal, we would have discontinuous jumps - with all their harmonic creating properties

RobinSchmidt avatar Mar 01 '18 04:03 RobinSchmidt

that all sounds good.

my "appears like it's slowly being drawn" idea is... I guess it would be like a partial reset. However, resetting causes ugly discontinuity (only useful sometimes). So what you do is traverse the pattern forward, then traverse in reverse. (This is achieved by doing phase modulation with a tri-saw shape oscillator)

Imagine drawing a half circle. Instead of jumping to the other side to draw the half circle once again, you reverse directions, you re-trace/trace over in order to not jump and cause discontinuity.

...i better create a demonstration of this with my OMS.

elanhickler avatar Mar 01 '18 07:03 elanhickler

my arrangement with Jerobeam is 30% royalties.

Edit: So I can give you 30% royalties unless you are responsible for more of the synth (if you basically create the final product mostly or completely on your own then I would give you more). But consider that I will be doing marketing, GUI design, including all my personal DSP, etc.

elanhickler avatar Mar 01 '18 07:03 elanhickler

this DragonCurve.xml here looks and sounds quite good: image also, the number of iterations increases harmonic content in a useful way. https://en.wikipedia.org/wiki/Dragon_curve (i'm using a closed loop version of it)

RobinSchmidt avatar Mar 01 '18 18:03 RobinSchmidt

very nice. You frequency is too high for that image to be drawn accurately though. :)

elanhickler avatar Mar 01 '18 18:03 elanhickler

indeed! here's a better rendering using a very low frequency and different colormap: image haha! this is really fun! btw. the number of iterations is already maxed out at 10 here in this pic. it could actually use one or two more levels of detail

RobinSchmidt avatar Mar 01 '18 21:03 RobinSchmidt

Are you doing or can you do anything to lessen harmonics as frequency increases (as an antialiasing technique)? It's always good to reduce harmonics before going to oversampling / antialiasing filter.

elanhickler avatar Mar 02 '18 00:03 elanhickler

there isn't any kind of anti-aliasing at work yet - and that thing does alias as hell. i just had some idea what i could do that wouldn't require any (explicit) oversampling. when playing a high frequency, the turtle itself may move over various line segments within one sample instant. that is: the turtle output already is an oversampled signal with respect to our audio sample rate. i think, i should apply a lowpass to that while i let the turtle walk around. the (normalized) frequency of that lowpass should depend on our readout frequency, so as to keep the absolute frequency of the lowpass constant. that is: in this case, not the cutoff frequency but the sample-rate of the lowpass is modulated according to the signal frequency (which is in effect the same because the numbers (filter coefficients, etc.) depend only on the ratio of cutoff/sampleRate)

RobinSchmidt avatar Mar 02 '18 03:03 RobinSchmidt

OMG! FUCK YEAH!!! i just added a feature for resetting the turtle after a given number of produced lines - and this is the KILLER feature! pull an update and check out the new patches AlienFace2 and 3 and BuzzingTriangles. sounds and looks already amazing. now tweak the TurningAngle parameter! AlienFace3 is my favourite!

btw - ignore that AntiAlias button - this doesn't work right yet

RobinSchmidt avatar Mar 02 '18 20:03 RobinSchmidt

i actually think, that the resetting strategy should be considered as another major aspect of the synthesis method. just resetting after completing a given number of cycles through the curve and (additionally, independently) resetting after some line counter has reached its maximum is very simple. i think, i should come up with more sophisticated resetting algorithms. i'm thinking of using something like my line-count based resetter, but not reset every time, the number of lines is reached, but let that depend on the value of some binary sequence (1 means: do reset, 0 means: don't reset) ...and then look into interesting ways to generate such sequences. one possibility would be to use L-systems once again and interpret '+' as '1' and '-' as '0'. but there are other ways as well. on monday, i received my copy of this wonderful book:

http://www.abrazol.com/books/patterngen/

...for 14 euros at amazon, that was a no brainer - and it's a gold-mine. containing lots of example pictures with construction information. the AlienFace patch is actually one of those. ...and - besides L-systems - it also talks about other methods to generate binary sequences. i may implement some of them as well in the future

RobinSchmidt avatar Mar 03 '18 16:03 RobinSchmidt

ah - the examples are online is well - it's actually this one:

http://www.abrazol.com/books/patterngen/image/trees60d04.svg

from here (almost at the bottom):

http://www.abrazol.com/books/patterngen/images_lsys.html

...but my rendering looks different...hmm...have i messed up something? i need to figure that out. if so, i think, it would count as happy accident

RobinSchmidt avatar Mar 03 '18 16:03 RobinSchmidt

have an option to reverse direction instead of just reset. Although I could add that myself with phase modulation. You have a phase variable?

Edit: this is the reason you need a tri-saw shaper for phase modulation, so you can reset, or variably reverse direction at variable forward/backward speed. Even better would be a variably curved triangle, where backwards-forwards have individual curve settings.

Edit: and for the "length to draw" variable, you can't just rely on hard reset otherwise you have an ugly jump. So that's where reversing direction is super useful.

elanhickler avatar Mar 03 '18 17:03 elanhickler

yes - that's a good idea. i'll have to see how hard or easy that will turn out to implement. i do have a "phase" variable (it's pos in class TurtleSource)...but there's no easy and straightforward way to just "set" it in a random access way. to set it to some arbitrary value, i would actually have to traverse the curve from the current position to the desired target position - which may be expensive. ...sooo...i guess...phase-modulation is difficult (or i must think harder)...but frequency modulation seems to be no big deal, i think

RobinSchmidt avatar Mar 03 '18 18:03 RobinSchmidt

thennnn forget about phase modulation!

then make a phase mod to frequency mod converter... haha... I was going to pay you for this when I can.

elanhickler avatar Mar 03 '18 18:03 elanhickler

...unless the optional table-mode is used (where i just pre-render the whole curve into a table and read from that) - in this case, randomly setting the position is trivial. but that mode is limited in other ways (no turn-angle modulation, for example :-( )

RobinSchmidt avatar Mar 03 '18 18:03 RobinSchmidt

don't do table mode.

elanhickler avatar Mar 03 '18 18:03 elanhickler

that's why it's optional. it's actually a remnant of the first implementation - it was just simpler to do (it was surprisingly tricky to implement a realtime turtle - you have to keep track of the index in the command-string which not equal to the index of the line being drawn etc...). but i think i'll don't throw the table code away but keep it as option. it's also useful for debugging - writing unit tests and compare outputs from table mode and non-table mode. when they don't match, there's a bug somewhere

RobinSchmidt avatar Mar 03 '18 18:03 RobinSchmidt

you can have negative frequency, right? wouldn't that reverse the direction? so that's part of the function of converting phase mod to freq mod.

elanhickler avatar Mar 03 '18 19:03 elanhickler

not yet - but yes, this is the way i'm planning to implement to reverse direction (by negative frequency / negative position increment). my turtle does not yet support to go backward, nor does my realtime turtle-driver support to go backward in the turtle command string. but i hope that this will be straightforward to add

RobinSchmidt avatar Mar 03 '18 21:03 RobinSchmidt

i think, i should come up with more sophisticated resetting algorithms

...aaand i just discovered that the same authors that wrote the pattern generation book wrote another one which may be just what i need:

http://abrazol.com/books/rhythm1/

i think, we may need resetting algo-rhythms! instantly ordered. :-) ...and actually they wrote some more:

http://www.exstrom.com/stefan/stefan.html

some of which might be interesting later. especially the one about finite automata

RobinSchmidt avatar Mar 04 '18 00:03 RobinSchmidt

hmmm...i just discovered a problem. i implemented the possibility to render only a partial picture by resetting the drawing algorithm early, before it could finish drawing the whole picture. ok - straightforward enough and works as expected. next i wanted to let the user adjust the start-position inside the drawing, i.e. that start "phase" to make it possible to draw different parts. now there's a problem: it works only for some patches, namely those which don't use saving and restoring the turtle state during drawing (if you have no idea what that means, look at this document (still very much under construction): https://github.com/RobinSchmidt/RS-MET/blob/master/Documentation/Tutorials/FractalPatternSynthesis.md). if you try start-phase adjustment with patches that use the state-stack, unpredictable chaos results

hmmm...that's sort of bad - although, when trying the feature in patches where it does work, it didn't seem to be that useful anyway - at least from a sonic point of view, so i disabled it for now (by just making the slider invisible). i would expect the same (or a similar) problem to appear when i introduce support for negative frequencies / time-reversed read-out

RobinSchmidt avatar Mar 09 '18 11:03 RobinSchmidt

sooo...i need to think about ways to reconcile start-position modulation and time-reversing with the turtle state stack. in case of reverse readout, i think, it could be done by swapping the interpretations of [ and ] during reverse readout. i think, i must also swap left-turns for right-turns and vice versa and of course taking a step backward instead of forward on F

RobinSchmidt avatar Mar 09 '18 11:03 RobinSchmidt

ok - i made some good progress. it supports negative frequencies now (mostly - with some L-system definitions, it goes out of whack) and also phase-modulation (both in free-running-turtle mode - in table-mode, such things are trivial anyway ...although phase-mod seems to drain the cpu when going into the negative...hmmm...we'll see). anyway, skipping through the presets is already good fun. there some real gems in there already.

i'll put it on the shelf for the next week for work on the multicomp gui and maybe do some preset design on the side for recreation

RobinSchmidt avatar Mar 17 '18 15:03 RobinSchmidt

i have now also implemented the feature for periodic reversal of the direction. seems to work. there are now two independent resetters and one reverser (and the number of those can easily be upped) - each of which has its own periodicity/interval which acts independently from the others. these intervals can be set up as a multiple/fraction of the signal period. ...plus some frequency dependent additive offset - the idea is that when the different resetters/reversers have slightly different intervals, we hear a sort of modulation. using these offsets, we can keep the "modulation-frequency" constant across the keyboard.

the remaining missing feature: continuous adjustment of the iteration number is more complicated. i'm working on the multicomp gui now, so this shall be postponed until i'm done with this. ...ah and also anti-aliasing will have to be added later (although, one could always simply do an oversampling wrapper - but i hope, i can do better)

RobinSchmidt avatar Mar 21 '18 14:03 RobinSchmidt

Alright, I think my release schedule will be this:

  1. Update all Oscilloscope Music synths
  2. Release free version of Filters of Mass Desctruction
  3. Release Fractal Generator (pay you in royalties)
  4. Release paid version of FMD

So, would be nice to have antialiasing before then.

elanhickler avatar Apr 02 '18 04:04 elanhickler

  1. Release Fractal Generator (pay you in royalties)

did you already wrap the snowflake code into your framework? maybe, we should talk about the exact conditions first.

my arrangement with Jerobeam is 30% royalties. So I can give you 30% royalties unless you are responsible for more of the synth (if you basically create the final product mostly or completely on your own then I would give you more). But consider that I will be doing marketing, GUI design, including all my personal DSP, etc.

hmm...well - i am providing not just the algorithm prototypes but the ready-to-use c++ code along with a whole bunch of (pre)-presets. i'd actually consider a 50/50 share more fair (consider that i have also written the framework under your framework)...but then, i don't really care that much because if you make lots of money with it, you have more funds to hire me for other work...so whatever...

RobinSchmidt avatar Apr 09 '18 17:04 RobinSchmidt

My responsibilities include:

  • website management
  • advertisement, promotion, social media
  • audio demos
  • video demos
  • creating the gui (using your framework)
  • testing
  • adding in my own DSP (somewhat built on your DSP, but some of my code is my own, AND some of the code I I paid you for already)
  • paying artist for art assets for gui (planned)

Your responsibilities

  • research
  • DSP and programming
  • testing
  • framework

If you want 50% then I'll ask you to take on more responsibility.

elanhickler avatar Apr 27 '18 22:04 elanhickler

maybe we should talk about this on a non-public channel. i'll send an email soon

RobinSchmidt avatar Apr 29 '18 03:04 RobinSchmidt

i just stumbled over this today: http://benice-equation.blogspot.de/2012/01/fractal-spirograph.html i wonder, what kind of equation is behind that. it's definitely something very different from my turtle/lindenmayer approach (it seems to be based on revolving cirlces). ..i .need to explore...might make for another fractal synthesis algo based on a totally different idea (and still not even being close to the mandelbrot approach)

RobinSchmidt avatar Apr 29 '18 03:04 RobinSchmidt

crashes at 0 frequency! plz fix!

Edit: Antialiasing button seems to do nothing

elanhickler avatar Jun 09 '18 08:06 elanhickler

elanhickler avatar Jun 09 '18 17:06 elanhickler

I believe you have found me. Can you please insure that is real and not a redo to trick me. And please update my github. Thank you very much.

Get Outlook for Android


From: Elan Hickler [email protected] Sent: Saturday, June 9, 2018 6:18:04 PM To: RobinSchmidt/RS-MET Cc: G.moore; Manual Subject: Re: [RobinSchmidt/RS-MET] Snowflake - fun with fractals (#194)

[https://camo.githubusercontent.com/e5ba92fb0a032b9d4b27a6870a434a1a8803e1ce/68747470733a2f2f692e696d6775722e636f6d2f304f6c53497a462e706e67]https://camo.githubusercontent.com/e5ba92fb0a032b9d4b27a6870a434a1a8803e1ce/68747470733a2f2f692e696d6775722e636f6d2f304f6c53497a462e706e67

[https://camo.githubusercontent.com/a4d650fccf3d27b90eef0429b0f9df4757a0e1ce/68747470733a2f2f692e696d6775722e636f6d2f314e31706e67382e706e67]https://camo.githubusercontent.com/a4d650fccf3d27b90eef0429b0f9df4757a0e1ce/68747470733a2f2f692e696d6775722e636f6d2f314e31706e67382e706e67

[https://camo.githubusercontent.com/a4c4b45f1ddb4cd2583f91e3949dbee2a1791959/68747470733a2f2f692e696d6775722e636f6d2f547a6e61544e372e706e67]https://camo.githubusercontent.com/a4c4b45f1ddb4cd2583f91e3949dbee2a1791959/68747470733a2f2f692e696d6775722e636f6d2f547a6e61544e372e706e67

[https://camo.githubusercontent.com/41487fb0dd7cc53bb5f67c9a5497b5c9c15506ad/68747470733a2f2f692e696d6775722e636f6d2f623174435656752e706e67]https://camo.githubusercontent.com/41487fb0dd7cc53bb5f67c9a5497b5c9c15506ad/68747470733a2f2f692e696d6775722e636f6d2f623174435656752e706e67

[https://camo.githubusercontent.com/941110b67de7c3d2e647a11ea8a67cf47cf736b2/68747470733a2f2f692e696d6775722e636f6d2f6c7a375a4264582e706e67]https://camo.githubusercontent.com/941110b67de7c3d2e647a11ea8a67cf47cf736b2/68747470733a2f2f692e696d6775722e636f6d2f6c7a375a4264582e706e67

[https://camo.githubusercontent.com/c2c6b14f4b6213df46c251c03dbd91d56790f7bc/68747470733a2f2f692e696d6775722e636f6d2f5246624c665a6a2e706e67]https://camo.githubusercontent.com/c2c6b14f4b6213df46c251c03dbd91d56790f7bc/68747470733a2f2f692e696d6775722e636f6d2f5246624c665a6a2e706e67

[https://camo.githubusercontent.com/a0e4e742c81087a22d3013019912f16401b0bd1c/68747470733a2f2f692e696d6775722e636f6d2f516f53644171442e706e67]https://camo.githubusercontent.com/a0e4e742c81087a22d3013019912f16401b0bd1c/68747470733a2f2f692e696d6775722e636f6d2f516f53644171442e706e67

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/RobinSchmidt/RS-MET/issues/194#issuecomment-395985099, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgHJcUXtq7F9EGMnv3iKKf8ma-8bMnOwks5t7ANMgaJpZM4SRsRQ.

ghost avatar Jun 09 '18 18:06 ghost

crashes at 0 frequency! plz fix!

should be fixed

Edit: Antialiasing button seems to do nothing

yep - as stated above - it's not yet implemented

cool pix!

RobinSchmidt avatar Jun 09 '18 22:06 RobinSchmidt

btw. - hilbert curves are actually useful: https://www.youtube.com/watch?v=3s7h2MHQtxc&index=2&list=PLZHQObOWTQDO__zBYmoxntqx3yBpuXQBl

RobinSchmidt avatar Jun 09 '18 22:06 RobinSchmidt

I believe you have found me. Can you please insure that is real and not a redo to trick me. And please update my github.

?? i don't understand that. who are you?

RobinSchmidt avatar Jun 09 '18 23:06 RobinSchmidt

probably a spam post.

elanhickler avatar Jun 09 '18 23:06 elanhickler

hmmm :-O spam on github? never had that before. strange....

RobinSchmidt avatar Jun 09 '18 23:06 RobinSchmidt

prettyscope and snowflake are a great combo for creating art! i find the intersection of math and art the most fascinating thing there is. it's so satisfying and fun to work in that area. no matter if it's audio or visual art.

RobinSchmidt avatar Jun 09 '18 23:06 RobinSchmidt

i made a new filter prototype that should be ideally suited for artifact-free parameter modulation and can realize (almost) any biquad transfer function (there are singular cases where it can only approximate it with great precision - but that shouldn't matter in practice). it will probably be useful for implementing a modulatable bessel filter. ...but now really back to the cycle marks

RobinSchmidt avatar Jun 16 '18 16:06 RobinSchmidt

I don't get it, what do you mean artifact-free parameter modulation? Parameter modulation artifacts depend on the audio signal being outputted, not by the modulation. Or do you mean this is only useful for the modulatable bessel filter? Or do other filters also benefit? Confused as to how I might benefit. 😄

elanhickler avatar Jun 16 '18 18:06 elanhickler

think of a regular biquad filter, straightforwardly implemented in what is called "direct form 1" in dsp lingo. the output sample y[n] at sample instant n is computed as: y[n] = b0*x[n] + b1*x[n-1] + b2*x[n-2] - a1*y[n-1] - a2*y[n-2] i.e. as a weighted sum of the current input sample x[n], two previous input samples x[n-1], x[n-2] and two previous output samples y[n-1], y[n-2]. the weighting coefficients b0, b1, b2, a1, a2 are computed from the user parameters (cutoff, reso, filter-type, etc.) - the formulas for these computations is where all the complicated dsp-math is located (laplace-transform, z-transform, bla bla bla). now, the user changes the cutoff and/or resonace or whatever other parameter. coefficients have to be recomputed. now, the stored "past values" (y[n-1], etc.) sort of become invalid. consider the case of setting the cutoff from 2kHz to 500Hz - from one sample to the next. the new coefficients together with the old filter state may create a sort of transient in the output signal

RobinSchmidt avatar Jun 16 '18 22:06 RobinSchmidt

there's a recent thread in the kvr dsp forum about exactly this issue: http://www.kvraudio.com/forum/viewtopic.php?f=33&t=506213 now, the challenge is to come up with other filter structures (different from this "direct form 1") that exhibits better responses to sudden changes of the coefficients (using internal state variables other than the past in/out samples). i think, i have found a structure that should be well behaved in this respect. ...some experimentation and testing is needed, but i think, the lions share of the work is done (at least as far as i can see from a theoretical point of view). my "filter-state" is a 2D vector and the recursive part of the filter scales and rotates this vector (rotation angle depends on cutoff/resonance frequency, decay depends on Q) - and suddenly changing these things will not affect the validity of the state vector

RobinSchmidt avatar Jun 16 '18 23:06 RobinSchmidt

do other filters also benefit?

yes - any filter that can be expressed as a biquad (or serial or parallel connection of biquads) can benefit (parallel would actually be better). ...which means pretty much any filter. engineers filter is a series connection of biquads. with the current implementation, i wouldn't even think of trying to modulate a high-order elliptic filter's cutoff with a square wave - it would probably completely mess up. with the new structure, it might be practical (albeit expensive - but i'm just talking about stability and transients here)

RobinSchmidt avatar Jun 16 '18 23:06 RobinSchmidt

I wonder if that means you'd want to use one of your engineer's filters to do FFT-like operations where modulating the filter cutoff is required to track / extract, for example, the fundamental and other partials of a guitar.

elanhickler avatar Jun 16 '18 23:06 elanhickler

indeed, it could be useful for partial extraction when the frequency of the partial is changing and the filter must track these changes. but in partial extraction, i would probably want to apply it bidirectionally and i currently have no idea if such a bidirectional filter will preserve its desirable zero-phase property when being modulated (in fact, i don't even have a concept of a "phase-response" in the time varying case - the concept actually applies only to linear, time-invariant (LTI) filters). for this reason, maybe a time-variant FIR might be still better in this case. but it's something that may be worth to explore. but it was not really the main goal here

RobinSchmidt avatar Jun 17 '18 00:06 RobinSchmidt

my "filter-state" is a 2D vector and the recursive part of the filter scales and rotates this vector (rotation angle depends on cutoff/resonance frequency, decay depends on Q)

in this respect, it is actually the same thing that i did with my PhasorFilter which is conceptually more or less the same as this:

https://ccrma.stanford.edu/courses/250a-fall-2003/hiqfilters.pdf

the new thing is that the new filter does not necessarily couple the x- and y-coordinates in a spiraling decay - they can now also decay exponentially independently. when being mixed together, this corresponds to two first order lowpasses in parallel that are added (with mixing coefficients). this extension makes almost every biquad representable by this structure. the only problem is a filter that has two identical (real) poles (the equations produce a division-by-zero in this case). but it can be approximated very closely by spreading the poles a little

RobinSchmidt avatar Jun 17 '18 02:06 RobinSchmidt

Where are you at with this? I want to use Snowflake to generate some funds so I can pay you royalties and hourly.

elanhickler avatar May 05 '19 00:05 elanhickler