Mercurial > hg > jslab
annotate examples/sound/sampled/play2.scm @ 2:74cc9e431818
Revert change to MidiSynth
author | samer |
---|---|
date | Fri, 05 Apr 2019 16:43:56 +0100 |
parents | bf79fb79ee13 |
children |
rev | line source |
---|---|
samer@0 | 1 (load "audio.scm") |
samer@0 | 2 |
samer@0 | 3 (define fmt (stereo 44100)) ; see audio.scm for other options |
samer@0 | 4 |
samer@0 | 5 (define in (linesrc fmt)) |
samer@0 | 6 (define out (linesnk fmt)) |
samer@0 | 7 (define N 2048) ; frame size for audio transfers |
samer@0 | 8 (define x (VVector. "x" N)) ; frame of audio data |
samer@0 | 9 |
samer@0 | 10 ; this sets up the tasks to run in the main loop, but |
samer@0 | 11 ; nothing happens until the loop is started |
samer@0 | 12 (addtasks |
samer@0 | 13 (.reader in (.array x) 0 N) ; read N samples into x |
samer@0 | 14 (switch (.writer out (.array x) 0 N)) |
samer@0 | 15 ) |
samer@0 | 16 |