SynthMaker

Stream ADSR scaling

Archive · 2012 12 old posts

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

Warmonger ·

Hello, my first post here 🙂

For few days I've been working at my first synth. It works fine, but there's still one remaining issue:

When multiple notes are triggered at the same time, my ADSR (made from stock ADSR stream component) overdrives and causes nasty clicks feeding the filter. I would like to be able to use it with full dynamic range, but never exceed the range of outcoming signal.

Tried to use MMon component with number of notes being played to divide ADSR signal. It gives nice effect for slow and balanced notes, but when many of them are switched on/off simultaneosuly, it still clicks. Below is my current setup:

I would be very thankful if you suggested some solution for this problem.

oddson ·

I think virtually everyone new to SynthMaker runs into this issue as a bit of a surprise.

There second surprise is where those that already know about it say... cut the output to x% (I'll say 30) and live with it. (This is best done inside the amp module`s volume control setting the max value to 0.3 or whatever.)

With some form of soft-limiting you can get by with a higher amount but you can never use all the range as you need a fair bit of headroom based on the vagaries of multiple streams at different frequencies and phases and where peaks periodically line up.

You can use compression but then it will sound compressed.

Warmonger ·

Unfortunatelly, it didn't work, even after I divided filter enevelope by 100. Also tried placing cutoff around 0.5, slew rate limiter and anti-aliasing function here, but filter still clicks in the same way and I'm running out of ideas.

oddson ·

Looking at your screen shot there's a lot more going on than I thought... I assumed it was a standard noob problem but you likely have something else happening.

You could post the OSM.

Warmonger ·

Ok.

This effect occurs only after the filter.

cyto ·

One thing I noticed after a cursory look: In your main ADSR, there is a multiplication there that I don't think should be there...

Effectively, you are sending two signals through. One is getting amplified by the envelope and the other is getting amplified by whatever value is getting fed to that mult. So you are definitely going to hear the clicks of the note coming on and off. I didn't dig around too much, but see if addressing that helps.

One other thing that I noticed (but should have nothing to do with your current problem) is you seem to be converting back and forth between mono and poly a lot. This probably isn't such a good idea. Save the mono stuff (reverb, delay, etc) until the very end of the signal path so you only have to do one conversion (the mono to poly thingy is pretty much only good for adding LFOs and such to the poly section).

-cyto

Warmonger ·

Well, signals at that point should (and do) sum up to 1. Notice that the total signal output is (amount * envelope) +(1-amount).

cyto ·

Warmonger wrote: Well, signals at that point should (and do) sum up to 1. Notice that the total signal output is (amount * envelope) +(1-amount).

Right. But why would you want to do that? You need to amplify your signal with some kind of envelope (even a very short one) or else you're going to end up with that characteristic "clicking' (made even worse by the fact that you are "randomizing" the phases). Your method bypasses the envelope control function to whatever extent the amount knob is under one. I just don't see the point.

I don't know how well versed you are in the finer points of CPU operations, but when you use the "poly" section of the schematic, SM is assigning (as needed) the various voices of the synth to their own SSE channel. So you can effectively have multiple instances of an operation running in parallel (as one group of four is filled up, SM enables another). The combiner sums up all of these various channels into channel 1. The mono to poly then takes what is in channel 1 and assigns it back to all four channels (simultaneously). So when you make these conversions, you are losing ALL of the data that was once unique to each voice and applying it to all of them (summed). So, because you have the combined (summed) signal being affected by the uncombined/unique filter data, the voice allocation is being shot to hell.

By making the amp ADSR adjustment that I mentioned and moving the "mono" modules to the end so there is only one conversion, I was able to completely remove those nasty clicks from your instrument.

-cyto

oddson ·

cyto wrote: One other thing that I noticed (but should have nothing to do with your current problem) is you seem to be converting back and forth between mono and poly a lot.

Far from having nothing to do with it I think this is the crux of the problem. Apart from generally 'not being a good idea' as cyto has said in this case you're splitting and then merging mono streams all over the place in there. Much of it doesn't make any sense (why have stereo effects just to merge the channels back together afterwards) but the real problem is an implicit multiplication of signal.

Take this for example:

If these were wires carrying electricity the current going from input to output would split and then rejoin. If no amplification takes place in the processor then overall signal would be no greater than the input. But in Synthmaker splitting off from an input make two copies at full strength and joining them back up doubles the signal (since it treats joined signals as an implicit 'add').

Your example has a number of such splits and rejoins and I'm sure that's a big part of the problem (looks like up to eight times the input signal by the time you join left and right together outside the delay).

Warmonger ·

Oh yes, that helped. I routed two stereo channels from the point they split and it worked like charm.

Also, amp envelope was indeed badly designed. I just forgot that max amplitude always reaches 1, no matter what. I removed "amout" knob completely, as it became useless volume control in this situation :P.

Warmonger ·

Well, I still have a problem with ADSR - this time when it comes to filter envelope. Each note triggers different envelope, which all add up - beyond 1. Sure, I can divide the output by the number of notes being played, but the envelope holds still after the key is released. If ten notes are played in arpeggio with some release time, the enevelope can grow ten times higher it should be.

Attached my current schematic.

cyto ·

Warmonger wrote: Each note triggers different envelope, which all add up - beyond 1. Sure, I can divide the output by the number of notes being played, but the envelope holds still after the key is released. If ten notes are played in arpeggio with some release time, the enevelope can grow ten times higher it should be.

Well, if you want the filter envelope to affect individual notes, you need to move it back into the poly section. (I know these data types are very confusing to the new user. The more you work with the software, the more instinctive it becomes.) An easy way to think of it is like a mixing board. Think of each midi note as getting assigned to a channel. Anything on that channel strip should be done in poly. Think of the mono section as the master bus. Whatever happens there gets applied to everything (summed). So, I'm assuming you want the filter envelope to react to each note. Put it in poly. However, something like reverb or master gain should be put in mono. Trust me, this all makes more sense after you use the software for awhile 😉

-cyto

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.