Csound Csound-dev Csound-tekno Search About

Re: drum kit

Date1998-12-09 09:24
FromRichard Dobson
SubjectRe: drum kit
The problem is almost invariably the use of goto. Opcodes are not
initialized at performance time, but, well, at init time. Depending on what
MIDI notes are received, one or more of the linsegs is being skipped, so
they are not getting initialized. Commenting out the 'goto end' ameliorates
the problem, but probably doesn't eliminate it (I haven't had time this
morning to run it.  The only safe method is to ensure all the linsegs and
similar are initialized at the start (use a special init pass, using igoto
if necessary), and then just ~use~ them at perf time.

Richard Dobson
http://www.wkweb5.cableinet.co.uk/rwd


XLR8R251@aol.com wrote:
> 
> My apologies to those who recieve this twice.  It looked like not all of this
> made it through the first time.
> 
> *****
> 
> Here is the "non-MIDI" instr.  As you can see the only p references are to p4
> and p5, easily changeable to veloc and notnum.  Sorry I didn't include it in
> my original post as I was at work.  I have tried this version, without MIDI,
> and I am now getting the same error, so it must be somewhere in my code.
> 
> sr      = 44100
> kr       = 4410
> ksmps =  10
> nchnls =  1
> 
> ;f1 0 2048 10 1                                                 ;sine wave
> ;f2 0 2049 5  1 256 .667 1792 .0001                             ;exp env
> 
>                 instr 4         ;Drum Kit
> ;=======================================
> 
> iamp    =                       p4*10
> inote   =                       p5
> 
> if inote==36 goto       Kick
> if inote==38 goto       Snare
> if inote==42 goto       HHat
>                 goto            end