1 USING: accessors arrays kernel namespaces openal sequences synth synth.buffers ;
4 : play-sine-wave ( freq seconds sample-freq -- )
6 <16bit-mono-buffer> >sine-wave-buffer send-buffer id>>
8 [ AL_BUFFER rot set-source-param ] [ source-play ] bi
11 : test-instrument1 ( -- harmonics )
16 4 0.03125 <harmonic> ,
19 : test-instrument2 ( -- harmonics )
27 : sine-instrument ( -- harmonics )
28 1 1 <harmonic> 1array ;
30 : test-note-buffer ( note -- )
32 test-instrument2 swap cd-sample-freq <16bit-mono-buffer>
33 >note send-buffer id>>
34 1 gen-sources first [ swap queue-buffer ] [ source-play ] bi