' *** MIDIRCRD.LST *** 2nd GFA-Manual, page 12-2 > PROCEDURE midi_record(VAR last.byte%,midi.byte|(),midi.time%()) ' ' *** Record Midi-music: notes in byte-array, time in integer-array ' *** Both arrays must have been DIMensioned already! ' *** Byte 254 will be ignored ' *** Index of last Midi-byte is returned in last.byte% ' *** Play recorded music with Procedure Midi_play ' LOCAL last%,buffer$,i%,t%,time%,byte|,begin%,j%,m$,k,channel ARRAYFILL midi.byte|(),0 ARRAYFILL midi.time%(),0 last%=DIM?(midi.byte|())-1 m$=STR$(last%)+" bytes available| | = stop recording" ALERT 3,m$,1,"Start",k {ADD(XBIOS(14,1),6)}=0 ! clear keyboard-buffer buffer$=INPMID$ ! clear MIDI-buffer i%=1 t%=TIMER REPEAT IF INP?(3) byte|=INP(3) IF byte|<>254 time%=SUB(TIMER,t%) midi.byte|(i%)=byte| midi.time%(i%)=time% INC i% ENDIF ENDIF UNTIL i%=last% OR INKEY$=" " last.byte%=i%-1 FOR channel=0 TO 15 ! everything off OUT 3,&HB0+channel,123,0 OUT 3,&HB0+channel,64,0 OUT 3,&HB0+channel,1,0 OUT 3,&HE0+channel,0,0 NEXT channel begin%=midi.time%(1) ! subtract pause at begin FOR j%=1 TO i% SUB midi.time%(j%),begin% NEXT j% m$="|"+STR$(i%)+" bytes recorded" ALERT 3,m$,1," OK ",k RETURN ' ********* '