One of the “conceptual problems” that I mentioned is that it’s impossible to create constant amplitude narrow band noise.
If you take white noise as an example, by definition the noise is random, though the average amplitude is constant across all frequencies within the audio spectrum. If you look at a broad band of noise the amplitude appears to be fairly constant, but as you narrow the bandwidth the amplitude becomes increasingly erratic. This is a pretty major problem for your project because it’s impossible to control the short term amplitude of random noise (because it is random).
A possible workaround for this would be to use 33 sine waves rather than noise.
If you think about “normal” white light, it contains millions of different frequencies, much like white noise. Now consider white light from fluorescent tube lamps. These types of lamp produce relatively few distinct frequencies, but because they are distributed fairly evenly though the visible spectrum, the combined effect is still white light, and the colours of objects seen in that light still appear to be quite natural, even though there are a relatively tiny number of frequencies. A similar thing happens with sound. Intelligible speech can be synthesized using just a handful of sine wave frequencies. In your experiment you would have 33 frequencies with which it should be possible to create meaningful results.
A single frequency can be created using the function (hzosc freq)
where “freq” is the frequency that you wish to generate. For example, to create a frequency of 440 Hz you can use:
(hzosc 440)
You can try this out by creating an empty audio track, selecting part of it, then open the “Nyquist Prompt” effect (in the “Effect” menu) and entering that code into the text box. When you click the OK button a 440 Hz tone will be generated that fills the selection.
By default the amplitude will be 0 dB (+1 to -1).
The amplitude can be adjusted by multiplying the waveform by a value using the function mult, for example this code will produce a 1000 Hz sine wave with an amplitude scaled down to +0.5 to -0.5 (-6 dB)
(mult 0.5 (hzosc 1000))
To create multiple tones at the same time, generated tones can be added together using sim. For example, to create a sound that contains the frequencies 100 Hz, 200 Hz, 400 Hz and 800 Hz, all at amplitude 0.1, the following code will work:
(sim
(scale 0.1 (hzosc 100))
(scale 0.1 (hzosc 200))
(scale 0.1 (hzosc 400))
(scale 0.1 (hzosc 800)))
Rather than setting the amplitude to a constant level, you want to vary the amplitude. To do this you can create an “envelope” using the functions pwl or pwlv
For example, to create a tone that rises from silence up to 0.5, then stays at 0.5 for a while, then goes up to 1.0 before dropping back down to 0, a suitable envelope can be created with this code:
(pwlv 0.0 0.25 0.5 0.5 0.5 0.75 1.0 1.0 0.0)
By default this is created at a low sample rate so the generated envelope will be much shorter duration than the track selection.
Using this envelope on a generated sine wave:
(mult
(hzosc 440)
(pwlv 0.0 0.25 0.5 0.5 0.5 0.75 1.0 1.0 0.0))
In order to be able to handle a large number of amplitude points you will need some way of getting the data into Nyquist to create a list of amplitude points so that you can then use pwl-list or pwlv-list to create the complex envelope.
As you see, this is not a simple first project, but I think it is certainly possible.