-+rtmidi=null -M0 sr = 44100 ksmps = 8 nchnls = 2 0dbfs = 1 giSine ftgen 0, 0, 2^10, 10, 1 instr 1 iFreq cpsmidi ;gets frequency of a pressed key iAmp ampmidi 8;gets amplitude and scales 0-8 iRatio random .9, 1.1; ratio randomly between 0.9 and 1.1 aTone foscili .1, iFreq, 1, iRatio/5, iAmp+1, giSine; fm aEnv linenr aTone, 0, .01, .01; avoiding clicks at the end of a note outs aEnv, aEnv endin f 0 36000; play for 10 hours e ;example by joachim heintz