The keyup object sends the ASCII of the key which is pressed and then released, to its outlet.
The ASCII of '0' is 48, '1' is 49, and so on.
First press Reset to clear float. Then press 3 numbers, such as 7, 9, 2. They will be properly routed by the demux and incrementing index to the 3 number boxes. Any further input will not be recorded, unless Reset is pressed again.
The demux object takes index of outlet from the right inlet. Then whatever data is sent to left inlet is then sent to proper outlet. Because the index has to be sent first (default will be 0), the bang is connected to index message first and then the list message. You can make clear the order, visually speaking, by using trigger object.
The data that is sent to outlet 0 or outlet 1 is a list of 2 numbers. Here, the number of outlets is 2 since that is the number of arguments.
For the audio signal of last example, the Discrete Fourier Transform (DFT) is found using rfft~.
The amplitude of the DFT for a blocksize of 1024 is found. The default block size is 64. The amplitude is shown on right channel. Here for each 1024 samples or (1024/44100 seconds), we have Fourier Amplitude of the block.
Even thought the DFT takes only a block, theoretically the block is treated as one period in infinite wave. The left and right boundaries of a block will be different in general. Thus there is a discontinuity as each new period begins, and this affects the Fourier coefficients for high-frequency terms. For realistic analysis, you should window the audio signal with a hamming window, etc. These windows will ensure the two boundaries are near 0 or identically 0. However, this will require overlapping of audio. For 1 minute audio with overlapping of 2, you will have to analyze two minutes.
The left channel shows the input audio signal, which is the same as last example. The right channel show the amplitude of different frequencies.
We can use a list of numbers to provide timed control signals to an audio generator or synth. Here, the audio generator is just osc~, but in general it might be anything.
We have a list of frequencies and delays. The freq is 110 Hz for first 50 ms, 220 Hz for next 50 ms, 330 Hz for next 50 ms, and 440 for the last 50 ms of this 200-ms audio.
The bang sends the entire list, and after each delay the list is smaller by 2. The first outlet of list split 2 will have the first 2 values of list, second (middle) outlet will have the remaining list. This is fed into list append, which is triggered by the delay. Since you are appending an empty list with the remaining list, the new list is the remaining list, which is again fed into list split 2. This will continue until all numbers are used.
The audio signal shows increasing frequencies after every 50 milliseconds:
The wrap~ object keeps the fractional part of audio. If the signal is 1.5, it will be wrapped to 0.5. Without wrapping, it would be clipped off.
The input audio signal from osc~ is multiplied by 2 so it is a 2*cos signal. The signal is thus between -2 and +2. The two clip~ objects pass either the positive part of the signal or negative part of the signal.
Each of the signal is wrapped. The positive is immediately wrapped. For the negative, we first adjust the sign so it is again positive. The wrap is done and then it is multiplied by -1, yielding back a negative signal. Finally, the positive and negative signals are summed. This summation is implied since two audio signals are flowing to only one audio channel.