event Instrument Control:Invocation event event Generates a score event from an instrument. Description Generates a score event from an instrument. Syntax event "scorechar", kinsnum, kdelay, kdur, [, kp4] [, kp5] [, ...] event "scorechar", "insname", kdelay, kdur, [, kp4] [, kp5] [, ...] Initialization scorechar -- A string (in double-quotes) representing the first p-field in a score statement. This is usually e, f, or i. insname -- A string (in double-quotes) representing a named instrument. Performance kinsnum -- The instrument to use for the event. This corresponds to the first p-field, p1, in a score statement. kdelay -- When (in seconds) the event will occur from the current performance time. This corresponds to the second p-field, p2, in a score statement. kdur -- How long (in seconds) the event will happen. This corresponds to the third p-field, p3, in a score statement. kp4, kp5, ... (optional) -- Parameters representing additional p-field in a score statement. It starts with the fourth p-field, p4. Note that the event opcode cannot accept string p-fields. If you need to pass strings when instantiating an instrument, use the scoreline or scoreline_i opcode. Examples Here is an example of the event opcode. It uses the file event.csd. Example of the event opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. Here is an example of the event opcode using a named instrument. It uses the file event_named.csd. Example of the event opcode using a named instrument. See also Instrument Invocation Credits Examples written by &namekevin;. New in version 4.17 Thanks goes to Matt Ingalls for helping to fix the example. Thanks goes to Matt Ingalls for helping clarify the kwhen/kdelay parameter.