Special Characters and Data Delimiters


> (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.


/ (slash)

The slash character (/) can be used optionally to separate p-field entries.  For example:
p7 33.2/14/77/.4/.4/.4
Additionally, the slash acts as a shortcut for repeating entries. The above example could be more efficiently entered as:
p7 33.2/14/77/.4///
N.B. The first slash is a separator and the second two denote repetitions of the ".4".


x (lower case "x")

If you want to include an entry a specific number of times, the "x" character is a shortcut for this.  For example:
p7 33.2/14/77/.4x3
will repeat the ".4" three times.


, (comma)

The comma can be used for those who like to separate things with commas. nGen will simply ignore commas when used (with the exception of the rhythmic input mode (rh) where commas denote ties).  For example:
p7 33.2,14,77,.4x3


<> (Data Queue)

nGen contains a special feature called the Data Queue. The data queue is simply a circular memory storage area that is available within each p-field.  After initial execution of the p-field, the contents of the data queue are added to the end of the p-field data and looped until the end of the note-list.  By default, if there is remaining time in the note list and the program has run out of p-field values, nGen will repeat the last value in a p-field until the end of the note list.

Looping a P-Field

In some circumstances, it may be desirable to loop an entire p-field until the end of the note list.  In this case you can put the entire p-field in the data queue.  Here's an example that loops an entire p-field:
i1 = 3 0 4 { p2 rh <8/16/16> p3 1 }  
  ; yes, you can format like this too!

N.B. A shortcut when looping an entire p-field is to just include the first "<" like this:

i1 = 3 0 4 { p2 rh <8/16/16 p3 1 }  
  

Here's the output:

i1   0.0000  0.500 
i1   0.5000  0.250 
i1   0.7500  0.250 
i1   1.0000  0.500 
i1   1.5000  0.250 
i1   1.7500  0.250 
i1   2.0000  0.500 
i1   2.5000  0.250 
i1   2.7500  0.250 
i1   3.0000  0.500 
i1   3.5000  0.250 
i1   3.7500  0.250 
e

The data queue may also be added to in an accruing fashion.  For example:

i1 = 3 0 -12 { p2 rh 8/<16>/16/<8/4>/1 p3 1 }
  

In this example, the queue is added to in two separate places.  Since only six events have been given and 12 will occur in the resulting note list, the data queue is called on to provided the "extra" material.

N.B. The data queue is a memory loop. In this case the loop is: ||16, 8, 4||.

i1   0.0000  0.500 
i1   0.5000  0.250 
i1   0.7500  0.250 
i1   1.0000  0.500 
i1   1.5000  1.000 
i1   2.5000  4.000 
i1   6.5000  0.250 ; starts the queue output here 
i1   6.7500  0.500 
i1   7.2500  1.000 
i1   8.2500  0.250 
i1   8.5000  0.500 
i1   9.0000  1.000 
e


The "z" Variable

Summary
The "z" variable is a shortcut notation for "the last thing generated". It can be used within any DDF or in normal input mode.

"Z" is particularly useful in DDFs. For example,


    p5 no ra(T*.3 1. [c2 ef6]) mo(T*.7 1. z c4)
    
will create a wide range of random pitches for 30% of the i-block duration. The "z" variable is then used to catch the last value generated (by RA, whatever it might be...) and will then move to middle C over 70% of the i-block duration.

The "z" variable, which can also be uppercase, is initialized to 0 at the start of the *i-block*. It always represents the last thing made and will even pull a value from the end of a previous p-field -- so be careful :).

N.B. If you are using random deviation (rd) it will be applied to the "z" variable. For example, if you had:


        p7 rd(.5) 4 z
    
the z would stand for "4" and would be altered by RD before being stored in the note-list.