Re: [Nyquist-users] Can play 1 note, not a sequence
Nyquist is a language for sound synthesis and music composition.
Brought to you by:
rbd
|
From: Steve M. R. <st...@su...> - 2010-12-29 05:21:28
|
On Tue, Dec 28, 2010 at 11:07:12PM -0600, Steve M. Robbins wrote:
> On Tue, Dec 28, 2010 at 07:30:46PM -0500, Roger Dannenberg wrote:
> > My guess is there are a couple of definitions of my-note floating
> > around. You should check the definition (e.g. see GRINDEF) or
> > redefine my-note to make sure you know how many parameters it takes.
>
> Just to be clear, I am typing in (cut and paste, actually) the
> definition for my-note directly from the manual:
>
> define function my-note(pitch, dur)
> return osc(pitch, dur, *table*)
>
> So I'm pretty sure I'm using the 2-variable version. I should
> also mention that "play my-note(d4,i)" works. It's just
> when I try to make a sequence that it fails.
>
>
> > Using/learning about getting a stack trace from XLISP would also
> > tell you exactly which function is a problem. -Roger
OK, so I switched to xlisp mode and the output shows a bunch of stuff now.
First, I checked that the definition of my-note is what I typed in:
1> (grindef 'my-note)
(LAMBDA (PITCH DUR)
(OSC PITCH DUR *TABLE*))
So I can play a single note
(play (my-note a4 i))
I can play a sequence of one note
(play (seq (my-note a4 i)))
(play (seq (my-note b4 i)))
But I can't play a sequence of two notes
(play (seq (my-note b4 i) (my-note a4 i)))
Saving sound file to /home/steve/Music/Nyquist/steve-temp.wav
error: too few arguments
Function: #<Closure: #10ff060>
Arguments:
0.5
Function: #<Subr-SND-MAX: #f6b720>
Arguments:
#<Sound: #8d50a2f0>
1000000
Function: #<FSubr-COND: #f5c720>
Arguments:
((SOUNDP SND) (SND-MAX SND SAMPLES))
((ARRAYP SND) (LET ((PEAK 0) (CHANS (LENGTH SND))) (DOTIMES (I CHANS) (SETF PEAK (MAX PEAK (SND-MAX (AREF SND I) (/ SAMPLES CHANS))))) PEAK))
(T (ERROR "unexpected value in multichannel-max" SND))
Function: #<Closure-MULTICHANNEL-MAX: #f83738>
Arguments:
#<Sound: #8d50a2f0>
1000000
Function: #<FSubr-SETF: #f5e2f8>
Arguments:
PEAK
(MULTICHANNEL-MAX SND *AUTONORM-MAX-SAMPLES*)
Function: #<FSubr-COND: #f5c720>
Arguments:
((AND (NOT (SOUNDP SND)) (NOT (EQ (TYPE-OF SND) (QUOTE ARRAY)))) (ERROR "AUTONORM (or PLAY?) got unexpected value" SND))
((EQ *AUTONORM-TYPE* (QUOTE PREVIOUS)) (SCALE *AUTONORM* SND))
((EQ *AUTONORM-TYPE* (QUOTE LOOKAHEAD)) (SETF PEAK (MULTICHANNEL-MAX SND *AUTONORM-MAX-SAMPLES*)) (SETF PEAK (MAX 0.001 PEAK)) (SETF *AUTONORM* (/ *AUTONORM-TARGET* PEAK)) (SCALE *AUTONORM* SND))
(T (ERROR "unknown *autonorm-type*"))
Function: #<FSubr-COND: #f5c720>
Arguments:
(*AUTONORMFLAG* (COND ((AND (NOT (SOUNDP SND)) (NOT (EQ (TYPE-OF SND) (QUOTE ARRAY)))) (ERROR "AUTONORM (or PLAY?) got unexpected value" SND)) ((EQ *AUTONORM-TYPE* (QUOTE PREVIOUS)) (SCALE *AUTONORM* SND)) ((EQ *AUTONORM-TYPE* (QUOTE LOOKAHEAD)) (SETF PEAK (MULTICHANNEL-MAX SND *AUTONORM-MAX-SAMPLES*)) (SETF PEAK (MAX 0.001 PEAK)) (SETF *AUTONORM* (/ *AUTONORM-TARGET* PEAK)) (SCALE *AUTONORM* SND)) (T (ERROR "unknown *autonorm-type*"))))
(T SND)
Function: #<FSubr-LET: #f5c5a0>
Arguments:
(PEAK)
(COND (*AUTONORMFLAG* (COND ((AND (NOT (SOUNDP SND)) (NOT (EQ (TYPE-OF SND) (QUOTE ARRAY)))) (ERROR "AUTONORM (or PLAY?) got unexpected value" SND)) ((EQ *AUTONORM-TYPE* (QUOTE PREVIOUS)) (SCALE *AUTONORM* SND)) ((EQ *AUTONORM-TYPE* (QUOTE LOOKAHEAD)) (SETF PEAK (MULTICHANNEL-MAX SND *AUTONORM-MAX-SAMPLES*)) (SETF PEAK (MAX 0.001 PEAK)) (SETF *AUTONORM* (/ *AUTONORM-TARGET* PEAK)) (SCALE *AUTONORM* SND)) (T (ERROR "unknown *autonorm-type*")))) (T SND))
Function: #<Closure-AUTONORM: #f81090>
Arguments:
#<Sound: #8d50a2f0>
Function: #<Subr-SND-SAVE: #f6b5a0>
Arguments:
(AUTONORM (SEQ (MY-NOTE B4 I) (MY-NOTE A4 I)))
1000000000
"/home/steve/Music/Nyquist/steve-temp.wav"
4
1
16
0
T
Function: #<FSubr-LET: #f5c5a0>
Arguments:
((NY:FNAME *DEFAULT-SOUND-FILE*) (NY:MAXLEN NY:ALL) (NY:ENDIAN NIL) (NY:SWAP 0))
(COND ((NULL NY:FNAME) (COND ((STRINGP NY:MAXLEN) (SETF NY:FNAME NY:MAXLEN) (SETF NY:MAXLEN NY:ALL)) (T (SETF NY:FNAME *DEFAULT-SOUND-FILE*)))))
(COND ((EQUAL NY:FNAME "") (COND ((NOT *SOUNDENABLE*) (FORMAT T "s-save: no file to write! play option is off!\n")))) (T (SETF NY:FNAME (SOUNDFILENAME NY:FNAME)) (FORMAT T "Saving sound file to ~A~%" NY:FNAME)))
(COND ((EQ NY:ENDIAN :BIG) (SETF NY:SWAP (IF (BIGENDIANP) 0 1))) ((EQ NY:ENDIAN :LITTLE) (SETF NY:SWAP (IF (BIGENDIANP) 1 0))))
(SND-SAVE (QUOTE (AUTONORM (SEQ (MY-NOTE B4 I) (MY-NOTE A4 I)))) NY:MAXLEN NY:FNAME *DEFAULT-SF-FORMAT* *DEFAULT-SF-MODE* *DEFAULT-SF-BITS* NY:SWAP *SOUNDENABLE*)
Function: #<FSubr-LET: #f5c5a0>
Arguments:
((PEAK (S-SAVE (AUTONORM (SEQ (MY-NOTE B4 I) (MY-NOTE A4 I))) NY:ALL *DEFAULT-SOUND-FILE* :PLAY *SOUNDENABLE*)))
(AUTONORM-UPDATE PEAK)
Any clues?
Thanks,
-Steve
|