a new genereator would be super!

hey all! i was just wandering… what if we could have a tone generator as the one we have allready in audacity, but that we could also specify the tones pitch in midi numbres? is there allready something like that out there?

For sine waves, it is very easy using the Nyquist Prompt effect (http://manual.audacityteam.org/man/nyquist_prompt.html)
The “Nyquist” scripting language has a built-in command for generating sine waves that takes the MIDI note number to select the frequency.

  1. Select part of an audio track (If necessary, “Tracks menu > Add New > [type of track]” )
  2. Open the Nyquist Prompt effect and add the following code. The number (“60” in this case) is the MIDI note number:
(osc 60)

If you also want to control the amplitude (the default amplitude is +/- 1, which is 0 dB), then you can multiply the sine tone by the desired amplitude. For example, for an amplitude of 0.8:

(mult 0.8 (osc 60))

To go a bit fancier, you could add controls for the MIDI note number and amplitude.
For example, if you want the note number to be an integer between 0 and 100:

;control pitch "MIDI Note Number" int "" 60 0 100

For an amplitude between 0 and 1:

;control amplitude "Amplitude (0 - 1)" float "" 0.8 0 1

and putting that all together:

;control pitch "MIDI Note Number" int "" 60 0 100
;control amplitude "Amplitude (0 - 1)" float "" 0.8 0 1

(mult amplitude (osc pitch))

and already we are well on the way to making a new plug-in.
All that it needs to become a plug-in in its own right, is the addition of the “plug-in headers” and then saving as a plain text file with a “.ny” file extension. Mor info about this here:http://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference

Nyquist can also produce other waveforms. More information in this part of the Nyquist manual: https://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index381

If you are interested in developing this further as a plug-in, that’s something that we can help with.

There’s a “harmonic noise” plugin for Audacity, where you specify midi notes …
Harmonic Noise generator plugin (default settings).png

thanks all. well, i didnae mean exactly that, but could be fun. like imean, that one of the options in the built in tone generator cuold be like frequency or midi note 0=frequency 1 =midi or something like that