P-Fields

The body of an i-block contains a list of p-field data.  Unlike Csound, nGen parses each p-field in its entirety before going on to the next p-field (Csound parses each event at a time -- each event contains a single instance of all p-fields).  Each i-block must contain P2 (start times) and P3 (durations).  The list of p-fields can be in any order as long as P2 is defined first.  (Usually it is clearer to list them in numerical order since that's how they will be printed to the Csound score file.  However, if you are using the EX [p-field extraction] command you may need to specify them in a different order).

P2 (Start Time) REQUIRED

Parameter 2 lists start times for all events in the current i-block.  This is a bit different from Csound.  For example:
i1 = 2 0 -4 {
p2 1, .5, 2, 3      ;start times
p3 1                ;duration codes
}

This i-block will start at beat 0 and make 4 events; however, p2 lists the start time intervals, not the literal start times.  The following start times would be created from the above example:

0    (default start time)
1    (after an interval of 1 beat)
1.5  (after an interval of .5 beat)
3.5  (after an interval of 2 beats)
     (the 5th event would now start at 6.5)

Rests and Silence

If you would like to create some silence (or a rest), you can specify a negative interval (e.g. p2 1, -.5, 2).  nGen will then flag the event as a rest and it will be pruned from the note list on printout.

P3 (Duration) REQUIRED

The duration parameter (P3) has some special features.  Like Score11, nGen uses p3 to specify the duration of an event through special "code" values (Brinkman calls this the "duty factor").  When calculating P3, nGen works in two passes.  On the first pass, all events are assigned a default P3 value of the full interval between the initiation of the event to the next event.  For example:
p2 1, .5, 2
would create three events starting at beat 0, 1, and 1.5.  The default P3 values would be initialized as 1, .5, and 2.  The P3 field, however, is used to specify the treatment of the temporal interval (default duration). Two basic operations can be implemented with P3: a scaling of the default temporal duration, and an override of the temporal duration with a literal value.  The following codes are possible:

nGen's P3 Codes
P3 Code Function
0-199.999 When P3 is in this range, the duration of the event is multiplied by the given scaling factor (e.g., 1 leaves all durations as continuing until the start of the next event -- i.e., 100% scaling, .5 will make all duration last 50% of the time between both events.)  To make events legato, consider setting P3 to 1.05...
200-299.999 Adds a constant amount, x - 200,  to the temporal interval (default duration).  For example, if x is 200.1, the duration will be the temporal interval between two events plus .1.
300-399.999 Subtracts a constant amount, x - 300,  from the temporal interval (default duration).  For example, if x is 300.1, the duration will be the temporal interval between two events minus .1. If the value negates the length of the temporal interval, the event turns into a rest (in this case a warning message is printed).
400-999.999 Force x - 400 to be the literal value of the duration in beats (at current tempo).
1000+ Force x - 1000 to be the literal value of the duration in seconds.