i want to create stereo track with specific tones
here is a n example
every tone will run for 5 seconds
first 5 seconds ( left x frequency+ right y frequency )- x and y numbers will vary
next 5 sec( left A frequency+ right B frequency )- A and B numbers will vary
and so on
lets say x= 100 hz, Y = 200 HZ, A=300 HZ, B= 400 HZ
summary : i want a prompt where i will enter numbers instead of X,Y,A,B (and more) and create a single stereo audio file ,where every 5 seconds the frequency tones will change ( from XY to AB to CD to EF)
please help me.
Thank You
There isn’t much support for Nyquist scripting any longer, though you can find some documentation by following the links on that page that I sent. Also some additional documentation and a few little tutorials on my blog audionyq.com.
Here is some code to get you started:
;nyquist plug-in
;version 4
;type generate
;name "Stereo Tones"
;author "Steve Daulton"
;release 2.4.2
;copyright "GPLv2+"
;control FREQUENCIES "List of frequencies" string "L1 R1 L2 R2 ..." "110 220 430 450"
;control DURATION "Duration per tone" float "seconds" 5 0 99
;control LEVEL "Level" float "0 to 1" 0.8 0 1
(setf hzlist (eval-string (format nil "(list ~a)" FREQUENCIES)))
(defun gen-tones(breakpoints)
(seqrep (i (length breakpoints))
(osc (hz-to-step (nth i breakpoints)) DURATION)))
(defun channel-frequencies (stereo-breakpoints)
;;; Return (list left-breakpoint-list right-breakpoint-list)
(let (bpl bpr)
(dotimes (i (/ (length stereo-breakpoints) 2)
(list (reverse bpl)(reverse bpr)))
(push (nth (* 2 i) stereo-breakpoints) bpl)
(push (nth (1+ (* 2 i)) stereo-breakpoints) bpr))))
(cond
((= (rem (length hzlist) 2) 1)
(print "Error. There must be an even number of frequencies."))
((= DURATION 0)
(print "Error. Duration must be greater than zero."))
(t (setf lr-hz (channel-frequencies hzlist))
(mult LEVEL
(vector (gen-tones (first lr-hz))
(gen-tones (second lr-hz))))))
Do you know any programming languages? If you want to do a job that thousands of other people want to do, then chances are good that somebody has written a program to do it.
If you have a one-off job, then that’s where you or some one else may have to write a custom program.
Steve got you going there with that code. There’s more information in the links above that.
Or, depending on how much chocolate is involved, you may be able to get someone to write it for you.
You will need to change the osc function with osc-pulse. Note that osc-pulse does not have a “duration” parameter, so you will need to use stretch to set the length of each section.
(defun gen-tones(breakpoints)
(seqrep (i (length breakpoints))
(osc (hz-to-step (nth i breakpoints)) DURATION)))
becomes:
(defun gen-tones(breakpoints)
(seqrep (i (length breakpoints))
(stretch DURATION
(osc-pulse (nth i breakpoints) 0))))
option to record frequencies as
a) one after another eg 100 200 300 400 500hz one after another for 5 seconds
b) simultaneously eg 100 200 300 400 500hz ( all 5 frequencies would fire at the same time) and i can export the track.
I would be really very very grateful if i get this prompt.
one question
Level fields in the prompt denotes volume of the track, am i correct?
Hi Steve,
Thank you and so sorry for late reply, ( my wife got admitted in hospital so could not reply earlier)
i would love to learnt it. please let me know how
Hi Steve, i did go through it,
Frankly as a doctor , i found it very difficult to understand.
i took my time but…
can you help me with these
mono track instead of stereo
option to record frequencies as
a) one after another eg 100 200 300 400 500hz one after another for 5 seconds
b) simultaneously eg 100 200 300 400 500hz ( all 5 frequencies would fire at the same time) and i can export the track.
I would be really very very grateful if i get this prompt.
In Nyquist, because it is designed for working with sound, it defines “sounds” as a “data type”. Data types are things like integers, floats (decimal numbers), characters, strings (text), lists, arrays, and so on. Nyquist has a “sound” data type. Multi-channel sounds are handled as an “array of sounds”, so “stereo sound” is an array containing two “sounds” (the left channel and right channel).
To combine multiple sounds at the same time, use the sim function.
Example:
(sim (hzosc 220)
(hzosc 330)
(hzosc 440))
The generated sounds can also be placed at specific times (relative to the start time of the first sound):
(sim (hzosc 220) ; first sound is automatically at time = 0
(at-abs 1 (hzosc 330))
(at-abs 2 (hzosc 440)))
Perhaps it might be worth petitioning the new Audacity team to resume documenting Nyquist for Audacity, especially with some tutorials for beginners.