/********************************************************************* * * record 01 Aug 88 Copyright (c) 1988 cMIDI * * cMIDI function library demonstration. File 7 of 20. * *********************************************************************/ #include #include main( int argc, char *argv[] ) { int page; /* Read command line. */ if (argc < 2) { printf("Must specify file for storing recorded track data.\n"); exit(1); } /* Open cmidi. */ CmidiOpen(); printf("\nWait... "); putch(13); /* Prepare to record. */ MpuSwitch(MPU_X_MIDI_BENDER_TO_PC_ON); TrackPtrRegister( 1, TRACK_PTR_RECORD ); /* Start recording track. */ printf("Start recording. Hit any key when finished. "); putch(13); TrackRecord(); /* Until any key entered */ while (!kbhit()); getch(); /* Stop recording, write track to file, then close cmidi. */ TrackStop(); TrackWriteCmidiData( argv[1], 1 ); CmidiClose( CLOSE_PRINT_ERRORS | CLOSE_RESET_MPU ); printf("Track is recorded in %s. ",argv[1]); }