sine wave gain- does my patch sound wrong to you?

josha's icon

Hi,

i am trying to raise the level of a 1000Hz sine wave using the line object. However as the gain goes up i can hear another frequency as well as the 1kHz, am i imagining this, or am i going about this incorrectly?

Max Patch
Copy patch and select New From Clipboard in Max.

J

spectro's icon

In your patch any (non-time) values to line~ above 1.0 will result in clipping, so going from 20 to 450 as the message to line~ currently does, is going to produce a serious amount of clipping distortion to the sine wave, which I imagine is 'the other frequency' that you are hearing. Try [0, 1.0 10000] instead...

myc's icon
josha's icon
Max Patch
Copy patch and select New From Clipboard in Max.

thanks spectro- i realise my previous values were too extrme!
I'm actually trying to raise the gain of the sine wave by 6dB over a set time- I've messed around with the values to get this, but I cant help feeling there's a better way to do this?!?

spectro's icon
Max Patch
Copy patch and select New From Clipboard in Max.

atodb can give you numerical gain values which you can provide to line (but not line~), so I've modified your patch to that end...

josha's icon
Max Patch
Copy patch and select New From Clipboard in Max.

thanks for modification spectro! I want the level to keep varying, so it goes up by 6 dB, then down by 6 dB etc. I have tried to add this to your modification but it doesnt go beyond the first 2 values.. any suggestions please?

spectro's icon

One way to alternate b/w two values using line.

Max Patch
Copy patch and select New From Clipboard in Max.

As you insist on setting the fader to an arbitrary level via the preset object, the level meter connected to it will not give an accurate reading of the gain the line is setting, so I bypassed that and connected it directly to the *~ object which is the one actually controlling the gain of the sine wave.

josha's icon
Max Patch
Copy patch and select New From Clipboard in Max.

thats great- thanks. just to explain my random fader position; The aim of this patch is for people to try and keep the meter at the arrow, I will be varying the time it takes for the 6dB changes to happen and will measure how accurate people are as the speed of level change increases. To that ends I need the fader to control the meter- so have tweaked the patch- does it look o.k. to you?

spectro's icon

Ok. I don't have time to check your patch right now (sorry) but I can at least understand why you chose to do it that way...