SynthMaker

Effects routing

Archive · 2005 19 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

unkargherth ·

Request for ideas on how to do it.

Take the following situation:

You have 4 effects to add to a synth. for simplification imagine all of them has one mono input and one mono output and no more pins

You want to provide the user to reorder the effects between them, ie. for effects A,B,C,D. the user should be able to est the order as

A->B->C->D or A->B->D->C or D->C->A->B

or any other of this kind, but no

A->A->C->B nor A->C->B->A

Any idea on how can it be done?

Seems simple, but i've been unable to do it in SE during years without duplicating evry effect as many times as chain length, and by now, found no way to do it in SM.

Requirements;

.- Chain always be of Four EFFECTS ( later they can be bypassed, but this is trivial) .- Every effect SHOULD be appear EXACTLY ONCE in the chain, in any position .- Effects should pass anything on ouput except the audio signal

Bonus for a general solutions not limited to 4 effects. Also Bonus for a solutions aplicable to Poly in and out's.

NothanUmber ·

Sorry for people that got confused by my first attempt, it wasn't just unefficient, it didn't work at all, I had a knot in my logic there, the thinking before posting concept would have been appropriate here... I haven't found another efficient bitwise linear mapping function, so one meal later here a more "traditional" approach with a helper function 🙂 For n components you should have n! possibilities to build loopless chains out of them. Now if you use a variable x with values {0..(n-1)!} every value of that variable represents a unique chain. Now you need a function pos(i) = position(x,i) that determines the position of the i'th component for a given "permutation value" x. In order to define such a function you could use a help function nextPermutation(t,i) that recursively permutates a start tuple t =(1,2,3,.... n) i times. Such a function could look like that: nextPermutation([head|tail],i) = insert(head,i mod (length(tail) + 1),nextPermutation(tail,floor(i/(length(tail) + 1)) where insert(x,i,t) inserts the value x into the tuple t at the i'th position and nextPermutation([head|[]],0) = head. Now you can define the function position(x,i) = nextPermutation(t,x)[i] with t = (1,2,3,....n). These positions can then be used to program n selectors to determine the actual chain. It's a pity that SynthMaker doesn't support recursive functions (Bidule does, so it should be much easier there). But one could perhaps "iterate" through the recursion with two sample and hold components with a feedback path from the output of the second into the input of the first for the definition of nextPermutation (one sample and hold module stores the current function value the other one that leads into the input of the first one get's updated from the output of the first one every floor(i/length(tail) + 1) iterations). Lists could be possible with the preset manager... (a scripting language would simplify things a lot here...).

NothanUmber

unkargherth ·

Nice explanation NothanUmber !!!

Anyway, it seems non-trivial to me to implement it in a programming language ( allthougth i supose i can do it with enouht time), but implement that solution by wiring moddules seems a nightmare ( at least to me)

In fact seems a bit heavy too. For a 6 effects chain, if i understood, should implement 120 Selectors? I'm not sure it's worth the effort ( and Cpu hit!) for the result.

Anyway... are you a Math Teacher. Your language vaguely reminds me my Calculus teacher at University... (joke, no offense)

NothanUmber ·

unkargherth wrote: In fact seems a bit heavy too. For a 6 effects chain, if i understood, should implement 120 Selectors? I'm not sure it's worth the effort ( and Cpu hit!) for the result.

Nupp, 6 ones 🙂

unkargherth wrote: Anyway... are you a Math Teacher. Your language vaguely reminds me my Calculus teacher at University... (joke, no offense)

Explaining things more commonly without being too unprecise (or even wrong) is an art (<advertise mode> this book is the most genious thing i've ever read in that respect: http://www.amazon.com/exec/obidos/tg/de ... ce&s=books , Feynman is an explaining god </advertise mode>) I'll spend more energy into that direction next time.

NothanUmber ·

Couldn't rest before at least trying to implement that 😉 The first point I absolutely don't find a workaround for is... tadaaa... rounding floats up and down to the next int (and I'm sure that wouldn't have been the last pitfall...) In contrast to what I wrote above of course one needs two tuples of sample and holds instead of single sample and holds (that was possible to do with 6 sample and holds per instance and a bus). Perhaps it will be possible if more modules (converters etc.) are available (but nontheless a little bit masochistic without a proper code component) at the moment I've to resign 🙁

Tom7777 ·

Um this might help -

Modulation Matrix

🙂

NothanUmber ·

I'm not sure if that's what unkargherth is searching for but it would be a good advice for him to seek exactly that as it's already here ;P

P.S.: Have found a workaround for the rounding problem: One can use a counter that counts from the current tuple length to zero one tick in every insert step and use this to determine when to update the second tupel instead of the floor(seeabove...) variant. But now I have come to a definite end: First I thought that nextPermutation is a tail recursion (a recursion that can be easily transformed into a loop by moving the recursive part to the end of the formula) but didn't take into account that the growing size of the tupels also have an effect on the number of iterations in the insert part of the recursion - so we essentially need a stack that isn't avialable in Synthmaker - so I give up on it even more definitly than before 😉 - end of dream. (No, to be exactly it's the beginning of the dream that I should have already dreamt for one and a half hours if I would have thought out it right in the first place - shouldn't do this kind of stuff so late...)

Good night then, NothanUmber

P.P.S.: One essentially CAN translate nextPermutation into loops (one nextPermutation step only depends on it's (one) predecessor per insert cycle, so the space complexity should only depend on the maximal tupel size so a buffer should be hardcodable for a fixed max. tupel size), so it COULD be doable if there WON'T come up new problems - so if someone (with someone != me) is currently in a really masochistic mood i'll gladly hand him over what I currently have - otherwise I'd say - let's wait for an appropriate component from jorge&malc and use the time for better things...

Shifrin ·

NothanUmber wrote: P.S.: Have found a workaround for the rounding problem:

If I misunderstand, as I read through this quickly, forgive me! But... If you want to round a float value you can simply take the float output to an integer input with 0.5 added to it.

i.e. Your 'float' connected to an 'int' and also a constant 0.5 connected to the same 'int'. Ummm, or am I misunderstanding 😉

Shif.

NothanUmber ·

Shifrin wrote: If I misunderstand, as I read through this quickly, forgive me! But... If you want to round a float value you can simply take the float output to an integer input with 0.5 added to it.

i.e. Your 'float' connected to an 'int' and also a constant 0.5 connected to the same 'int'. Ummm, or am I misunderstanding wink

Thanks for the proposal! To be honest I didn't really understand your adding concept but it was a hint into the right direction: the decimal places of floats seem to be automatically cut if you route a float to an int, so floor(aFloatval) can be done by connection aFloatval to an integer input and ceil(aFloatval) is possible with floor(aFloatval) + 1 🙂 I don't try to mess around any more with directly hardcoding that algorithm, that's not fun with the current components. Malc said we won't see a code component for math stuff and midi until after SynthMaker 1.0 (which is a pity because we'll anyway come up with at least two new required components once the implement one new module, so in my point of view such a component is absolutely essential). So I'm evaluating atm. the possibility of writing an interpreter for a very simple virtual machine (a turing machine) directly inside SynthMaker that could be used for simple programming tasks (unkargherth's idea will probably be too challenging to program in that dead simple language but e.g. the note extractor and the bitwise logic and for integers that I need for my instrument could be doable (the string component converts a midi signal into a string that contains the note value, so there is a way... 😉 ) .) Here you can see try out such a machine, read descriptions how it's working etc.: http://wap03.informatik.fh-wiesbaden.de ... ng/tm.html

Btw.: Malc could you please make me a string comparsion module? (It is possible just with the int comparison thing but far less intuitive)

P.S.: a, I think see what you mean: round(aFloatVal) = ceil(aFloatVal) if floor(aFloatVal) != floor(aFloatVal + 0.5) and floor(aFloatVal) otherwise. Nice! P.P.S.: Does anybody know if it's possible to extract a single character out of a string? (That's needed to load single characters onto the band of the turing machine). Schnüff, would have been nice to have something like that... well I'll try if I can get it to work at least for integers...

ik ·

Along this line, ... here is an ABC (3 processor) schematics... With the selector knob (0 to 5) their order can be switched as A>B>C, A>C>B, B>A>C, B>C>A, C>A>B, C>B>A as serial of 'processors'. For the sake of simplicity the A,B,C 'processors' are x^2, x+1, and x/2, and the input is an integer. So it is simple to read that the schematics works as it should ... I think it is possible to do the same for audio signals ... See the schematics here:

and the file: http://www.mindspring.com/~ikaldor/ABC.zip

selector=0, ABC, selector=1, ACB, selector=2, BAC, ... ... etc.

on the picture as shown: input x=8, selector=2=BAC, result=x+1 > x^2 > x/2, processed in consecutive order: 8+1=9, 9^2=81, 81/2=40.5

Imagine effect unit blocks as A,B,C for audio signals. Hope it helps,

ik.

Tom7777 ·

Nice thanks ik 🙂

unkargherth ·

Nice ik. Veryuseful, althought that isn't what i'm asking exactly

In your sample, you preselected final posible combinations and the user is able to select one of them; ABC,ACB,BAC,BCA,CAB,CBA

i try to explain clearly

User see 3 popups, each with [A,B,C] options

Once the users selects A in first, A disappear from the list of available options from second an third. Obviosly, a reset button to refill the list will be needed

Internally what happens is: when the user select in first popup, A becomes the start of a chain of effects and audio signal is routed to there. Output of A is routed to the Signal out pin of the block. If then users selectes , supose, C in the second popup, then C effect is added after a in the signal chain, ie out of A is routedinto in of c, and out of C is routed to out in the block. if reset button is pressed signal pass from block in to out directly

Although this seems to be a problem of GUI in fact the complexity comes from: How do i build the list of options available for every [popup,selector] taking into account all the previously used [popup/selectors] to not include previously selected effect?

GUI representation of this will be the second headache on this issue once the logic is workin flawlesly

ik ·

Yeah, I did built something ... somewhat related before ... It was a macro, returned three numbers: The first number was selected by a switch, either 0, 1 or 2. The second number from an other switch, but only two now, which was NOT selected by the first switch, and the third number (no switch) returned the one which was not selected by either the 1st or 2nd switch. I wonder if this could be useful as controlling an "array" of three effects, where the returned numbers are the 'indexes' of the array. I'll dig out the file ... ik.

infuzion ·

I know where you're comming from , you're talking about the same setup Sampletank uses. 5 slots, popup list to choose an effect, etc... I would prefer to beable to have the same effect to beable to be chosen twice, because I often use reverb & EQ twice in the effect chain.

I wish I had the time to play with this idea, but I don't right now 🙁 But here's an idea-approach & see if it works for you:

1) First get a text-version working. Just have a string where the frist character is for the first effect, 2nd char=2nd effect... Perhaps use 1char Hex so that 0=ParmEQ 1=Multiband 2=Reverb 3=SpringReverb, etc... You can steal from your color-Hex conversion module to interpret the code.

2) Add some effects. Release a beta just to make sure people can choose & use the effects. Perhaps build the input string with some popup-lists. (I think this is what you want)

3) Fancy up the GUI & add more effects & there you go!

Anyhow, this is my future plan, since I have similar ideas.

unkargherth ·

Well. the condition of non repeting effects was stated to forbid feedback loops. If you want to use TWO times, ie, a compressor, simply include two diferent compressors in the list.

anyway, strings is the worst you can use by now, as there's near no primitives to work with them posibly i use integers to identify the effects (1=parameq, 2=Multiband,4=delay, 8=Reverb). NOtice i'm using powers of 2, so if final result is, 11, i know that user selected Parameq,delay and reverb

Nu Audio Science ·

Cant wait to see this develop, Sounds really cool 😉

unkargherth ·

I can believe i have been so stupid from begining.

I explain

What i requested for is the ability to control the user don't selects the module twice. The reason was to forbid feeback paths.

But, rethinking from teh begining, after the coment of infuzion, I asked myself why. SM does not forbid itself feedback paths, but the sound would be mixingfrom two passes on same effect and the result would be terrible

The most simple solution ( to accept the infuzion proposal is to duplicate all effects for every selection. So in fact user wouldn't be using the "SAME" exact effect twice never and sound don't get distorted

Why i didn't considered this? Because in any other way of building VST, this is prohibitively cpu and (secondary) memory consuming. BUT in SM AFAIK only that you use gets CPU time ( true Jorge,malc?) so i can perfectly have 8 Reverbs and if only one is selected, only ones gets CPU sharing, so there's no problem at all ( at least for a reasonbly grand total of effects. I expect nobody tries this with an effect rack of said 64 effects)

So as soon i can get time I show you a simple way to do this

Tom7777 ·

Usually when i make a big synth i have at least 25 effects. I did this when i was a SE user also but the memory use was much more than with SM. Im guessing we do it in different ways though so i would like to see the example for sure, it sounds interesting. 🙂

stefan ·

unkargherth wrote: Why i didn't considered this? Because in any other way of building VST, this is prohibitively cpu and (secondary) memory consuming. BUT in SM AFAIK only that you use gets CPU time ( true Jorge,malc?) so i can perfectly have 8 Reverbs and if only one is selected, only ones gets CPU sharing, so there's no problem at all ( at least for a reasonbly grand total of effects. I expect nobody tries this with an effect rack of said 64 effects)

This is correct 🙂

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.