Hello, I am new to pd and am trying to make a sweeping oscillator that has a range between 2 changeable frequencies. The issue I am having is making it come back down once it scales up. Can anyone out there give me any guidance?
Creating a Sweeping Tone
Hi, welcome to Pd and welcome to this forum.
What exactly do you mean by "sweeping oscillator that has a range between 2 changeable frequencies"? Do you want to have a glissando between two frequencies in a certain amount of time? if so, you can use the [line~] object to generate a continous ramp between two values in a given amount of time. E.g.:
[440, 880 1000( | [line~] | [osc~] | \ [dac~]
(in case you are not familiar with the schematics we use in this forum, [something] is an object, [something( is a message box and | or __ are patch cords.
As this little schematics above shows, the first message will generate a ramp between the values 440 and 880 in 1000 ms (1s), which are fed to the oscillator object. If you want to have a glissando down, you can add another message to line such as [880, 440 1000( (or simply [440 1000( if you want the [line~] object to start on its current value). And if you want to immediately go to a certain value, simply feed this value to [line~] (although it is usually better to add a short time value in order to avoid any clicks, such as by using [220 40(, which tells [line] to go from the current value to 220 in 40ms).
@portabello Thanks for pointing that out, the comma was just a typo, but indeed [line~] is the correct object in this case. I edited my answer above. Take care, Gilberto
This is all very helpful and yes I am not familiar with the schematics used on this forum. I will start applying the method you have demonstrated. I will attempt to use what you have shown thus far and see where it gets me. Thanks for the welcome.
Also, to clarify what I am trying to do is create sine wave that sweeps up and down between 1kHz and 4kHz. The idea is to make an ambulance type sound.
I would try modulating the frequency by another [osc~] object. This should give it a more characteristic sound.
[osc~ 2] <-set 2 to the rate of the sweep in Hz | [+~ 1] | [*~ .5] <- the +1 and * .5 are to put the modulating osc into the range of 0 to 1 | [*~ 3000] <- range of frequencies | [+~ 1000] <- lowest frequency | [osc~] |\ [dac~}
Cool this is very helpful! Thanks for the quick response.
So, this turned out to be exactly what I was trying to do thank you!
If I wanted to elaborate on this specific patch a bit more, how could I add a very short delay to make the sound a bit fatter? Like one would add to an instrument in mix down to fatten the sound. Any ideas?