[Audacity-nyquist] New Version 2 plug-in: Audio Sample Sequencer 1.0
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: David R. S. <sk...@wa...> - 2004-11-22 22:40:20
|
* sequencer1.ny Audio Sample Sequencer 1.0 (version 2 plug-in)
this is a version 2 Nyquist plug-in, which can only be used in
Audacity 1.2.3 and later.
A sequencer repeats a series of notes that you have programmed,
repeatedly.
This plug-in sequences mono audio that you have already loaded into
Audacity, whether a note, vocal sound, series of notes and/or vocal
sounds, etc. It is like speed change on a turntable: the faster the
speed, the higher are both the pitch and tempo. The lower the
speed, the lower are both the pitch and tempo.
Variables:
tempo (steady, in beats per minute);
beats per measure (one to sixteen). This plug-in "assumes" that one
sequence of notes is one measure;
sequences to generate: how many of these sequences do you want
generated (from one to a thousand);
16 pairs of tone shift (in semitones - 0 means no tone shift,
negative numbers indicate tone drop, positive numbers indicate tone
increase); and volume for that particular note (1.0 means regular
volume, 0.0 means you do not hear a note generated for that beat.
volume can range from 0.0 to 1.0.
Interesting sequences and effects can be generated by making one
sequence of notes, then applying the sequencer a second (and more)
times to that new audio.
Copy sequencer1.ny into your Audacity plug-ins folder. The next
time you open Audacity, you'll find audio Sample Sequencer 1.0 (V2)
in the effects menu.
there are improved versions of Audio Sample Sequencer in the works.
Thanks to Pascal Bourguignon of comp.lang.lisp for assistance in
using lists.
For people receiving in digest mode, sequencer1.ny is below. Lines starting
with a semicolon (;) should not be word wrapped.
{begin}
;nyquist plug-in
;version 2
;type process
;name "Audio Sample Sequencer 1.0 (V2)..."
;action "Sequencing audio..."
;info "Audio Sample Sequencer 1.0 by David R. Sky, lisp help by Pascal Bourguignon (comp.lang.lisp)"
;control tempo "Tempo" real "beats per minute" 120 30 600
;control sig "Beats per measure" int "beats" 4 1 16
;control count "Sequences to generate" int "sequences" 16 1 1000
;control ts1 "Tone shift 1" int "semitone change" 0 -60 60
;control vol1 "Volume 1" real "linear" 1.0 0.0 1.0
;control ts2 "Tone shift 2" int "semitone change" 0 -60 60
;control vol2 "Volume 2" real "linear" 1.0 0.0 1.0
;control ts3 "Tone shift 3" int "semitone change" 0 -60 60
;control vol3 "Volume 3" real "linear" 1.0 0.0 1.0
;control ts4 "Tone shift 4" int "semitone change" 0 -60 60
;control vol4 "Volume 4" real "linear" 1.0 0.0 1.0
;control ts5 "Tone shift 5" int "semitone change" 0 -60 60
;control vol5 "Volume 5" real "linear" 1.0 0.0 1.0
;control ts6 "Tone shift 6" int "semitone change" 0 -60 60
;control vol6 "Volume 6" real "linear" 1.0 0.0 1.0
;control ts7 "Tone shift 7" int "semitone change" 0 -60 60
;control vol7 "Volume 7" real "linear" 1.0 0.0 1.0
;control ts8 "Tone shift 8" int "semitone change" 0 -60 60
;control vol8 "Volume 8" real "linear" 1.0 0.0 1.0
;control ts9 "Tone shift 9" int "semitone change" 0 -60 60
;control vol9 "Volume 9" real "linear" 1.0 0.0 1.0
;control ts10 "Tone shift 10" int "semitone change" 0 -60 60
;control vol10 "Volume 10" real "linear" 1.0 0.0 1.0
;control ts11 "Tone shift 11" int "semitone change" 0 -60 60
;control vol11 "Volume 11" real "linear" 1.0 0.0 1.0
;control ts12 "Tone shift 12" int "semitone change" 0 -60 60
;control vol12 "Volume 12" real "linear" 1.0 0.0 1.0
;control ts13 "Tone shift 13" int "semitone change" 0 -60 60
;control vol13 "Volume 13" real "linear" 1.0 0.0 1.0
;control ts14 "Tone shift 14" int "semitone change" 0 -60 60
;control vol14 "Volume 14" real "linear" 1.0 0.0 1.0
;control ts15 "Tone shift 15" int "semitone change" 0 -60 60
;control vol15 "Volume 15" real "linear" 1.0 0.0 1.0
;control ts16 "Tone shift 16" int "semitone change" 0 -60 60
;control vol16 "Volume 16" real "linear" 1.0 0.0 1.0
; Audio Sample Sequencer 1.0 by David R. Sky, November 22, 2004
; sequences audio already loaded in Audacity
; initializing variables
(setf sig (truncate sig))
(setf beatlen (/ 60.0 tempo))
; setting list of variables - ts and vol
(setf variables (list ts1 vol1 ts2 vol2 ts3 vol3 ts4 vol4 ts5 vol5
ts6 vol6 ts7 vol7 ts8 vol8 ts9 vol9 ts10 vol10 ts11 vol11 ts12
vol12 ts13 vol13 ts14 vol14 ts15 vol15 ts16 vol16))
; set length in seconds of 1 measure
(setf measurelen (* sig beatlen))
; taking audio sample
(setq sample (extract 0.0 1.0 s))
; determining duration of sample
(setf dur (/ len *sound-srate*))
; clearing track
(extract 0.0 0.0 s)
; defining fresh audio
(setq sequence (extract 0 0 s))
; function to do tone shift with volume adjust
(defun change (sample ts vol)
(setf ts (expt 2.0 (/ ts 12.0)))
(setf ts (/ 1.0 ts))
(mult vol (force-srate 44100 (stretch-abs ts (sound sample)))))
; making new note and correctly placing in time
(defun makenote (i sig sample ts vol s)
(if (>= i sig) (cue s)
(sim (cue s)
(at-abs (+ dur (* i beatlen)) (cue (change sample ts vol))))))
(dotimes (i sig)
(setf ts (nth (* i 2) variables))
(setf vol (nth (+ 1 (* i 2)) variables))
(setq sequence (sim (cue sequence) (makenote i sig sample ts vol
s))))
; extracting clean audio
(setq sequence (extract-abs dur (+ dur measurelen) sequence))
; clear track
(extract 0 0 s)
; create blank for sim below
(setq s (extract 0 0 s))
; generate full sequence
(simrep (i count)
(sim (cue s)
(at-abs (* i measurelen) (cue sequence))))
{end}
-- |