instr 1 midinoteoncps p5, p4 ; Converts MIDI note-on and velocity to ; frequency and amplitude values. ; Assigns xcps to p5, xamp to p4. ; The x prefix indicates that the data ; can be used at either audio or control rate. kamp = p4*10 kfreq = p5 ifn = 1 kenv madsr 0.5, 0.8, 0.8, 0.5 ; Ready for realtime ! aosc oscil kamp*kenv,kfreq,ifn asig = aosc outs asig, asig-1 endin