Good day,
In Audacity, the generate tone can take in only one input. Can you either modify it or create a plug-in so that I can input many frequencies (separated by commas; spaces; or both)? The inputs may be entered directly or pasted. The tones will be generated and appended sequentially and the resulting audio will play all tones one after the other. All other settings will remain unchanged except for the duration. It will now be the duration of each tone. I would like to be able to copy and paste up to ten thousand (10,000) frequency values.
I have to ask: Why? What result do you expect to achieve? How will you determine which frequencies to use?
There are some Nyquist plug-ins on this forum for generating more complex waveforms, but I doubt that any of them will sum such a large number of waveforms.
I want to assign frequency values to the letters of the alphabet, then play out the sounds that different letters, words, sentences and passages make. I think one can create a language using tones that might be able to break language barriers. As for the frequencies, I hope to permutate until I get the frequencies that will be pleasing to hear. Though for now, I hope to start with frequency values between 0 and 5,000 hz. If the waveform quantity is much, it may always be reduced. I had thought of such a large number as I was thinking of experimenting using books and 10,000 letters is not much for some books. If there are plug-ins that fit my request, may you direct me to them?
Got it. I think something like that will be possible as a Nyquist plug-in, though I’m not sure how many characters it will be able to handle in one go.
I don’t have time to look into it right now, but I’ll take a look over the Christmas period and get back to you.
A couple of questions regarding this:
Regarding the “notes” that are produced, I imagine that it will sound better if we allocate pitches (such as “middle C”) to each letter of the alphabet rather than arbitrary frequencies (Hz). Does that sound good to you?
How long should each “letter” play for? About 0.1 seconds?
Should spaces between words be rendered as a short silence?
Are we ignoring punctuation?
Do we count lower case letters the same as upper case letters?
One other thought - Nyquist does not support multi-byte characters, so the text would have to be the English characters a-z, A-Z. Accented characters will not be supported.
The resolution of human hearing is ~3Hz, so within human hearing range there are only about a thousand different pure sine tones which a human could theoretically differentiate.
It is possible to communicate internationally in audible sound, but it’s not “pleasing” to the ear:
Dial-up modem … Freesound - dialup.wav by lintphishx
If I’m reading the question correctly, @eemanee does not require 10,000 different tones, they require 26 tones (a - z) or 52 tones (a-z, A-Z).
The “10,000” is the maximum number of tones in the sequence, rather than the number of unique frequencies.
Here you go. Feel free to modify to suit your needs:
;version 4
;type generate
;control input "Words to encode" string "" "Paste the text here"
(setf TONE-DUR 0.1) ; length of each (tone.
(setf input-stream (make-string-input-stream input))
(defun tone(pitch)
(osc pitch TONE-DUR))
(let ((out (s-rest 0)))
(do* ((ch (read-char input-stream) (read-char input-stream))
(i 0 (1+ i)))
((not ch))
(setf ch (char-upcase ch))
(setf note
(case ch
(#\A (tone 60))
(#\B (tone 61))
(#\C (tone 62))
(#\D (tone 63))
(#\E (tone 64))
(#\F (tone 65))
(#\G (tone 66))
(#\H (tone 67))
(#\I (tone 68))
(#\J (tone 69))
(#\K (tone 70))
(#\L (tone 71))
(#\M (tone 72))
(#\N (tone 73))
(#\O (tone 74))
(#\P (tone 75))
(#\Q (tone 76))
(#\R (tone 77))
(#\S (tone 78))
(#\T (tone 79))
(#\U (tone 80))
(#\V (tone 81))
(#\W (tone 82))
(#\X (tone 83))
(#\Y (tone 84))
(#\Z (tone 85))
(t nil)))
(if note
(setf out
(sim out
(at (* i TONE-DUR) (cue note))))))
out)
Now I get it.
Your Nyquist code works for me in Audacity 2 & 3 , (faster in 2).
(before-after de-click)
I don’t know much about pitches and tones, but we may have the plug-in able to generate both pitches and tones
The length of the tones may be adjusted in the interface but we may have the default as 0.2 seconds.
The only separation should be the sentence end (full stop, period) which will be a short silence with duration of tone length.
Yes, punctuations are ignored except the full stop at sentence end. except for sentence ends
Lower and upper case letters having different values is okay by me.
The code I posted is a “Nyquist Script”. Use the “Nyquist Prompt” to run it: Nyquist Prompt - Audacity Manual
The script could be modified to make it into an installable plug-in by adding the required plug-in headers, and then installing the plug-in using the Nyquist Plugin Installer.
Thank you, Mr. Steve. I was able to get the code working.