Creating MIDI Files:
MIDI output can be a useful feature -- it can be used to preview the basic
timing and contour of a complex pitch-based SSL instrument (e.g., Csound)
or to create control values for use with real-time applications. MIDI output
is also useful for algorithmic composers who may wish to convert their
output into some form of music notation with programs such as Finale,
or Sibelius. These files will work with Quicktime and Windows Media Player.
You can make a MIDI file by using the "-m" option, for example:
ngen -m filename.gen filename.mid
When creating MIDI files, nGen will ignore all p-fields
after P5. Direct output statements (>) and output converters
(IN, RE, OP, HZ, etc.) will be ignored. Additionally, the following
syntax must ALWAYS be used:
-
p2 = start times
-
p3 = duration
-
p4 = amplitude (0-32767): this parameter is always scaled to 0-127 (So
you can use the "db" input filter if you wish).
Make sure that you don't
enter midi velocity values (0-127) but, rather, use Csound's default amplitude values (0-32767).
-
p5 = pitch: The actual values are always converted to 0-127 through
a "modulo 128" function. Internally pitches are stored as C4 = 48
(this is what happens when you use the NO, NOX, OP, and OPX, input modes),
all numbers in p5 are added to 12 to get the proper MIDI note-codes. If
you are entering pitch directly as internal code (there is no real reason
to do so, but you can), use 48 as C0 (MIDI codes are adjusted post-process).
Currently, MIDI files will only contain the first i-block in the
input file.