Mercurial > hg > jslab
annotate examples/sound/midi/synth.scm @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
rev | line source |
---|---|
samer@0 | 1 (import "javax.sound.midi.*") |
samer@0 | 2 |
samer@0 | 3 (define synth (MidiSystem.getSynthesizer)) |
samer@0 | 4 (define c0 (vector-ref (.getChannels synth) 0)) |
samer@0 | 5 (define (open) (.open synth)) |
samer@0 | 6 (define (close) (.close synth)) |
samer@0 | 7 (define (on pitch) (.noteOn c0 pitch 80)) |
samer@0 | 8 (define (off pitch) (.noteOff c0 pitch 0)) |
samer@0 | 9 |
samer@0 | 10 (open) |