SynthMaker

Fast pitch envelopes for kicks, lasers, ...

Archive · 2011 16 old posts

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

Dave ·

Hi,

how can i add a pitch module with *FAST* envelope settings to my schematas?

I wanna create kicks, laserzaps etc. so it must be really fast...

This works "okay" so far but it's not "the real thing":

Any ideas?

Thanks, Dave

RunBeerRun2 ·

I can't tell what you used by that picture, but I just use an ADSR (the asm version from the wiki page modified to include a trigger pin).

I've used it for quick envelopes in FM synths and with sync'ed up oscillators.

infuzion ·

RunBeerRun2 wrote: I can't tell what you used by that picture, but I just use an ADSR (the asm version from the wiki page modified to include a trigger pin).

Can you link it please? Dave, I assume you mean "fast" = quick times of milliseconds per leg? I think RBR is thinking "fast" = little CPU%. If you mean short envelope times, you have 3 choices AFAICR: Toolbox: ADSR (Automatic), & NOT the ADSR4 which is hopped. ADSR (Manual) edit an Code/ASM envelope to remove the hop(), & do most of the calculations per sample. I guess a few can be hopped; depends on how much automation you expect.

CoreStyler ·

Im interested in. I myself working on a pitch envelope for kicks building. Using just decay and enancing VCA could do cool punches. But is too short. Maybe we have to increse decay length in samples

MichaelBenjamin ·

its not so much the overall speed of the envelope but the shape and change of speed while running that makes it sound natural. use exponential/base2 logarithmic shapes instead of linear ones and experiment with other nonlinear shapes.

for example if you want to pitch down over 4 octaves with a linear 1-0 input:

pitchenv=pow(2,(linearenv*4))

which you can then multiply with a normalized pitch (make sure it gets clipped at top to prevent osc lockup).

infuzion ·

MichaelBenjamin wrote: for example if you want to pitch down over 4 octaves with a linear 1-0 input: pitchenv=pow(2,(linearenv*4)) which you can then multiply with a normalized pitch (make sure it gets clipped at top to prevent osc lockup).

I don't understand; so is the real formula then: //pitchNorm is pitch [0..1] pitchenv=pitchNorm*(pow(2,(linearenv*4))) ?

MichaelBenjamin ·

ah yes not 4 but 2 for 4 octaves so it scales 4-1 not 16-1 (could also do that but at 44.1 you hit the limit soon). another more flexible and cpu reasonable thing for this would be patrice tarrabias shaper on musicdsp to get the linear env to sound good.

infuzion ·

MichaelBenjamin wrote: ah yes not 4 but 2 for 4 octaves so it scales 4-1 not 16-1 (could also do that but at 44.1 you hit the limit soon).

Hmm, I just copy/pasted what you wrote. So really it should be: //pitchNorm is pitch [0..1] pitchenv=pitchNorm*(pow(2,(linearenv*2))) regardless of SampleRate?

cyto ·

infuzion wrote: regardless of SampleRate?

This is just a "scaling" function to transfer a linear slope into a base-2 slope (where the linear slope would be the transposition in octaves and the base-2 slope would be the frequency multiplication necessary). So it assumes that the linear slope would be coming from some type of envelope control (which should already be adjusted for sample-rate). Correct me if I'm wrong here.

-cyto

infuzion ·

cyto wrote: infuzion wrote: regardless of SampleRate?

This is just a "scaling" function to transfer a linear slope into a base-2 slope (where the linear slope would be the transposition in octaves and the base-2 slope would be the frequency multiplication necessary).

Oh, eg a "waveshaper" of sorts?

cyto ·

infuzion wrote: Oh, eg a "waveshaper" of sorts?

Kind of. More like an "envelope shaper". I don't want to speak for Michael, but I think he had something like this in mind...

..where you take the output of an ADSR to control the pitch, but instead of going from 1 to 0 on a straight line, the code transforms the slope into a 4 to 1 (base 2) logarithmic curve to make a nice smooth sounding pitch slide.

As he mentioned earlier, the pow(2,x) does eat up a lot of cycles. I've done a few algebraic approximations for pitch scaling (see my "stereo phaser" thread in Examples) and it's not that difficult to wrangle a hyperbola into a usable curve. It all depends on the range and precision you need. For something like kick drum decays and laser zaps, I would imagine you could get away with a lot of relative error. It would definitely be worth trying to work out an approximation for the pow(2,x), even if it's not 100% dead accurate.

-cyto

Dave ·

Is it really so hard to create a pitch-envelope that does the 909 kick for example?

infuzion ·

cyto wrote: infuzion wrote: Oh, eg a "waveshaper" of sorts?

Kind of. More like an "envelope shaper". I don't want to speak for Michael, but I think he had something like this in mind.....where you take the output of an ADSR to control the pitch, but instead of going from 1 to 0 on a straight line, the code transforms the slope into a 4 to 1 (base 2) logarithmic curve to make a nice smooth sounding pitch slide.

That is what I was thinking; thanks!

Dave wrote: Is it really so hard to create a pitch-envelope that does the 909 kick for example?

Will need more detailed info to accurately copy that envelope!

cyto ·

Here's another approach to this whole "pitch envelope" thing...

Instead of relying on an external ADSR to generate a "reference" slope, it has its own integrated envelope. It should provide a smooth downward pitch shift. Whereas the ADSRs operate on a sample by sample subtraction, this thing operates on a sample by sample multiplication. The multiplication factor is calculated in "green" by finding the inter-sample ratio of the base-2 curve (taking into consideration the range and the decay time). Look inside the "range/ratio" module to see the math. It's pretty straightforward, but nevertheless could probably be done a little more simply.

The actual "stream" math only involves about 13 operations (I think) and could be simplified even more if you're not concerned about retriggering and such (you can completely remove all of the "stage" conditionals). This is far from a fully fleshed-out solution, but maybe it'll be useful for someone (it could be easily combined with an "amp" envelope for one-hit type things like drum hits, etc). Enjoy!

-cyto

infuzion ·

Cheers cyto!

cyto ·

I couldn't resist...

extremely bare-bones, but you get the idea how to use the previously-posted env code to make a drum synth.

-cyto

ps. don't forget to go in and select your I/Os

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.