SynthMaker

flanger

Archive · 2005 40 old posts

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

jorge ·

Here's an initial version of a flanger. I'm not really sure if the time and LFO frequency values I picked would make it a flanger by definition. The delay module might be useful for re-using. It reads an interpolated value from memory and assumes the memory is circular meaning that it also interpolates between the last and first value in the array. At least that's what it is suposed to do.

[old link]

Shifrin ·

Nice one jorge, I'd been meaning to try something like this myself, but you seem to have done some of the work for me 😉

Gonna check it out now!

Cheers,

Shif.

Josh ·

Thanks Jorge. Any chance of making a 'killer' phaser? 🙂

jorge ·

Eman Resu wrote: Thanks Jorge. Any chance of making a 'killer' phaser? 🙂

🙂 There would be a much higher chance if I knew what it was. I guess I'll consult "the computer music tutorial" after I fix the bug I've been stuck with for the last few hours.

unkargherth ·

Traditionally a phaser is an effect that produces "sweeping notches" over the signal. Usually the sweep is controlled by a sine osc. the number and frequency of notches is controlled by mixing in someway the original signal with the output of allpass filter ( or an allpass filter chain)

I tried to derive a sweepable allpass from your delay code, but SM keeps crashing again and again, so it's dificult to advance in any direction

I'll keep trying....

jorge ·

unkargherth wrote: Traditionally a phaser is an effect that produces "sweeping notches" over the signal. Usually the sweep is controlled by a sine osc. the number and frequency of notches is controlled by mixing in someway the original signal with the output of allpass filter ( or an allpass filter chain)

I tried to derive a sweepable allpass from your delay code, but SM keeps crashing again and again, so it's dificult to advance in any direction

I'll keep trying....

Thanks unkargherth. I've been fixing quite a few bugs, I've just uploaded a new version 0.9.3r which I recommend you download. I hope it works better. [old link] One thing you should know is that the code component saves the compiled code, it doesnt recompile when loading. To force it to recompile with the latest version just edit the code like typing a space and deleting it so you end up with the same code and it forces a recompile.

Here's a variation of the flanger, now it's a karplus followed by the flanger, I just thought it sounded nice, like an acoustic instrument.

[old link]

Shifrin ·

This is great stuff jorge, I finally got me a poly delay with interpolation and it's modulatable at sample rate 😀

Can't thank you enough!

Shif.

lalo ·

yeah !

thanx jorge!

hahah 🙂 'karplus-flanger' ..isn't a delay with time controlled by keyboard ? 🙂

thank you so much man 🙂

lalo

lalo ·

just to report 🙂

i can hear some clicks while the sound is playing... i think they are related to delay time interpolation not workin' as it should...maybe 😉

lalo

jorge ·

lalo wrote: just to report 🙂

i can hear some clicks while the sound is playing... i think they are related to delay time interpolation not workin' as it should...maybe 😉

lalo

Yeah, I noticed that too and my suspicions are that the interpolation is not quite working too. It probably happens when the memory reading operation wraps around from end to beginning. Getting the interpolation to work from last to first value was a bit tricky. I'll try to fix it, no need to change SM, this is a bug in the code typed inside the code component.

The clicks are quite small which indicates a small problem with the interpolation, if you have a schematic that makes the clicks more obvious please send it to me, it would help while testing.

jorge ·

lalo wrote: hahah 🙂 'karplus-flanger' ..isn't a delay with time controlled by keyboard ? 🙂

🙂 If you say so, I never heard those two words together, actually the first time I heard about karplus-strong was when you told me about it and explained in detail how it works, thanks for that. I really like the acoustic sound you get from so little effort and I think that's just the most basic one. I think we could move on to other types of physical modeling like wave-guides etc

jorge ·

lalo wrote: just to report 🙂

i can hear some clicks while the sound is playing... i think they are related to delay time interpolation not workin' as it should...maybe 😉

lalo

Ok, I think I've removed the clicks. I've uploaded updated flanger.osm and karplusFlanger.osm zipped files. Same links as before.

lalo ·

jorge wrote: lalo wrote: hahah 🙂 'karplus-flanger' ..isn't a delay with time controlled by keyboard ? 🙂

🙂 If you say so, I never heard those two words together, actually the first time I heard about karplus-strong was when you told me about it and explained in detail how it works, thanks for that. I really like the acoustic sound you get from so little effort and I think that's just the most basic one. I think we could move on to other types of physical modeling like wave-guides etc

yeah ..it is.... i was expanding the idea starting from your 'karplus-flanger' idea where the note palyed control 2 things... 1. the karplus-strong delay lenght 2. the flanger's sine oscillator frequency (with some math to keep the values im the typical 'flanger' effect)

i never heard those word together too 🙂

yeah i second the idea to explore more PhyMod stuff...and you did a wonderful work starting the array thing!

great jorge

lalo

lalo ·

jorge wrote: lalo wrote: just to report 🙂

i can hear some clicks while the sound is playing... i think they are related to delay time interpolation not workin' as it should...maybe 😉

lalo

Ok, I think I've removed the clicks. I've uploaded updated flanger.osm and karplusFlanger.osm zipped files. Same links as before.

yeah ..gonna listen to it 🙂

beautiful..completely clickless 🙂

jorge ·

lalo, I just made another small update to the flanger and karplusFlanger delay so you might want to download it again. Most probably you wont notice any difference by listening to it but I think this last one is the correct one.

lalo ·

jorge wrote: lalo, I just made another small update to the flanger and karplusFlanger delay so you might want to download it again. Most probably you wont notice any difference by listening to it but I think this last one is the correct one.

cool..what i have to do is understand all the iterpolation stuff.... i guess i'll do graphs and calculations on paper 🙂 ..old style 🙂

lalo

lalo ·

with some feedback 🙂 and a little more 'classic-flangerish' settings for the modulator 🙂 (less amplitude)

http://www.nusic.org/temps/karplusFlangerFeedBack.rar

great work jorge 🙂

now we have interpolated delay i guess 🙂

does it works in mono section?

i go check it out

EDIt : yes seems to work pretty good...but first i did a stupid thing the crash SM..i was tryin' to change polyin/out in coed component to monoin/out without disconnecting cables...it's a no no 🙂 lalo

jorge ·

lalo wrote: cool..what i have to do is understand all the iterpolation stuff....

If you want to understand it, the following schematic might help:

[old link]

It sets up an array with size=4 and values 0,10,20,30. For in=0 you get 0, in=1 you get 10, in=2 you get 20 etc.

For in=0.5 you get 5, in=1.5 you get 15 etc

The tricky part was the situation where you're in between 3 and 4 as 4 is the same as zero wrapped around so in=3.5 should give an interpolated result between the last value 30 and the first one 0.

in=3 is the same as in=7 and in =11 etc in=4 is the same as in=0, in=8 etc

lalo ·

thanx a lotta jorge 😀 good learning stuff for me 🙂

lalo

jorge ·

lalo wrote: first i did a stupid thing the crash SM..i was tryin' to change polyin/out in coed component to monoin/out without disconnecting cables...it's a no no 🙂 lalo

Well, it shouldnt be a no-no, must be a bug. Thanks for reporting it.

jorge ·

lalo wrote: with some feedback 🙂 and a little more 'classic-flangerish' settings for the modulator 🙂 (less amplitude)

http://www.nusic.org/temps/karplusFlangerFeedBack.rar

Thanks lalo. I just tried it, sounds very good. I guess we should do a karplus synth with several presets.

lalo ·

cool..i agree... a little thing to add is to be able to change the lenght/shape of the first impulse...so tryin' to use different shapes than noise (wich is the classic karplus-strong) and change the lenght of the impulse 🙂

lalo

unkargherth ·

lalo wrote: cool..i agree... a little thing to add is to be able to change the lenght/shape of the first impulse...so tryin' to use different shapes than noise (wich is the classic karplus-strong) and change the lenght of the impulse 🙂

lalo

all you need to do that its substitute the line

float mem[10000]=rand (-0.9,0.9);

By this one

float mem[10000];

An then provide on In pin the initial burst you desire , remember, "One shot" only, not the signal of an osc. Or, Try with

float mem[10000]; stage(0) { mem[0]=0.9; mem[1]=-0.9; }

This way you get an initial bipolar impulse, which is another of the well-known standards for Karplus feeding

I like to kown what impulses you find that works well on this

This is for jorge. Any other function besides Rand(), that it's able to initalize the whole array in some way?

jorge ·

Thanks unkargherth, very useful information.

At the moment you can initialize arrays in 3 different ways:

float array[1000]; //Initializes the whole array with 0.0; float array[1000]=0.123; // Initializes the whole array with 0.123; float array[1000]=rand(-1,1); // Initializes the whole array with random values between -1 and 1

It's really easy to change the code to support other initializations, feel free to suggest new ones.

unkargherth ·

jorge wrote: It's really easy to change the code to support other initializations, feel free to suggest new ones.

Well, you wan it, you got it ( later don't blame me for this)

.- Polar/Bipolar Linear/exponential Ramp [from 1/-1 to 0) .- Polar/Bipolar Linear/exponential Burst ( basicaly the previous multiplied by random noise .- some way to initialize for a func table: something like

float i; float table[10000]= sin1(i/10000)

Sin1 is only an example. The trick here is to provide a running index i that evaluates to the position in table so we can contruct our own functions table at inizialization time

Another (better i think) approach to that would be to be able to build global tables at load time ( as the sine table used for sin1() func, for example) and a way to refer it from code module. Then you don't need to provide a lot of math funcs, as they can be build as tables and looked up from code

Also a generic rand() function ( callable everywhere ) would be nice

unkargherth ·

An idea for you lalo

Talking on initial Karplus impulses,a way to find interesting ones is as follows

Get a standard oscilator and feed int with any multiple of frequency Get a one-shot-exponetial-decay inverse ramp ( going 1 to 0) Multiply osc out by ramp out Feed in the result into in of karplus module

Don't initialize de array to random

Done. You get a nice, tuned, exponentially decaying burts of the selected waveform

I try to build an example later

lalo ·

unkargherth wrote: An idea for you lalo

Talking on initial Karplus impulses,a way to find interesting ones is as follows

Get a standard oscilator and feed int with any multiple of frequency Get a one-shot-exponetial-decay inverse ramp ( going 1 to 0) Multiply osc out by ramp out Feed in the result into in of karplus module

Don't initialize de array to random

Done. You get a nice, tuned, exponentially decaying burts of the selected waveform

I try to build an example later

yeah unk...it's excactly what i was thinkin' about..this way we can obtain different attack properties for the K-Strong algo... like different plectrums 🙂

i'll work on it in the next days 🙂

lalo

unkargherth ·

Well. Promised and done. Here is the example

jorge ·

unkargherth wrote: Well. Promised and done. Here is the example

🙂 very cool, I hadnt realised that was possible already.

lalo ·

well done unk !!

really well done 🙂

lalo

jorge ·

unkargherth wrote: .- Polar/Bipolar Linear/exponential Ramp [from 1/-1 to 0)

That can be done inside stage(0);

unkargherth wrote: .- Polar/Bipolar Linear/exponential Burst ( basicaly the previous multiplied by random noise

setup a random array and do it inside stage(0)

unkargherth wrote: .- some way to initialize for a func table: something like

float i; float table[10000]= sin1(i/10000)

Once again, do it inside stage(0)

unkargherth wrote: Sin1 is only an example. The trick here is to provide a running index i that evaluates to the position in table so we can contruct our own functions table at inizialization time

I havent tried if the loop function works inside stage(0), if it doesn it's a bug, if it does you can do the following:

stage(0) { i=0; loop(1000) { array[i]=sin(i/1000); i=i+1; } }

lookup tables will be easy when you have arrays exposed through polymemout and polymemin and also a GraphToMem component.

unkargherth ·

Well. You're true. Firts to cases are easy on stage (0) But the third coudl be a complex code ( like a DSF, for bandlimited oscilators, or similar) so it could be a bit heavy to do it EVERY Note On. That's why i suggested Global Tables

Returning to Karplus... I've found something strange on Karplus soudn. When you play very high notes ( it starts more or less at A6) notes get slightly out of tune. The error becomes more obvious as notes are higher

I've seen something similar before, and, althought not sure, it seems it has something to do with, as frequency increases, the interpolation error increases too

I think the only way we can cope with this is to have an "oversampled" table ( wite every sample for example 4 times) and /or use better interpolation method ( posibly hermite)

What you think about it , Jorge ?

lalo ·

unkargherth wrote: Mmmm.. I've found something strange on Karplus soudn. When you play very high notes ( it starts more or less at A6) notes get slightly out of tune The error becomes more obvious as notes are higher

I've seen something similar before, and, althought not sure, it sseems it has something to do with, as frequency increases, the interpolation error increases too

I think the only way we can cope with this is to have an "oversampled" table ( wite every sample for example 4 times) and /or use better interpolation method ( posibly hermite)

What you think about it , Jorge ?

well i think is still the 'tuning-table' of midi-to-poly... infact if you try to play some constant intervals (like i.e. 5th) even in the middle range, they are all tuned differently 🙂

miditopoly is still in the pre-werkmeister era 😀

lalo ·

jorge wrote: have arrays exposed through polymemout and polymemin and also a GraphToMem component.

wow!

jorge ·

unkargherth wrote: I think the only way we can cope with this is to have an "oversampled" table ( wite every sample for example 4 times) and /or use better interpolation method ( posibly hermite)

What you think about it , Jorge ?

well, this might not work but, if we could do lookup tables already and somehow extract the frequency of your karpTuned output using the FFT and the GraphMax component, we could build a graph of the output freq vs input freq. We coud then use that graph using linear interpolation to correct the input frequency to make it tuned. The table would only have to be calculated once and stored from then on so it could be quite big like 64k if needed. The advantage of this system is that it could be used for anything like for example to tune filters. I hope you got that, i probably didnt explain it well.

jorge ·

lalo wrote: well i think is still the 'tuning-table' of midi-to-poly... infact if you try to play some constant intervals (like i.e. 5th) even in the middle range, they are all tuned differently 🙂

The tuning of the MidiToPoly is very precise as it is calculated with C++ functions and double variables. The problem is only with the PitchToFreq that unkargherth didnt use at all in his karpTuned schematic.

unkargherth ·

Lalo: Doesn't seems be related to the MIDI2Poly tunning. I tried a simple SAW and ssems to be reasonably well tunned for the whole 5 octaves of my keyboard controller

Jorge: Is not on My karpTuned only. also on standard Karplus you posted. The fact is that the error seems to come from, as frequency increase, 2/f decreaseas, so number of move-samples in mem[] decreases too,and proportionally, the interpolation error gets bigger

When i talk to oversample the table i mean the following

float oldw; oldw=w; w=w+1; w=w-(w>limit)&size; mem[w]=mem[oldw]+ 0.25*in;

w=w+1; w=w-(w>limit)&size; mem[w]=mem[oldw]+ 0.5*in;

w=w+1; w=w-(w>limit)&size; mem[w]=mem[oldw]+ 0.75*in;

w=w+1; w=w-(w>limit)&size; mem[w]=mem[oldw]+ in;

This way when you do the interpolation, you do it between the lower sample and the lower+ 0*25 of the upper. This, AFAIK should divide the interpolation error by four, so , in theory, should give us two octaves more of correctly tunned sound

( the code is based on delay module, but should be easy to convert to the karplus module)

Obviously this require that buffer is 4 times longer

jorge ·

unkargherth wrote: The ffact is that the error seems to come from, as frequency increasea, 2/f decreaseas, so number of move-samples in mem[] decreases too,and /proprtionally, the interpolation error gets bigger

yeah, I think that's it. Do you know the solution? ( I just noticed you answered that already in your last post ). what about some kind of sub-sample sized array using linear interpolation maybe, similar to the flanger delay.

lalo ·

jorge wrote: lalo wrote: well i think is still the 'tuning-table' of midi-to-poly... infact if you try to play some constant intervals (like i.e. 5th) even in the middle range, they are all tuned differently 🙂

The tuning of the MidiToPoly is very precise as it is calculated with C++ functions and double variables. The problem is only with the PitchToFreq that unkargherth didnt use at all in his karpTuned schematic.

oops sorry ..did a bit of mess between different things...so it probably due to the interpolation error...anyway i can hear tuning problems even in the very central range... but maybe i've written too much weird intervals in the last month's compositions 🙂 ..so my ear is just destroyed

lalo

unkargherth ·

jorge wrote: yeah, I think that's it. Do you know the solution? ( I just noticed you answered that already in your last post ). what about some kind of sub-sample sized array using linear interpolation maybe, similar to the flanger delay.

I tried linear interpolation on Karplus ( has been a surprise that there wasn't already there) and seems near no effect on tunning for high notes

I also tried subsampling (8 parts per sample) and i can't make it work. Anyway i will have a surprise if subsampling solve it.

I'm locked on this. has no idea on how to continue reasearching on this topic

If could help you, I noticed the tunning error is bigger as the damping factor (smoohting) gets higher

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.