Update of /cvsroot/audacity/htdocs/nyquist
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv25497
Added Files:
bitone2.html bitone2.mp3 bitone2.ny surf-lfo.html surf-lfo.mp3
surf-lfo.ny surf-oxy.html surf-oxy.mp3 surf-oxy.ny
Log Message:
Three new Nyquist plug-ins from David R. Sky
--- NEW FILE: bitone2.html ---
bitone2.ny: Binaural Tones with Surf 2 generator
<p>
produces a stereo sound: a sinewave tone of one constant frequency
is generated in the left audio channel, and a series of changing
tones of slightly different frequencies are generated in the right
audio channel. The difference between these left- and right-channel
frequencies are called 'beat frequencies'. [See the note following
explanation of the various edit fields.]
<p>
There is also an optional stereo surf sound.
<p>
Copy bitone2.ny into your Audacity plug-ins folder, typically
<p>
c:\program files\audacity\plug-ins
<p>
for Windows users. Open Audacity in a new session.
<p>
To use this plug-in, first open a new stereo track in Audacity
[alt+p, s in Audacity pre-1.3, alt+t, n, s in 1.3 and later]. Open
the generate menu and select 'Binaural Tones with Surf 2' from the
drop-down menu.
<p>
Variables
<p>
1. Left channel tone frequency <br>
from 50hz to 1000hz, default 100hz.
<p>
2. Beat frequency [hz], duration [minutes], time to change to next
beat frequency [minutes] <br>
There are six of these edit fields in which you may enter up to
three indicated values, separated by a space. The first of these
edit fields has these default values:
<p>
17.5 0.25 0.25
<p>
In the sixth of these edit fields you may enter a final beat
frequency and duration of that frequency.
<p>
If you enter a single value only into any of these fields, the
duration of that beat frequency will be zero. If you leave any of
these edit fields blank they will be ignored.
<p>
3. Adjust total time to this many minutes [0=no adjustment] <br>
>From 1 to 60 minutes; 0 means no time adjustment.
<p>
4. Fade-in and fade-out times [seconds]<br>
Sets the time for fading in and fading out the volume at the start
and end of the generated audio.
<p>
5. Stereo surf frequency [hz]<br>
from 0hz to 2hz, default 0.1 hz. If this setting is above 0hz, the
surf sound will be panned back and forth somewhere between the left
and right audio channels at the specified frequency, how far
depending on the next setting:
<p>
6. Stereo surf spread [percent] <br>
between 0 and 100percent, default 80%. The larger this number the
wider the surf sound will move away from the center pan position.
0% results in the surf sound remaining in the center pan position.
<p>
7. tone to surf volume ratio [percent] <br>
from 0 to 100 percent, default 70%. this is to adjust the relative
volume of the tones and surf sound.
<p>
According to published research, listening to these beat
frequencies can result in the main brainwave frequency to 'align'
with the beat frequencies, through a phenomenon called
'entrainment' - see 'The Science Of Binaural Beat Brainwave
Entrainment Technology - for meditation relaxation stress
management' at
<p>
<a href="http://web-us.com/thescience.htm">
http://web-us.com/thescience.htm</a>
<p>
I have no affiliation with this website or company.
<p>
According to published research, entrainment at different beat
frequencies can result in different states of awareness including
increased relaxation or alertness, lucid dreaming, and a host of
other states. There is a plethora of online literature which goes
into much more detail than here. Suffice to say that the general
range of the four most familiar brainwave frequencies are:
<p>
beta 14-21 hz [cycles per second] and higher; <br>
alpha 7-14 hz; <br>
theta 4-7 hz; <br>
delta 0-4 hz.
<p>
If you do further research you'll find many variations on these
bands as well as additional labels and frequency ranges, plus
states apparently associated with specific frequency ranges.
<p>
In addition to the tones, you can also generate pink noise-based
stereo surf. [Pink noise is a lower-frequency 'rushing' sound
compared with 'hissing' white noise.]. Technically speaking pink
noise is "equal energy per octave noise". However, I've made the
pink noise surf have a deeper sound.
<p>
Warning - The use of this plug-in may result in changed brainwave
frequencies, which can change how the user experiences and
interacts with his/her inner and outer worlds - "alltered states of
consciousness."
<p>
By downloading, installing, using this plug-in and/or listening to
the audio it generates, you explicitly accept full responsibility
for any and all effects of its use, whether 'positive', 'negative',
intentional, unintentional , or otherwise. this plug-in is meant
for your own personal use and experimentation. There is no
guarantee of any kind for any effect from the use of this plug-in.
<p>
Written by David R. Sky, June 11, 2007. <br>
<a href="http://www.shellworld.net/~davidsky/nyquist.htm">
http://www.shellworld.net/~davidsky/nyquist.htm</a><br>
Thanks to Matt R. for suggestion of adding varying beat frequencies
after release of bitone.ny.<br>
Thanks very much to Steven Jones for XLISP program code.<br>
Released under terms of the GNU Public License<br>
<a href="http://www.opensource.org/licenses/gpl-license.php ">
http://www.opensource.org/licenses/gpl-license.php </a>
<p>
--- NEW FILE: surf-lfo.mp3 ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: surf-oxy.mp3 ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: bitone2.ny ---
;nyquist plug-in
;version 2
;type generate
;name "Binaural Tones with surf 2..."
;action "Generating binaural tones with surf..."
;info "bitone2.ny by David R. Sky
www.shellworld.net/~davidsky/nyquist.htm\nOpen blank stereo track in Audacity
before using this plug-in.\nUse this plug-in at your own risk - see warning in
text of this plug-in.\nApproximate brainwave frequency ranges: beta 14-21 hz;
alpha 7-14 hz; thheta 4-7 hz; delta 0-4 hz\nReleased under terms of the GNU
Public License"
;control f "Left channel tone frequency [hz]" real "" 100 50 1000
;control string1 "Right channel beat frequency1 [hz], duration1 [minutes], time
change to frequency2 [minutes]" string "" "17.5 0.25 0.25"
;control string2 "Beat freq2, dur2, time change to freq3" string "" "10.5 0.25
0.25"
;control string3 "Beat freq3, dur3, time change to freq4" string "" "5.5 0.25
0.25"
;control string4 "Beat freq4, dur4, time change to freq5" string "" "2 0.25"
;control string5 "Beat freq5, dur5, time change to freq6" string "" ""
;control string6 "Beat freq6, dur6" string "" ""
;control adjust-time "Adjust total time to this many minutes [0=no adjustment]"
int "" 0 0 60
;control fade "Fade-in and fade-out times [seconds]" int "" 10 0 120
;control surf-f "Stereo surf frequency [hz]" real "" 0.1 0 2
;control spread "Stereo surf spread [percent]" int "" 80 0 100
;control ratio "Tone to surf volume ratio [percent]" int "" 70 0 100
; Binaural tones generator with Surf 2
; bitone2.ny by David R. Sky June 11, 2007
; www.shellworld.net/~davidsky/nyquist.htm
; Thanks to Matt R. for suggesting updating bitone.ny
; from constant beat frequency to changing over time
; Thanks to Steven Jones for eval-string-to-list function
; from his Harmonic Noise Nyquist plug-in,
; for pink noise generator from his pink.lsp file,
; and for rotate and flatten functions from his list-uti.lsp file.
#|
produces a stereo sound: a sinewave tone of one constant frequency
is generated in the left audio channel, and a series of changing
tones of slightly different frequencies are generated in the right
audio channel. The difference between these left- and right-channel
frequencies are called 'beat frequencies'. [See the note following
explanation of the various edit fields.]
There is also an optional stereo surf sound.
Copy bitone2.ny into your Audacity plug-ins folder, typically
c:\program files\audacity\plug-ins
for Windows users. Open Audacity in a new session.
To use this plug-in, first open a new stereo track in Audacity
[alt+p, s in Audacity pre-1.3, alt+t, n, s in 1.3 and later]. Open
the generate menu and select 'Binaural Tones with Surf 2' from the
drop-down menu.
Variables
1. Left channel tone frequency
from 50hz to 1000hz, default 100hz.
2. Beat frequency [hz], duration [minutes], time to change to next
beat frequency [minutes]
There are six of these edit fields in which you may enter up to
three indicated values, separated by a space. The first of these
edit fields has these default values:
17.5 0.25 0.25
In the sixth of these edit fields you may enter a final beat
frequency and duration of that frequency.
If you enter a single value only into any of these fields, the
duration of that beat frequency will be zero. If you leave any of
these edit fields blank they will be ignored.
3. Adjust total time to this many minutes [0=no adjustment]
>From 1 to 60 minutes; 0 means no time adjustment.
4. Fade-in and fade-out times [seconds]
Sets the time for fading in and fading out the volume at the start
and end of the generated audio.
5. Stereo surf frequency [hz]
from 0hz to 2hz, default 0.1 hz. If this setting is above 0hz, the
surf sound will be panned back and forth somewhere between the left
and right audio channels at the specified frequency, how far
depending on the next setting:
6. Stereo surf spread [percent]
between 0 and 100percent, default 80%. The larger this number the
wider the surf sound will move away from the center pan position.
0% results in the surf sound remaining in the center pan position.
7. tone to surf volume ratio [percent]
from 0 to 100 percent, default 70%. this is to adjust the relative
volume of the tones and surf sound.
According to published research, listening to these beat
frequencies can result in the main brainwave frequency to 'align'
with the beat frequencies, through a phenomenon called
'entrainment' - see 'The Science Of Binaural Beat Brainwave
Entrainment Technology - for meditation relaxation stress
management' at
http://web-us.com/thescience.htm
I have no affiliation with this website or company.
According to published research, entrainment at different beat
frequencies can result in different states of awareness including
increased relaxation or alertness, lucid dreaming, and a host of
other states. There is a plethora of online literature which goes
into much more detail than here. Suffice to say that the general
range of the four most familiar brainwave frequencies are:
beta 14-21 hz [cycles per second] and higher;
alpha 7-14 hz;
theta 4-7 hz;
delta 0-4 hz.
If you do further research you'll find many variations on these
bands as well as additional labels and frequency ranges, plus
states apparently associated with specific frequency ranges.
In addition to the tones, you can also generate pink noise-based
stereo surf. [Pink noise is a lower-frequency 'rushing' sound
compared with 'hissing' white noise.]. Technically speaking pink
noise is "equal energy per octave noise". However, I've made the
pink noise surf have a deeper sound.
Warning - The use of this plug-in may result in changed brainwave
frequencies, which can change how the user experiences and
interacts with his/her inner and outer worlds - "alltered states of
consciousness."
By downloading, installing, using this plug-in and/or listening to
the audio it generates, you explicitly accept full responsibility
for any and all effects of its use, whether 'positive', 'negative',
intentional, unintentional , or otherwise. this plug-in is meant
for your own personal use and experimentation. There is no
guarantee of any kind for any effect from the use of this plug-in.
Written by David R. Sky, June 11, 2007.
Thanks to Matt R. for suggestion of adding varying beat frequencies
after release of bitone.ny.
Thanks very much to Steven Jones for XLISP program code.
Released under terms of the GNU Public License
http://www.opensource.org/licenses/gpl-license.php
|#
; Original version of bitone2.ny had a choice selection,
; 0=generate tones with surf, 1=display time w/beat frequency pairs.
; The second option was for debugging purposes only,
; that ;control line was deleted for public release of bitone2.ny,
; but the displayed results can still be gotten
; either by changing the following line to (setf choice 1)
(setf choice 0)
; or by adding the following ;control line:
; ;control choice "0=generate tones/surf 1=display time/beat frequency list"
int "" 0 0 1
; which will present that option with the other edit fields
; when you open bitone2.ny.
; --------
; function to convert input string into a list
; input string is str, output list is assigned to symname
(defun eval-string-to-list (symname str)
(let ((form (strcat "(setq " symname " (list " str "))")))
(eval (read (make-string-input-stream form)))))
; convert string inputs into lists
(eval-string-to-list "list1" string1)
(eval-string-to-list "list2" string2)
(eval-string-to-list "list3" string3)
(eval-string-to-list "list4" string4)
(eval-string-to-list "list5" string5)
(eval-string-to-list "list6" string6)
; if all empty string inputs [and therefore the lists they became],
; set the choice value to generate an error message
(setf choice
(if (and (null list1) (null list2) (null list3)
(null list4) (null list5) (null list6) ) ; end and
2 ; error message value
choice ; choice value already selected by user
) ; end if
) ; end setf
; if all empty lists, set list1 to be '(10 1) [arbitrary values],
; otherwise list1 remains unchanged
(setf list1 (if (= choice 2) '(10 1) list1))
(setf beat-list (list list1 list2 list3 list4 list5 list6))
; function tri-butlast
;
; (tri-butlast list) returns first 3 elements of list
; (tri-butlast list n) returns LIST WITHOUT LAST N ELEMENTS OF LIST
; returns list if less than 3 elements in list
;
(defun tri-butlast (lis &optional (n (- (length lis) 3)))
(if (<= n 0)
lis
(tri-butlast (reverse (cdr (reverse lis))) (1- n))
) ; end if
) ; end defun tri-butlast
; edited version of Rotate - rotate a list
; returns rotated list [last element becomes first element of list]
(defun rotate (lst)
(cons (car (last lst)) (tri-butlast lst 1)))
; function to remove empty lists [nil] from a list of lists
; [beat-list]
(defun no-nil (lis)
(dotimes (i (length lis))
(setf lis (rotate lis)) ; rotate lis
; if first element of lis is empty list [nil],
; pop it off lis
(if (null (first lis))
(pop lis)))
lis ; return de-nilled lis
)
; remove nil elements from beat-list
(setf beat-list (no-nil beat-list))
; function to make pwl t/l break points from string list:
; list->bp - list to break points
; from f [dur] [time] inputs from user
; note that first break point generated is actually the frequency [l] not a
time.
; After creating break points of all string input lists,
; a 0 needs to be prepended to the beginning of the first list.
; returns new list.
(defun list->bp (lis)
; first we make sure lis is maximum 3 elements long
(setf lis (tri-butlast lis))
(cond
((= (length lis) 1) ; length 1 [f]
(list
(first lis)
0
)
) ; end length 1 [f]
((= (length lis) 2) ; length 2 [f dur]
(list
(first lis)
(float (* 60 (second lis)))
(first lis)
(float (* 60 (second lis)))
)
) ; end length 2 [f dur]
(t ; length 3 [f dur time]
(list
(first lis)
(float (* 60 (second lis)) )
(first lis)
(float (* 60 (+ (second lis) (third lis))) ))
) ; end t [length 3 - f dur time]
) ; end cond
) ; end defun list->bp
; convert beat-list lists to lists with pwl break points
(dotimes (i (length beat-list))
(setf (nth i beat-list)
(list->bp (nth i beat-list))))
; function to add last time values of lists to time break points
; of successive lists
(defun add-time (lis)
(cond
((= (length lis) 1) ; list has only one list
lis) ; return lis
(t ; list has 2 or more embedded lists
(dotimes (i (1- (length lis)))
(setf last-time (first (last (nth i lis)))) ; get last element of sublist
(setf
(nth 1 (nth (1+ i) lis))
(+ last-time (second (nth (1+ i) lis)))
) ; end setf
(setf (nth 3 (nth (1+ i) lis))
(if
(fourth (nth (1+ i) lis))
(+ last-time (fourth (nth (1+ i) lis)))
(fourth (nth (1+ i) lis))
) ; end if
) ; end setf
) ; end dotimes i
) ; end t
) ; end cond
lis ; return list
) ; end defun add-time
; add time values in binaural list
(setf beat-list (add-time beat-list))
; function to flatten embedded lists into a single list
(defun flatten (lst)
(cond ((null lst) nil)
((atom lst) (list lst))
(t (append (flatten (car lst))
(flatten (cdr lst))))))
; flatten binaural list
(setf beat-list (flatten beat-list))
; dur - total duration
(setf dur (first (last beat-list)))
; convert adjust-time to minutes [if > 0]
(setf adjust-time
(if (> adjust-time 0)
(float (* 60 adjust-time))
adjust-time) ; end if
) ; end setf
; convert total time in beat-list to adjust-list duration
; [which is only used when adjust-time > 0]
(setf adjust-ratio
(/ adjust-time dur))
; function to apply adjust-ratio to time values in beat-list
; returns list with new time values
(defun adjust (adjust-ratio lis)
(dotimes (i (truncate (/ (length lis) 2)))
(setf (nth (1+ (* 2 i)) lis)
(* adjust-ratio (nth (1+ (* 2 i)) lis))
) ; end setf
) ; end dotimes
lis ; return new lis
) ; end defun adjust
; apply time ratio adjustment to beat-list
; [only if adjust-time > 0]
(setf beat-list
(if (> adjust-time 0)
(adjust adjust-ratio beat-list)
beat-list
) ; end if
) ; end setf
; set new dur to adjust-time
; [if adjust-time > 0]
(setf dur
(if (> adjust-time 0)
adjust-time
(first (last beat-list))
) ; end if
) ; end setf
; prepend a zero onto beat-list
(push 0 beat-list)
; convert ratio to true [non-percentage] value
(setf ratio (* ratio 0.01))
; Pink noise generator
; eq-lowshelf boosts frequencies below 500hz
; for deeper surf sound
(defun pink (&optional (dur 1)(cutoff (/ *sound-srate* 16.0)))
(mult 0.5 (eq-lowshelf (lp
(lowpass6 (noise dur) cutoff)
(mult 2000 (sum 0.5 (mult 0.4 (lfo surf-f dur)))) ; frequency modulation for lp
) ; end lp
500 24) ; end eq-lowshelf
) ; end mult 0.5
) ; end defun pink
(defun get-ocean (surf-f)
(cond
((= surf-f 0) 0) ; just noise, no stereo surf
(t (lfo surf-f dur *sine-table* 180))
)) ; end defun get-ocean
; Butterfly function: used here to bring
; single channel of noise into apparent center
; of stereo field, or to produce
; stereo ocean wave oscillations
(defun butterfly (width sound)
(vector
; left channel
(sum (mult (aref sound 0) (sum width 1) 0.5)
(mult (aref sound 1) (sum width -1) -0.5))
; right channel
(sum (mult (aref sound 1) (sum width 1) 0.5)(mult (aref sound 0)
(sum width -1) -0.5))))
; Generating binaural tone with background noise, beat-list,
; or error message if string input fields are all empty
(cond
((and (= choice 0) (> ratio 0.0) (< ratio 1.0)); tones with surf
; apply fade-in and fade-out envelope
(mult (pwl 0 0 fade 1.0 (- dur fade) 1.0 dur 0 dur)
(sim
(mult ratio 0.5 (vector
(osc (hz-to-step f) dur *sine-table*)
(fmosc(hz-to-step f) (pwl-list beat-list))
) ; end tones vector
) ; end mult
(butterfly (mult spread 0.01 (get-ocean surf-f))
(mult (- 1.0 ratio)
; to create stereo surf, chosen noise of duration dur is in left channel,
; with duration dur of silence in right channel.
; This is made stereo using butterfly function
(vector
(pink dur)
(s-rest dur)
) ; end noise vector
) ; end mult
) ; end butterfly
) ; end sim
) ; end mult pwl
) ; end choice 0
((and (= choice 0) (= ratio 0.0)) ; surf without tones
(mult (pwl 0 0 fade 1.0 (- dur fade) 1.0 dur 0 dur)
(butterfly (mult spread 0.01 (get-ocean surf-f))
; to create stereo surf, chosen noise of duration dur is in left channel,
; with duration dur of silence in right channel.
; This is made stereo using butterfly function
(vector
(pink dur)
(s-rest dur)
) ; end noise vector
) ; end butterfly
) ; end mult pwl
) ; end surf without tones
((and (= choice 0) (= ratio 1.0)) ; tones without surf
; apply fade-in and fade-out envelope
(mult (pwl 0 0 fade 1.0 (- dur fade) 1.0 dur 0 dur)
(vector
(osc (hz-to-step f) dur *sine-table*)
(fmosc(hz-to-step f) (pwl-list beat-list))
) ; end tones vector
) ; end mult pwl
) ; end tones without surf
((= choice 1) ; display beat-list on screen
(format nil
"List of time/beat frequency pairs (time values in seconds, ending with final
time value) is ~% ~a ~%"
beat-list)
) ; end choice 1
(t ; display error message on screen
(format nil
"Error - you haven't put any beat frequency, duration, or time change values~%
into any of the six string input fields.~% ~%
No beat frequency/time list, binaural tones or surf generated.")
) ; end t error message
) ; end cond
--- NEW FILE: surf-oxy.ny ---
;nyquist plug-in
;version 1
;type generate
;name "Surf [Oxygene]..."
;action "Generating Oxygene surf..."
;info "surf-oxy.ny by David R. Sky www.shellworld.net/~davidsky/nyquist.htm
\nBased on surf sound in Jean-Michel jarre's 1976 album _Oxygene_.\nOne cycle
of Oxygene surf: sweep + post-sweep silence + crash + post-crash silence\nTo
generate stereo Oxygene surf, first open a blank stereo track in
Audacity.\nReleased under terms of the GNU Public License"
;control channels "Surf output [1=mono 2=stereo]" int "" 2 1 2
;control spread "Stereo spread [stereo only - percent]" int "" 80 -100 100
;control fade "Fade-in and fade-out times [seconds]" real "" 0 0 120
;control count "Number of Oxygene surf cycles" int "" 10 1 120
;control surf-type "Surf type [0=white noise 1=pink noise]" int "" 1 0 1
;control start-f "Sweep starting filter frequency [hz]" real "" 100 40 1000
;control end-f "Sweep ending filter frequency [hz]" real "" 1000 100 10000
;control sweep-t "Sweep duration [seconds]" real "" 1.5 0.2 10
;control pause-t "Post-sweep silence duration [seconds]" real "" 2 0.2 10
;control crash-f "Crash filter frequency [hz]" int "" 300 40 2000
;control boost "Crash bass frequency boost [db]" real "" 24 0 60
;control crash-t "Crash duration [seconds]" real "" 5 0.2 10
;control post-t "Post-crash silence duration [seconds]" real "" 2 0.2 10
; Surf [Oxygene] by David R. Sky, June 20, 2007.
; http://www.shellworld.net/~davidsky/nyquist.htm
; based on surf sound in Jean-Michel Jarre's 1976 electronic album _Oxygene_.
; Thanks to Steven Jones for pink noise Nyquist code from pink.lsp.
; Released under terms of the GNU Public License
; http://www.opensource.org/licenses/gpl-license.php
#|
surf-oxy.ny: Jean-Michel Jarre's _Oxygene_ surf
Jean-Michel Jarre put out a hauntingly beautiful electronic album
in 1976, _Oxygene_. One section of this album had a repeating surf
sound: a sweep from the right to the left audio channel, a pause,
and then a deep crash in the right channel. After another pause,
this cycle repeated many times. Very relaxing to listen to.
This sound generator plug-in emulates that surf cycle, in either
mono or stereo.
Copy surf-oxy.ny into your Audacity plug-ins folder, typically
c:\program files\audacity\plug-ins
in Windows.
Start a new session of Audacity. To generate stereo surf, first
open a blank stereo track [alt+p, s in Audacity pre-1.3, alt+t, n,
s in 1.3 and later]. Open the generate menu. Click on
'Surf [Oxygene]'.
Variables:
1. Surf output [1=mono 2=stereo]
To generate mono or stereo Oxygene surf.
2. Stereo spread [stereo only - percent]
If you've chosen to generate stereo Oxygene surf, this setting will
determine how widely the surf sweeps away from the center pan
position. From +100 percent to -100 percent. Positive values make
the sweep section go from the right to the left, with the crash in
the right. Negative values reverse this pattern.
3. Fade-in and fade-out times [seconds]
Time to fade in and fade out the volume at the start and end of the
surf, if you wish.
4. Number of Oxygene surf cycles
How many Oxygene surf cycles to generate.
5. Surf type [0=white noise 1=pink noise]
White noise is a higher-frequency 'hissing', whereas pink noise is
a lower-frequency 'rushing' sound.
The following two settings
6. Sweep starting filter frequency [hz]
7. Sweep ending filter frequency [hz]
set the starting and ending frequencies for the lowpass filter to
sweep the sweep portion of Oxygene surf. [A lowpass filter allows
frequencies below a certain value to pass, while frequencies above
that value are attenuated, or reduced in volume.]
8. Sweep duration [seconds]
This sets how slow or fast the sweep portion of Oxygene surf takes.
9. Post-sweep silence duration [seconds]
Duration of the silence after the sweep.
10. Crash filter frequency [hz]
The lowpass filter frequency of the crash.
11. Crash bass frequency boost [db]
How much to increase the volume of the above filter frequency and
below. 0db means no boost, 6db means double the amplitude of this
bass frequency, and so on.
12. Crash duration [seconds]
Duration of the crash.
12. Post-crash silence duration [seconds]
how much silence before the Oxygene surf cycle repeats.
Notes
1. If you get an error message 'Nyquist returned too many audio
channels', this means you tried to generate stereo surf without
having first opened a blank stereo track in Audacity. See
instructions at the top of this help file on how to do this.
2. In the original _Oxygene_, reverb was applied to the surf,
giving it a more expansive sound and feeling. If you want to have
reverb added to Oxygene surf, you need to apply it yourself after
the surf sound has been generated. There's 'Gverb' already in the
Audacity effects menu, and many people use Anwida's free VST reverb
plug-in.
3. Seagulls not included.
Written by David R. Sky, June 20, 2007.
http://www.shellworld.net/~davidsky/nyquist.htm
Thanks to Steven Jones for pink noise Nyquist code.
Released under terms of the GNU Public License
http://www.opensource.org/licenses/gpl-license.php
|#
; calculate duration of one surf cycle
(setf surf-t (+ sweep-t pause-t crash-t post-t))
; calculate duration of 'count' number of surf cycles
; for fade-in and fade-out envelope
(setf count-t (* count surf-t))
; function to generate pink noise
; thanks to Steven Jones - from his pink.lsp file
(defun pink (dur &optional (cutoff (/ *sound-srate* 16.0)))
(lowpass6 (noise dur) cutoff))
; function to determine maximum amplitude of signal,
; which is then converted to scale value
; for optimum amplitude without clipping surf
; returns flonum
(defun get-maximum (signal)
(setf max-level (peak signal 1000000))
(/ 0.85 max-level))
; function to generate white noise or pink noise
(defun get-noise (surf-type dur)
(if (= surf-type 0)
(noise dur) (pink dur)))
; function to generate non-normalized sweep
(defun generate-sweep (sweep-t surf-type start-f end-f )
; we multiply two pwl signals to get logarhythmic fade-in
(mult (pwl 0 0 (- sweep-t 0.01) 1 sweep-t 0 sweep-t)
(pwl 0 0 (- sweep-t 0.01) 1 sweep-t 0 sweep-t)
(lp (get-noise surf-type sweep-t)
; multiply two frequency sweep pwl's
; to get logarhythmic frequency sweep
(mult (pwl 0 (sqrt start-f) sweep-t (sqrt end-f) sweep-t)
(pwl 0 (sqrt start-f) sweep-t (sqrt end-f) sweep-t)
) ; end mult frequency pwl's
) ; end lp
) ; end mult envelope pwl's
) ; end defun
; function to generate non-normalized crash
(defun generate-crash (crash-t surf-type crash-f boost)
; again multiply two envelope pwl's
; to give logarhythmic fade-out
(mult (pwl 0 0 0.01 1 crash-t 0 crash-t)
(pwl 0 0 0.01 1 crash-t 0 crash-t)
; eq-lowshelf: function to boost bass frequency of crash
(eq-lowshelf
(lp (get-noise surf-type crash-t) crash-f)
crash-f boost) ; end eq-lowshelf
) ; end mult
) ; end defun generate-crash
; function to generate one cycle of Oxygene surf
(defun surf-oxygene
(scale-sweep sweep-t surf-type start-f end-f pause-t
scale-crash crash-t surf-type crash-f boost post-t)
; sequence four audio portions
(seq
; 1. sweep
(scale scale-sweep (generate-sweep sweep-t surf-type start-f end-f))
; 2. post-sweep silence
(s-rest pause-t)
; 3. crash
(scale scale-crash (generate-crash crash-t surf-type crash-f boost))
; 4. post-crash silence
(s-rest post-t)
) ; end seq
) ; end defun surf-oxygene
; Stereo Butterfly function: 'swishes' stereo left and right channels
; back and forth with each other
; 1.0 full stereo spread
; 0 both channels in the middle [sounds mono]
; -1.0 left and right channels flipped with each other
; can use flonum or control signal for width argument
(defun butterfly (width sound)
(vector
; left channel
(sum (mult (aref sound 0) (sum width 1) 0.5)
(mult (aref sound 1) (sum width -1) -0.5))
; right channel
(sum (mult (aref sound 1) (sum width 1) 0.5)(mult (aref sound 0)
(sum width -1) -0.5))))
; get scale [normalization] values for one sweep and one crash
; we do this only once so that we don't need
; to normalize every generated sweep and crash
(setf scale-sweep (get-maximum (generate-sweep sweep-t surf-type start-f
end-f)))
(setf scale-crash (get-maximum (generate-crash crash-t surf-type crash-f
boost)))
; generate repeated Oxygene surf
(mult
(pwl 0 0 fade 1.0 (- count-t fade) 1.0 count-t 0 count-t)
(seqrep (i count)
(cond
((= channels 1) ; generate mono Oxygene surf
(surf-oxygene
scale-sweep sweep-t surf-type start-f end-f pause-t
scale-crash crash-t surf-type crash-f boost post-t)
) ; close generate mono surf
(t ; generate stereo Oxygene surf
(butterfly (mult spread 0.01
(pwl 0 -1.0 sweep-t 1 sweep-t 1 (+ sweep-t pause-t) -1 surf-t -1 surf-t)
) ; end mult spread
(vector
(surf-oxygene ; Oxygene surf in left channel
scale-sweep sweep-t surf-type start-f end-f pause-t
scale-crash crash-t surf-type crash-f boost post-t)
(s-rest surf-t) ; silence in right channel
) ; end vector
) ; end butterfly
) ; close stereo surf
) ; end cond
) ; end seqrep
) ; end mult pwl
--- NEW FILE: surf-lfo.html ---
surf-lfo.ny: LFO Surf generator
<p>
LFO: low frequency oscillator. A signal whose frequency is
below the human ear's ability to hear as a tone,
generally below 20 cycles per second [Hertz or hz].
<p>
Generates mono or stereo surf which sweeps between a lower and
upper filter frequency. Stereo surf also sweeps back-and-forth
somewhere between the left and right audio channels.
<p>
To generate stereo surf, first open a blank stereo track [alt+p, s
in Audacity pre-1.3, alt+t, n, s in 1.3 and later]. Open the
generate menu. Click on 'Surf [LFO]'.
<p>
Variables with instructions:
<p>
1. Mono or stereo surf [1=mono 2=stereo]<br>
Mono surf is heard only in the center between the two speakers, or
in the middle of your head when wearing headphones. Stereo surf
also sweeps back-and-forth somewhere between the two audio
channels, depending on the next setting, Stereo Spread.
<p>
2. Stereo spread [stereo only: percent]<br>
The larger this value, the more widely the stereo surf will move
back-and-forth between the left and right audio channels.
When this value is above zero, the deeper section of the surf sweep
will be heard more in the left channel; below zero, the deeper
section of the surf sweep will be heard mor in the right channel.
<p>
3. Fade-in and fade-out times [seconds]<br>
To smoothly fade in and fade out the volume at the start and end of
the surf.
<p>
4. Surf duration [minutes]<br>
Up to sixty minutes of LFO surf.
<p>
5. Surf type [0=white noise 1=pink noise]<br>
White noise is more of a 'hissing' sound, whereas pink noise is a
lower 'rushing' sound.
Technically, white noise is 'equal energy per frequency', whereas
pink noise is 'equal energy per octave'.
<p>
6. Surf sweep frequency [hz]<br>
Sets how slow or fast the surf sweeps between the lower and upper
filter frequencies, and the left and right channels [for stereo
surf].
<p>
The next two variables<br>
7. Lower filter frequency [hz]<br>
8. Upper filter frequency [hz]<br>
determine how low and how high the lowpass filter sweeps the surf
noise.
<p>
9. Bass frequency to boost [hz]<br>
You can boost [increase the volume of] frequencies of the surf
sound below this setting, to get a deeper-sounding surf. Somewhat
analogous to the bass knob on your stereo.
<p>
10. Bass boost [db]<br>
Sets how much to boost the above bass frequency. 0db means no
boost, 6db means double the amplitude of the bass frequency, and so
on.
<p>
<i>Note</i>
<p>
If you get an error message 'Nyquist returned too many audio
channels', this means you tried to generate stereo surf without
first having opened a blank stereo track in audacity. See
instructions at the start of this help file for instructions on how
to do this.
<p>
Written by David R. Sky, June 17, 2007.<br>
<a href="http://www.shellworld.net/~davidsky/nyquist.htm">
http://www.shellworld.net/~davidsky/nyquist.htm</a><br>
Thanks to Steven Jones for pink noise generator code.<br>
Released under terms of the GNU Public License<br>
<a href="http://www.opensource.org/licenses/gpl-license.php">
http://www.opensource.org/licenses/gpl-license.php</a>
<p>
--- NEW FILE: surf-lfo.ny ---
;nyquist plug-in
;version 1
;type generate
;name "Surf [LFO]..."
;action "Generating LFO surf..."
;info "surf-lfo.ny by David R. Sky www.shellworld.net/~davidsky/nyquist.htm
\nTo generate stereo surf, first open a new stereo track in Audacity.\nReleased
under terms of the GNU Public License"
;control channels "Mono or stereo surf [1=mono 2=stereo]" int "" 2 1 2
;control spread "Stereo spread [stereo only: percent]" int "" 80 -100 100
;control fade "Fade-in and fade-out times [seconds]" real "" 15 0 30
;control dur "Surf duration [minutes]" real "" 1 0 60
;control surf-type "Surf type [0=white noise 1=pink noise]" int "" 1 0 1
;control surf-f "Surf sweep frequency [hz]" real "" 0.1 0.01 1
;control lower "Lower filter frequency [hz]" int "" 100 40 5000
;control upper "Upper filter frequency [hz]" int "" 1000 100 20000
;control bass-f "Bass frequency to boost [hz]" int "" 100 10 2000
;control boost "Bass boost [db]" int "" 18 0 60
; LFO Surf by David R. Sky, June 16, 2007.
; http://www.shellworld.net/~davidsky/nyquist.htm
; Released under terms of the GNU Public License
; http://www.opensource.org/licenses/gpl-license.php
#|
LFO: low frequency oscillator. A signal whose frequency is
generally below the human ear's ability to hear as a tone, usually
20 cycles per second [Hertz or hz].
Generates mono or stereo surf which sweeps between a lower and
upper filter frequency. Stereo surf also sweeps back-and-forth
somewhere between the left and right audio channels.
Copy surf-lfo.ny into your Audacity plug-ins folder, typically
c:\program files\audacity\plug-ins
in Windows.
Start a new session of Audacity. To generate stereo surf, first
open a blank stereo track [alt+p, s in Audacity pre-1.3, alt+t, n,
s in 1.3 and later]. Open the generate menu. Click on 'Surf [LFO]'.
Variables with instructions:
1. Mono or stereo surf [1=mono 2=stereo]
Mono surf is heard only in the center between the two speakers, or
in the middle of your head when wearing headphones. Stereo surf
sweeps back-and-forth somewhere between the two audio channels,
depending on the next setting, Stereo Spread.
2. Stereo spread [stereo only: percent]
The larger this value, the more widely the stereo surf will move
back-and-forth between the left and right audio channels.
When this value is above zero, the deeper section of the surf sweep
will be heard more in the left channel; below zero, the deeper
section of the surf sweep will be heard mor in the right channel.
3. Fade-in and fade-out times [seconds]
To smoothly fade in and fade out the volume at the start and end of
the surf.
4. Surf duration [minutes]
Up to sixty minutes of LFO surf.
5. Surf type [0=white noise 1=pink noise]
White noise is more of a 'hissing' sound, whereas pink noise is a
lower 'rushing' sound.
Technically, white noise is 'equal energy per frequency', whereas
pink noise is 'equal energy per octave'.
6. Surf sweep frequency [hz]
Sets how slow or fast the surf sweeps between the lower and upper
filter frequencies, and the left and right channels [for stereo
surf].
The next two variables
7. Lower filter frequency [hz]
8. Upper filter frequency [hz]
determine how low and how high the lowpass filter sweeps the surf
noise.
9. Bass frequency to boost [hz]
You can boost [increase the volume of] frequencies of the surf
sound below this setting, to get a deeper-sounding surf. Somewhat
equivalent to the bass knob on your stereo.
10. Bass boost [db]
Sets how much to boost the above bass frequency. 0db means no
boost, 6db means double the amplitude of the bass frequency, and so
on.
Note
If you get an error message 'Nyquist returned too many audio
channels', this means you tried to generate stereo surf without
first having opened a blank stereo track in audacity. See
instructions at the start of this help file for instructions on how
to do this.
Written by David R. Sky, June 17, 2007.
http://www.shellworld.net/~davidsky/nyquist.htm
Thanks to Steven Jones for pink noise generator code.
Released under terms of the GNU Public License
http://www.opensource.org/licenses/gpl-license.php
|#
; first make sure lower and upper frequency values really are lower and upper:
(setf range (list lower upper))
(setf range (sort range '<))
(setf lower (nth 0 range))
(setf upper (nth 1 range))
; range - range of frequencies for lp filter sweep
(setf range (- upper lower))
; convert minutes to seconds
(setf dur (* dur 60))
; if fade-in plus fade-out times > dur,
; set fade to 1/2 dur
(setf fade (if (< dur (* 2.0 fade))
(* dur 0.5) fade))
; function to generate white noise
; with bass boost
(defun white (dur bass-f boost)
(eq-lowshelf (noise dur) bass-f boost))
; function to generate pink noise
; by Steven Jones
; altered to boost bass frequency using eq-lowshelf
(defun pink (dur bass-f boost &optional (cutoff (/ *sound-srate* 16.0)))
(eq-lowshelf
(lowpass6 (noise dur) cutoff)
bass-f boost))
; function to multiply LFO signal by itself:
; Used on the LFO control signal
; after it has been converted to sweep from between -1 and +1
; to between 0 and +1.
; without this conversion, the result of using a straight sinewave
; to modulate the lowpass filter
; sounds like there is more high-frequency hissing
; than low-frequency rushing.
(defun sqr-signal (signal)
(mult signal signal))
; function to expand lfo to sweep between lower and upper filtering frequencies
(defun expand-signal (range lower signal)
(sum lower (mult range signal)))
; function to normalize signal to 0.9 level,
; as output becomes clipped somewhere above this level
(defun normalize (signal)
; check peak amplitude for max 1 million samples
(setf max-level (peak signal 1000000))
(scale (/ 0.9 max-level) signal))
; function to generate white- or pink-noise-based signal
(defun get-noise (dur bass-f boost)
(if (= surf-type 0)
(white dur bass-f boost) (pink dur bass-f boost)))
; function to generate LFO surf
(defun surf-lfo (dur fade bass-f boost range lower surf-f )
; apply fade-in and fade-out envelope
(mult (pwl 0 0 fade 1.0 (- dur fade) 1.0 dur 0 dur)
(normalize
(lp
; unmodified noise
(get-noise dur bass-f boost)
; expand control signal to sweep between lower and upper frequencies
(expand-signal range lower
; square control signal [multiply it with itself]
(sqr-signal
; convert LFO signal to sweep between -1 and +1,
; to sweep between 0 and +1
(sum 0.5 (mult 0.5 (lfo surf-f (* dur 60) *sine-table* -90)))
) ; end sqr-signal
) ; end expand-signal
) ; end lp
) ; end normalize
) ; end mult pwl
) ; end defun surf-lfo
; Stereo Butterfly function: 'swishes' left and right channels back and forth
; with each other
; +1.0 full stereo spread
; 0.0 both channels sound like they're in the middle
; -1.0 l/r channels flipped with each other
; can use flonum or control signal for width argument
(defun butterfly (width sound)
(vector
; left channel
(sum (mult (aref sound 0) (sum width 1) 0.5)
(mult (aref sound 1) (sum width -1) -0.5))
; right channel
(sum (mult (aref sound 1) (sum width 1) 0.5)(mult (aref sound 0)
(sum width -1) -0.5))))
; generate mono or stereo LFO surf
(cond
((= channels 1) ; generate mono surf
(surf-lfo dur fade bass-f boost range lower surf-f)
) ; end generate mono surf
(t ; generate stereo surf
(butterfly
(mult spread 0.01
(lfo surf-f dur *sine-table* 90)
) ; end mult spread 0.01
(vector
; left channel: surf sound
(surf-lfo dur fade bass-f boost range lower surf-f)
; right channel: silence
(s-rest dur)
) ; end vector
) ; end butterfly
) ; end generate stereo surf
) ; end cond
--- NEW FILE: bitone2.mp3 ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: surf-oxy.html ---
surf-oxy.ny: Jean-Michel Jarre's _Oxygene_ surf
<p>
Jean-Michel Jarre put out a hauntingly beautiful electronic album
in 1976, <i>Oxygene</i>. One section of this album had a repeating
surf sound: a sweep from the right to the left audio channel, a
pause, and then a deep crash in the right channel. After another
pause, this cycle repeated many times. Very relaxing to listen to.
<p>
This sound generator plug-in emulates that surf cycle, in either
mono or stereo.
<p>
To generate stereo surf, first open a blank stereo track [alt+p, s
in Audacity pre-1.3, alt+t, n, s in 1.3 and later]. Open the
generate menu. Click on
'Surf [Oxygene]'.
<p>
Variables:
<p>
1. Surf output [1=mono 2=stereo]<br>
To generate mono or stereo Oxygene surf.
<p>
2. Stereo spread [stereo only - percent]<br>
If you've chosen to generate stereo Oxygene surf, this setting will
determine how widely the surf sweeps away from the center pan
position. From +100 percent to -100 percent. Positive values make
the sweep section go from the right to the left, with the crash in
the right. Negative values reverse this pattern.
<p>
3. Fade-in and fade-out times [seconds]<br>
Time to fade in and fade out the volume at the start and end of the
surf, if you wish.
<p>
4. Number of Oxygene surf cycles<br>
How many Oxygene surf cycles to generate.
<p>
5. Surf type [0=white noise 1=pink noise]<br>
White noise is a higher-frequency 'hissing', whereas pink noise is
a lower-frequency 'rushing' sound.
<p>
The following two settings<br>
6. Sweep starting filter frequency [hz]<br>
7. Sweep ending filter frequency [hz]<br>
set the starting and ending frequencies for the lowpass filter to
sweep the sweep portion of Oxygene surf. [A lowpass filter allows
frequencies below a certain value to pass, while frequencies above
that value are attenuated, or reduced in volume.]
<p>
8. Sweep duration [seconds]<br>
This sets how slow or fast the sweep portion of Oxygene surf takes.
<p>
9. Post-sweep silence duration [seconds]<br>
Duration of the silence after the sweep.
<p>
10. Crash filter frequency [hz]<br>
The lowpass filter frequency of the crash.
<p>
11. Crash bass frequency boost [db]<br>
How much to increase the volume of the above filter frequency and
below. 0db means no boost, 6db means double the amplitude of this
bass frequency, and so on.
<p>
12. Crash duration [seconds]<br>
Duration of the crash.
<p>
12. Post-crash silence duration [seconds]<br>
how much silence before the Oxygene surf cycle repeats.
<p>
Notes
<p>
1. If you get an error message 'Nyquist returned too many audio
channels', this means you tried to generate stereo surf without
having first opened a blank stereo track in Audacity. See
instructions at the top of this help file on how to do this.
<p>
2. In the original _Oxygene_, reverb was applied to the surf,
giving it a more expansive sound and feeling. If you want to have
reverb added to Oxygene surf, you need to apply it yourself after
the surf sound has been generated. There's 'Gverb' already in the
Audacity effects menu, and many people use Anwida's free VST reverb
plug-in.
<p>
3. Seagulls not included.
<p>
Written by David R. Sky, June 20, 2007.<br>
<a href="http://www.shellworld.net/~davidsky/nyquist.htm">
http://www.shellworld.net/~davidsky/nyquist.htm</a><br>
Thanks to Steven Jones for pink noise Nyquist code.<br>
Released under terms of the GNU Public License<br>
<a href="http://www.opensource.org/licenses/gpl-license.php ">
http://www.opensource.org/licenses/gpl-license.php </a>
<p>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs