plightThis extension implements a sampled drum kit.
load "plight/drum.lsp" play plight-drum-example()
The drum machine software in demos/plight deserves further explanation.
to use the software, load the code by evaluating:
load "plight/drum.lsp"
exec load-props-file(strcat(*plight-drum-path*,
"beats.props"))
exec create-drum-patches()
exec create-patterns()
Drum sounds and patterns are specified in the beats.props file (or
whatever name you give to load-props-file). This file
contains two types of specifications. First, there are sound file specifications.
Sound files are located by a line of the form:
set sound-directory = "./"This gives the name of the sound file directory, relative to the
beats.props file. Then, for each sound file, there should be a line of
the form:
track.2.5 = big-tom-5.wavThis says that on track 2, a velocity value of 5 means to play the sound file
big-tom-5.wav. (Tracks and velocity values are described below.)
The beats.props file contains specifications for all the sound files
in plight using 8 tracks. If you make your own specifications
file, tracks should be numbered consecutively from 1, and velocities should be
in the range of 1 to 9.
The second set of specifications is of beat patterns. A beat pattern is given by a line in the following form:
beats.5 = 2--32--43-4-5---The number after
beats is just a pattern number. Each pattern
is given a unique number. After the equal sign, the digits and dashes are
velocity values where a dash means "no sound." Beat patterns should be
numbered consecutively from 1.
Once data is loaded, there are several functions to access drum patterns and
create drum sounds (described below). The plight/drum.lsp file
contains an example function play-drum-example() to play some drums.
There is also the file plight/beats.props to serve as an
example of how to specify sound files and beat patterns.
The following functions do not "autoload", so be sure to call
load "plight/drum.lsp"in your main program to load the functions.
drum(tracknum, patternnum, bpm) [SAL](drum tracknum patternnum bpm) [LISP]beats.10. If the third character
of this pattern is 3 and tracknum is 5, then on the third beat, play
the soundfile assigned to track.5.3. This function returns a SOUND.drum-loop(snd, duration, numtimes) [SAL](drum-loop snd duration numtimes) [LISP]SOUND is returned.length-of-beat(bpm) [SAL](length-of-beat bpm) [LISP]FLONUM.