Automatic slider in clean data?

I am trying to simulate the sound of the ocean automatically on Pure Data. So far, I have achieved a very simple sound by filtering some noise with [bp ~]. I saw that the best cutoff frequency range is from 300 to 500 Hz, so I would like to have a horizontal [hsl] slider that goes from 300 to 500 and back, automatically and on the loop, until I say stop. (I already assigned a range (300 500) to the slider, I only need to control it automatically). I tried to use [osc ~], but this will not work, because the slider is not an audio element, and the [osc ~] output is an audio signal. In the picture I show what I have:

Current distribution of my program

So, how can I do this to control the slider automatically without manually changing it? So far, everything works the way I want, but I need the slider to increase and decrease periodically in order to simulate sea waves.

+6
source share
2 answers

If your question were simple: how do I automate the slider? The answer would be to look at the [line] object. The line interpolates from the current value to the target value for a given point in time. Use the line object to interpolate between floats and automate a slider movement

(Note: When managing signals, we use [line ~] instead.)

However, your goal is to simulate the waves of the sea shore. There are two problems in the aforementioned slider automation: 1.) we work in the control data transfer rate, and not in the data transfer speed, and 2.) we would like to make the jump easier and easier. The oscillator will solve both problems at the same time. Oscillator acting as an envelope to a signal

(Note: here, for simplicity, it is indicated that the amplitude control should not be linear due to the perception of a volume not equal to the increase in power.)

Since we don’t want to change only the amplitude, but the timbre (the cutoff frequency of the passbands), we want to use the sinusoidal function, we can start the counter to achieve the desired animation of the output range, and from. Note. The slider only acts as a visualization of this patch. Bandpass automation

+3
source

There are two objects in Pd that allow you to convert from the world of signals to the world of control. [sig ~] converts the controls to signals, and [snapshot ~] converts the signals to controls. You can use your [osc ~] solution using [snapshot ~].

[snapshot ~] works by reporting the instantaneous value of the signal as a number every time it gets hit. You can set up the metro at a given rate to report it regularly.

Here is a test that strikes [snapshot ~] 20 times per second to capture [osc ~] moving at a frequency of 1 Hz. I used some simple operators to scale the output from -1 to 1 to be between 300 and 500 to fit your example. You can fix it on your slider and go to the races.

Pd patch illustrating snapshot and metronome solution

+3
source

Source: https://habr.com/ru/post/987225/


All Articles