Generate tone series in Nyquist

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
cmykrgb409
Posts: 1
Joined: Fri Feb 26, 2010 4:29 am
Operating System: Please select

Generate tone series in Nyquist

Post by cmykrgb409 » Fri Feb 26, 2010 4:45 am

How would it be possible to create a series of tones from a string of text using a Nyquist plugin? It seems like it should be simple to do but I can not figure out how. What I am trying to make is the following:

a4 = 435 Hz
input: output
0: c4
1: cs4
2: d4
3: ds4
4: e4
5: f4
6: fs4
7: g4
8: gs4
9: a4
A: as4
B: b4

For instance, if I entered 18B2, I would get 274.033 Hz, 410.585 Hz, 488.271 Hz and 290.328 Hz in that order and I would be able to save as a sound file. I'd like to be able to input volume, length of each tone and (of course) the string. My purpose for this is to create music from the digits of the mathematical constant π in base 12.

Any help is greatly appreciated!

Trebor
Posts: 9852
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows 8 or 8.1

Re: Generate tone series in Nyquist

Post by Trebor » Fri Feb 26, 2010 9:46 am

You could try dissecting David Sky's Morse code generator plug-in, (copy attached in zip file).
As it converts a string of characters (alphanumeric) into dah-dit-dah type sounds, which is similar to what you are trying to achieve.
MORSE.zip
(3.9 KiB) Downloaded 179 times
Morse sound generated by plug-in.wav
(729 KiB) Downloaded 87 times

steve
Site Admin
Posts: 80751
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Generate tone series in Nyquist

Post by steve » Fri Feb 26, 2010 2:27 pm

cmykrgb409 wrote:a4 = 435 Hz
Why are you using 435 Hz? A4 is usually 440 Hz.
cmykrgb409 wrote:How would it be possible to create a series of tones from a string of text using a Nyquist plugin?
David R Sky was working on a "sequencer" plug-in, but sadly he died before it was ever released. I don't think that it was quite complete but if anyone has a copy of what he was working on I'd be interested in finishing it.

The basic principle for making this in Nyquist is fairly simple. Here's some ideas and key functions:
Input data with text input: http://www.audacity-forum.de/download/e ... ext-widget

Code: Select all

;control variable-name "text-left" string "text-right" "initial-string"
Generate a tone at given pitch - "number" is the midi note number - 60 is middle C

Code: Select all

(osc number)
Set volume with (scale ...)

Code: Select all

(scale amount sound)
Here's a little bit of code that produces a series of notes at different amplitudes. You can run this by selecting part of a track and then click on "Nyquist Prompt" from the Effects menu, then copy and paste this code into the Nyquist Prompt text box:

Code: Select all

(defun note (pitch dur amp) 
  (scale-db (- amp 12)(osc pitch dur *table*)))

(abs-env
(seq
 (note c4 i lp)
 (note d4 i lpp)
 (note f4 i lmp)
 (note g4 i lmf)
 (note d4 q lf)))
In the above example, notation is based on the Adagio score language. See here: http://www.audacity-forum.de/download/e ... t2.html#17
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Trebor
Posts: 9852
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows 8 or 8.1

Re: Generate tone series in Nyquist

Post by Trebor » Fri Feb 26, 2010 3:00 pm

stevethefiddle wrote:David R Sky was working on a "sequencer" plug-in, but sadly he died before it was ever released.
I don't think that it was quite complete but if anyone has a copy of what he was working on I'd be interested in finishing it.
David's Audacity plug-in webpage is not being maintained ... http://www.shellworld.net/~davidsky/plug-ins.htm
.

steve
Site Admin
Posts: 80751
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Generate tone series in Nyquist

Post by steve » Fri Feb 26, 2010 3:54 pm

Trebor wrote:.

Most of his released plug-ins are available from the main Audacity web site http://audacityteam.org/download/nyquistplugins

Thanks to Trebor for bringing this up - it caused me to check the list and it appears that a working version of his sequencer is available on the Audacity site. It is called "Audio selection Sequencer 2".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Trebor
Posts: 9852
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows 8 or 8.1

Re: Generate tone series in Nyquist

Post by Trebor » Fri Feb 26, 2010 10:59 pm

stevethefiddle wrote:Most of his released plug-ins are available from the main Audacity web site http://audacityteam.org/download/nyquistplugins.
I note the zip-file from that page containing David's "stereo widener" won't open on my computer.
I've repackaged the NY file in a zip, attached.
Attachments
widener.zip
(1.14 KiB) Downloaded 46 times

steve
Site Admin
Posts: 80751
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Generate tone series in Nyquist

Post by steve » Sat Feb 27, 2010 7:23 am

Have you tested all of them? :o
Well spotted Trebor, I'll bring it to the attention of one of the site admin.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Generate tone series in Nyquist

Post by Gale Andrews » Thu Apr 22, 2010 10:00 pm

Thanks, Trebor. I finally got around to changing the corrupt zip on the server. I think it's OK (works in IE and Firefox). Chrome insists on pulling the old corrupt file despite clearing the download list, but that must be a Chrome bug.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Trebor
Posts: 9852
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows 8 or 8.1

Post by Trebor » Fri Apr 23, 2010 7:24 am

Widener zip from http://audacityteam.org/download/nyquistplugins now opens no problem on my computer,

(BTW I'm using firefox) .

Post Reply