Hi folks,
I’m new here. My name is Adam and I have just started writing my own nyquist plugins for Audacity. I am an experienced software developer although I only have limited experience with lisp and no prior experience with nyquist.
I’m trying to use the predefined note duration constants in a generation plugin that I’m working on and I am getting an error when I use the sixteenth note constant ‘s’. I suspect it is because there is a conflict between the constant symbol name ‘s’ and the audacity sound field ‘s’ but I’m not experienced enough to be sure. Has anybody else noticed this?
At the moment, I’m just taking user input for a note length and converting it to a numerical value for use later down the track. All the other note length constants are fine, it is just the sixteenth note one that is an issue.
The code for the control is as follows:
;control div "Division" choice "Whole,Half,Quarter,Eighth,Sixteenth,Whole Dotted,Half Dotted,Quarter Dotted,Eighth Dotted,Sixteenth Dotted,Whole Triplet,Half Triplet,Quarter Triplet,Eighth Triplet,Sixteenth Triplet" 2
The code for the conversion of user selected value to numeric duration is as follows:
;; determine the note length
(case div
( 0 (setf noteLen w)) ;; Whole
( 1 (setf noteLen h)) ;; Half
( 2 (setf noteLen q)) ;; Quarter
( 3 (setf noteLen i)) ;; Eighth
( 4 (setf noteLen s)) ;; Sixteenth
( 5 (setf noteLen wd)) ;; Whole Dotted
( 6 (setf noteLen hd)) ;; Half Dotted
( 7 (setf noteLen qd)) ;; Quarter Dotted
( 8 (setf noteLen id)) ;; Eighth Dotted
( 9 (setf noteLen sd)) ;; Sixteenth Dotted
(10 (setf noteLen wt)) ;; Whole Triplet
(11 (setf noteLen ht)) ;; Half Triplet
(12 (setf noteLen qt)) ;; Quarter Triplet
(13 (setf noteLen it)) ;; Eighth Triplet
(14 (setf noteLen st)) ;; Sixteenth Triplet
(T (setf noteLen q)) ;; Default - quarter
)
;; debugging value of noteLen
(error "noteLen = ~a" noteLen)
The debug error statement comes back with the correct values for all selected options except sixteenth which causes a “Nyquist returned no audio” message.
I know I can easily get around this by hard coding the value for sixteenth notes but I’d really like to know why this is occurring. Any insight or comment would be most appreciated.
EDIT: I just realised I should have mentioned that this is in version 1.3.12-beta running on WinXP.
Cheers,
Adam-V