Csound Csound-dev Csound-tekno Search About

Re: oscil: not initialized

Date1999-07-05 23:10
FromRichard Dobson
SubjectRe: oscil: not initialized
Basically, it means exactly what it says - it is just unable to tell you
why. Before running a score, Csound does an 'initialization' pass
(sometimes referred to as 'i-time processing'). For many opcodes, such
as 'oscil', this is where internal buffers are allocated, for wavetables
and other things. However, in doing the initialization pass, Csound
follows the given logic - if an instruction jumps over the line where
the oscil is used, that oscil will not be initialized. 'goto' jumps
~always~ - including during initialization. 

Since, presumably, the test kint != 1 is true first time around, the
oscil line is bypassed - next time round the oscil is called - but the
internal memory has not been set up, so it is an error.

You need to rejig things so that all such opcodes are initialized
properly. There are special versions of 'goto' which only operate at
certain times - 'igoto' is only executed during the initialization pass,
and is ignored everywhere else; and 'kgoto' is ignored at i-time and
during a-rate time, but is obeyed at k-time. you would use kgoto
therefore ~only~ to change k-rate variables, or change behaviour at the
k-rate. Similarly you would use igoto to change initialization variables
and sequences. 

In short, you need to choose the goto according to the thing you are
changing. But don't jump over opcodes such as oscil at i-time, or you
will get this error. So one rule of thumb would be - use the lowest
level of goto you need - kgoto if possible, igoto for pure
initialization steps, and goto only if is ~always~ safe to jump over
something.

Richard Dobson

pete moss wrote:
> 
> what does
> INIT ERROR: oscil: not initialized
> mean?
> 
> if i try:
> 
> if kint != 1 goto next2
> a1 oscil p4, p6, 1
> goto end
> next2:
> 
> then i get the error.  i have tried replacing the ocsil with table, and
> i get table: not initialized.
> 
> help!
> 
> :P

-- 
Test your DAW with my Soundcard Attrition Page!
http://wkweb5.cableinet.co.uk/rwd (LU: 27th June 1999)