iscal -- i-time scaling factor
ifn (optional, default=0) -- function table number of a normalized translation table, by which the incoming value is first interpreted. The default value is 0, denoting no translation.
Get the velocity of the current MIDI event, optionally pass it through a normalized translation table, and return an amplitude value in the range 0 - iscal.
Here is an example of the ampmidi opcode. It uses the files ampmidi.orc and ampmidi.sco.
Example 1. Example of the ampmidi opcode.
/* ampmidi.orc */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
; Instrument #1.
instr 1
; Scale the amplitude between 0 and 1.
i1 ampmidi 1
print i1
endin
/* ampmidi.orc */
/* ampmidi.sco */
; Play Instrument #1 for 12 seconds.
i 1 0 12
e
/* ampmidi.sco */