SynthMaker

Compressor help needed

Archive · 2012 5 old posts

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

mattje ·

Hello,

I'm attempting to build a compressor in SynthMaker for a university project but have run in to some problems. Basically the compressor isn't working, and despite tinkering with the schematic over the past week I'm still no closer to finding the problem.

I've attached the code/algorithm (FreeComp.reajs) I've been trying to implement along with the SM schematic. The transfer function seems to be causing CPU spikes, so the problem may be in this module. Changing the min/max of the knobs doesn't seem to help.

Any input with this would be greatly appreciated.

cyto ·

Hi mattje!

I didn't look too deep into the example, but I can offer a couple initial observations to get you going...

First: look inside your threshold and output gain modules (the db to lin conversions). You have some of the maths hooked up incorrectly (I think you just have the "pow" inputs backwards).

Second: you need to scale the knobs to have them output the correct range. You can do this simply by hitting the little "p" at the bottom of the module to bring up the properties panel. This is what the doc from your zip file recommends for the values...

slider1:0<-60,6,1>Threshold (dB) slider2:1<1,100,1>Ratio (n:1) slider3:20<0,250,1>Attack (ms) slider4:200<25,2500,1>Release (ms) slider5:0<0,30,1>Output (dB)

I assume the first value is the min and the middle of the bracketed values is the max. I don't know what the other values mean, but I'm sure they have something to do with the scaling. You can hone that in later. For now just put the min/max values in and see if you can't get this thing working.

-cyto

trogluddite ·

Welcome Mattje,

Your script is from a Reaper JS plugin, I believe. In which case the format is...

sliderN: Default <Min,Max,Step> description So the important values to put into your knob "properties" are the first two inside the brackets - the Min and Max. You could also include the Default too (it will be used by your plugin when you make a blank preset). SM's knob can do Steps too, but I would leave out that option - I think it is there just to make the numbers format better on Reaper's display, and unsetepped values will give you a little more control.

Happy SynthMaking 🙂

mattje ·

Thanks for the help. I've fixed the range of the knobs and the power calculation of the threshold/outputgain knobs. I'd also forgotten to calculate the exponential function of the attack/release coefficients in the code, but unfortunately it's still not working. Very frustrating. I've attached the updated schematic.

trogluddite ·

Hi again,

This line in the envelope follower looked a little suspect to me...

env=(det>=env) & det + (det<env) & det+envdec*(env-det);

...so I had a look at the compiler output, and my suspicion was confirmed. The '&' operation has precedence over the other arithmetic, so your code has the meaning... env=( (det>=env) & det ) + ( (det<env) & det ) +envdec*(env-det) So the two complementary comparisons are both 'anded' with 'det' - which is the same as saying... env = det + envdec* (env-dec)

I'm not totally sure what the correct precedence should be, but my guess is that you need an extra pair of parenthesis to make the second bunch of maths into a single 'unit'...

env=(det>=env) & det + (det<env) & ( det+envdec*(env-det) );

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.