Mercurial > hg > jslab
diff examples/sound/midi/synth.scm @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/sound/midi/synth.scm Tue Jan 17 17:50:20 2012 +0000 @@ -0,0 +1,10 @@ +(import "javax.sound.midi.*") + +(define synth (MidiSystem.getSynthesizer)) +(define c0 (vector-ref (.getChannels synth) 0)) +(define (open) (.open synth)) +(define (close) (.close synth)) +(define (on pitch) (.noteOn c0 pitch 80)) +(define (off pitch) (.noteOff c0 pitch 0)) + +(open)