A little bit of additions and terminology
In the
previous article, we met with basic mathematical operators and refreshed the principles of digital sound organization. Also there I indicated that the essence of the connections in PureData is the transmission of messages, signals and pulses. Here it is necessary to clarify one point:
in fact, the impulse is a special case of the message. Transmitting a pulse means transmitting a unit, to make sure of it, connect [bang] and numberBox and see what happens. According to generally accepted terminology used in literature and library help, numeric messages are called
scalars , and signals are called
vectors .
Perhaps I will stick to it too. Let's get started
Signals and signal objects
Signals are data intended for output to audio devices. As you might guess, signal objects are tools for generating and processing signals.
In PureData, signal objects are defined by the postfix [~], for example,
[osc ~], [phazor ~], [+ ~]. Also in the code, the inputs and outputs that receive and send signals, and the corresponding connections are highlighted. The signal output cannot be connected with scalars and, with rare exceptions, vice versa. Let's get acquainted with these objects closer.
Simplest synthesizer and first GUI
An object that is very often used in patches, and without which no generator can do -
[osc ~] . On the left input, it takes the value of frequency. Despite the fact that it is highlighted, it is quite possible to transfer a number to it. However, now we will not hear the sound, for this you need to send a signal to the sound card. The output is given by the
[dac ~] object.
Make the sound quieter, because it will be loud enough. Left input - left channel, right, respectively - right. We got the simplest synthesizer.
')
Now we will fasten a simple math here. To begin with we attach the volume control. Based on the formula
y = A * sin (x) , it can be concluded that amplitude changes can be achieved using the multiplication operation. To do this, it is enough to multiply the signal by a certain number. For this we use the object
[* ~] .
All arithmetic operations for waves can be obtained by appending the postfix "~" to the symbol of the scalar operator . Now connect the oscillator with the multiplication object and add the numberBox, limiting it in the interval [0, 1], this can be done through the properties. Send the result of the multiplication to the output and block the patch. And, holding the shift, dragging the number in the numberBox with the mouse.
Works, but uncomfortable. Therefore, we find an alternative.
Create objects [vslider] and [knob]. Beauty? Beauty. Having a fader and potentiometer is much more practical than a box with numbers. We restrict them through "properties" in [0, 1]. And try to connect instead of nuberBox'a first one object, then another.
As you can see, there is no big difference, and what to use depends only on your taste and desire.
In the next lesson we will do additive synthesis and control envelopes.