Concatenating sounds in Nyquist?

3 Messages Forum Options Options
Permalink
Wes Morrison
Concatenating sounds in Nyquist?
Reply Threaded More
Print post
Permalink
How you you concatenate multiple sounds into one longer sound? Specifically in a loop that creates each piece of the sound.

I'm experimenting with phase distortion. I can make a single cycle if I explicitly code for each half of the waveform and return a seq of two sounds, but when I try to do this in a loop I can't get the seq to stay in order. I don't even know if seq is the right thing to use. The addition operator simply mixes the sounds.

I've read the Nyquist doc several times, grepped the example files, googled...nothing. Maybe I just don't know the right keyword? Append, concatenate, what else?
Wes Morrison
Re: Concatenating sounds in Nyquist?
Reply Threaded More
Print post
Permalink
Further information - seq works correctly when I use distinct variables for each sound. When I reuse a variable name for a new sound and add it to the seq, it doesn't work. It's like some of the time the variables are passed by reference.

This works (SAL code):

set c = pluck(c3) ; variable c
set x = seq(c)
set d = pluck(d3) ; variable d
set x = seq(x,d)
set e = pluck(e3) ; variable e
set x = seq(x,e)

This doesn't:

set i = pluck(c3) ; variable i
set x = seq(i)
set i = pluck(d3) ; REUSE variable i
set x = seq(x,i)
set i = pluck(e3) ; REUSE variable i
set x = seq(x,i)
Wes Morrison
Re: Concatenating sounds in Nyquist?
Reply Threaded More
Print post
Permalink
Yet more info.

If I play the seq every time I append to it I get the correct sounds. However, this is impractical as the time to render the complete sound is exponentially related to the frequency and length of the note. So I'm looking for another function that will do the same thing but not require writing the wav to disk and actually playing it.

On a positive note, my phase distortion algorithm is working great, if slow. I may look into extending Nyquist with a special oscillator for this.