[Impromptu] Error with loading samples in sampler
Andrew Sorensen
andrew at moso.com.au
Mon Sep 21 04:24:40 GMT 2009
Hi Andreas,
It appears that I've made it impossible to load audiodata before the
au is connected to the graph - oops. This is a bug and I'll fix it
for the next release. But in the meantime you just need to ensure
that the au is connected up BEFORE you load it with any audio data.
The code below works fine for me:
(define au (au:make-node "aumu" "play" "MOSO"))
(au:connect-node au 0 *au:output-node* 0)
(au:update-graph)
(define klau:instr:gbpiano:sampleslist
(list (cons 024 "/tmp/t1.wav")
(cons 025 "/tmp/t2.wav")
))
;create list with loaded samples
(define klau:instr:gbpiano:sampledata
(map (lambda (e)
(cons (car e) (au:load-audio-data (cdr e))))
klau:instr:gbpiano:sampleslist))
;;loads the node passed in as an argument with nice piano samples ;)
(define (klau:instr:gbpiano au)
(for-each (lambda (e)
(au:play:set-sample-data au (car e) (cdr e)))
klau:instr:gbpiano:sampledata))
(klau:instr:gbpiano au)
(play-note (now) au 24 80 20000)
(play-note (now) au 25 80 20000)
Just FYI I don't think the sampler handles mono files at the moment so
you might need to be careful there also.
Cheers,
Andrew.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.moso.com.au/pipermail/impromptu/attachments/20090921/ac9b5e39/attachment.htm
More information about the Impromptu
mailing list