(band inst) -> composition?
inst: number?, a valid MIDI instrument program number (1--128)
Creates a new composition that plays comp with the given instruments, where the ith instrument is assigned to the ith MIDI channel. Individual channels can be selected for playback using the instrument mod.
(composition? v) -> boolean?
v: any
Returns #t if and only v is a valid composition.
(denominator dur) -> integer?
dur: duration?
Returns the denominator of dur.
(dur num den) -> duration?
num: integer?
den: integer?
Creates a new duration object representing the ratio num/den.
(dur? v) -> boolean?
v: any
Returns #t if and only v is a valid duration object.
(dynamics velocity) -> mod?
velocity: integer?, 0 <= level <= 127
A modification that plays the modified composition at the given MIDI velocity level. Note than a velocity of 127 corresponds to full volume for that note.
empty : composition?
The empty composition.
en : dur?
An eighth note duration (1/8).
hn : dur?
A half note duration (2/4).
(instrument prog) -> composition?
prog: integer?, a valid MIDI program number (0--127)
Creates a new composition that plays composition comp played with MIDI sound or program prog. See the "General MIDI" Wikipedia article for a complete list of MIDI program numbers to sound mappings. Additionally, you should call load-instrument at the top-level of your program to download the desired instrument's soundfont before using this function.
(load-instrument prog) -> void
prog: integer?, a valid MIDI program number (0--127)
Downloads and loads the requested MIDI instrument soundfont.
(load-percussion prog) -> void
prog: integer?, a valid MIDI program number (0--127)
Loads the requested percussion MIDI instrument soundfont.
(mod kind comp) -> composition?
kind: mod?
comp: composition?
Creates a new composition that plays comp with the given modification mod.
(mod? v) -> boolean?
v: any
Returns #t if and only v is a valid modification.
(note midi-note dur) -> composition?
midi-note: note-value?
dur: dur?
Creates a new composition consisting of a single note from the given MIDI note value and duration.
(note-freq freq dur) -> composition?
freq: integer?, 0 <= frequency <= 4000
dur: dur?
Creates a new composition consisting of a single note of the given frequency and duration.
(note-value? n) -> boolean?
n: number
Returns #t if and only n is a valid MIDI note value (0--127).
(numerator dur) -> integer?
dur: duration?
Returns the numerator of dur.
(octave? v) -> boolean?
v: any
Returns #t if and only v is a valid octave, an integer in the range (0, 10).
(par comp1, comp2, ...) -> composition?
comp1, comp2, ...: composition?
Creates a new composition that plays comp1, comp2, …, in parallel.
percussion : mod?
A modification that switches playback to percussion mode (MIDI channel 9). In percussion mode, each note corresponds to one percussion instrument.
(pickup c1 c2) -> composition?
c1: composition?
c2: composition?
Creates a new composition that plays c2 preceded by c1. c1's duration is not factored into the duration of the overall composition.
(pitch? v) -> boolean?
v: any
Returns #t if and only v is a valid pitch, a string denoting a pitch class, e.g., "Ab".
(play-composition comp) -> void
comp: composition?
Plays the given composition. Note that this function must be triggered from some user action on the screen, e.g., a button click. Otherwise, the browser will silently block audio playback.
qn : dur?
A quarter note duration (1/4).
(repeat n comp) -> composition?
n: integer?, n >= 0
comp: composition?
Creates a new composition formed by repeating comp n times sequentially.
(rest dur) -> composition?
dur: dur?
Creates a new composition consisting of a single rest from the given duration.
(seq comp1, comp2, ...) -> composition?
comp1, comp2, ...: composition?
Creates a new composition that plays comp1, comp2, …, in sequence.
sn : dur?
A sixteenth note duration (1/16).
(tempo beat bpm) -> mod?
beat: dur?, the pulse of the tempo
bpm: number?, beats per minute
A modification that plays the modified composition at the given beat and bpm.
tn : dur?
A thirty-secondth note duration (1/32).
(trigger proc) -> composition?
proc: procedure?, a procedure that takes no arguments
Creates a new composition that calls the function proc when played.
(use-high-quality-instruments enable) -> void
enable: boolean?, whether to use high-quality MIDI instruments
Enables (or disables) the use of high-quality MIDI instruments. Note that high-quality instruments are much bigger and take longer to load.
wn : dur?
A whole note duration (4/4).