General Functions and Commands


> (Direct Output) (G-Block Only)

Any line of the input file beginning with a ">" will be written directly to the output file (with exception of the ">" itself).  This can be very useful for creating Csound function statements as well as inserting some of Csound's new #define and #include macros. Additionally, it can be used for inserting comments and Csound's Tempo statements.  For example:

>f1 0 4096 10 1; a sine wave
would be directly inserted (without the >) into the output score file created by nGen.


Random Seed Initiation

rs(ui)

Summary
Seeds the internal pseudo random number generator. ui must be a value between 0 and 65536.  (The random number generator is implemented through the C standard library).  The default random seed is 1.

Scope
All subsequent random generated values will be initiated by  the initial seed value ui.  Thus, pseudo-random sequences can be regenerated exactly (on the same system) using the same seed value.


Random Deviation

rd(f)

Summary
Any value occurring after an rd(f) statement will be deviated by the amount:

value + or - (value * f/2)
If you have established a deviation and wish to cancel it later you can specify rd(0).  Typical values: f is a scalar where 0 is 0 % deviation and 1 is 100% deviation (but higher values may certainly be employed!).

IMPORTANT:  The placement of rd is very important; when using in p-fields use caution that it is placed appropriately.  For example:

i1 = 3 0 5 { 
  p2 .1 
  p3 10 
 
  rd(.1)  ;turn on +/- 5% deviation
  p4 5000 
  
  rd(0)   ;turn off deviation (incorrect!)
  p5 100.3 
}
While it would appear that this turns on 10% deviation after p3 and then off before p5, that's not the case.  P3 will process the first "10", then turn on the deviation.  This deviation will then apply to the rest of the 10s in p3 (because the i-block has to play for 5 beats).  After the initial p4 value of 5000 is processed, the deviation will be turned of for the rest of p4!  Do it like this instead:

i1 = 3 0 5 { 
  p2 .1 
  p3 10 
  p4 rd(.1) 5000    ;turn on +/- 5% deviation
  p5 rd( 0) 100.3   ;turn off deviation (correct!)

}
Example
rd(.25)
For a datum value of 100 (this can be literal or generated by a function), rd will deviate from the value by a maximum of +-12.5.
Scope:  All subsequent values (or functions) will add a deviation within +f/2 to -f/2 to the current value.  A nice way to make rhythmic values seem a bit more human is to specify a small deviation value (such as .05).


Tempo (G-Block Only)

te(f)

Resets the global tempo to f beats per minute.  The default is 60.