Clamps Dictionary
make-sfz-synth
Function
(make-sfz-synth &key (preset :yamaha-grand-piano) (channel *default-midi-channel*) (port *default-midi-port*))
Return a closure for a polyphonic sfz synth, playable by MIDI using a midi-port as input.
Arguments
Note
The returned closure can be controlled by funcalling it with a keyword command and optional arguments. The following commands are implemented:
:connect &key port channel preset - (Re)connect the synth to a port with channel and preset.
:disconnect - Disconnect the synth from any MIDI input, sending a note-off to all pending notes.
:channel <num> - Set the MIDI in channel of the synth to num being an Integer in the range [1..16].
:preset <preset> - Set the preset of the synth to the registered sfz preset to use.
:note-on <keynum> <velo> - Simulate a Note-on event of keynum and velo.
:note-off <keynum> - Simulate a Note-off event of keynum and velo.
:all-notes-off - Stop all pending notes of the synth.
Example
(defparameter *my-synth* (make-sfz-synth :port midi-1)) (funcall *my-synth* :connect) ;;; Connect a Midi Keyboard sending on channel 1 to :midi-1 and play ;;; some notes. ;;; disconnect from the Midi Port: (funcall *my-synth* :disconnect) ;;; connect to another port using Channel 2: (funcall *my-synth* :connect :port :midi-2 :channel 2) ;;; change the preset: (funcall *my-synth* :preset :flute-nv) ;;; send note on and note off programmatically: (funcall *my-synth* :note-on 60 64) (funcall *my-synth* :note-off 60) (funcall *my-synth* :note-on 60 64) (funcall *my-synth* :note-on 62 64) (funcall *my-synth* :note-on 71 64) ;;; turn off all pending notes: (funcall *my-synth* :all-notes-off 71 64)