How can I amplitude modulate one channel with another ?

This is an old topic, and the code is using the old Nyquist syntax (deprecated).
In modern syntax the code would be:

(sim (mult (aref *track* 1) -0.5)
     (mult (sum 0.5 (scale 0.5 (aref *track* 0)))
           (aref *track* 1)))



  • track is the selected audio that is passed by Audacity to Nyquist. In this case, a stereo track is required, so track is an array of 2 sounds.
  • (aref track 0) is the sound from the left channel.
  • (aref track 1) is the sound from the right channel.
  • (mult (aref track 1) -0.5) multiplies the right channel sound by -0.5. In other words, it halves the amplitude and inverts it.
  • (sum 0.5 (scale 0.5 (aref s 0))) multiplies the left channel by 0.5, and adds 0.5 to each sample value.
  • sim is equivalent to sum. It adds sounds or numbers.

If the left and right channels are the same, then yes, all new samples will be positive.