From ae6b5d89ea93b95c2990895077cf5e8f0bba9ad9 Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Mon, 2 Feb 2004 11:28:02 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r1301, which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=1302 --- pd/portmidi_osx/pmtest.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'pd/portmidi_osx/pmtest.c') diff --git a/pd/portmidi_osx/pmtest.c b/pd/portmidi_osx/pmtest.c index 5628d25e..6e590fd5 100644 --- a/pd/portmidi_osx/pmtest.c +++ b/pd/portmidi_osx/pmtest.c @@ -25,11 +25,12 @@ main() int statusprefix; - + Pm_Initialize(); // xjs + /* always start the timer before you start midi */ Pt_Start(1, 0, 0); /* start a timer with millisecond accuracy */ - + printf("%d midi ports found...\n", Pm_CountDevices()); // xjs for (i = 0; i < Pm_CountDevices(); i++) { const PmDeviceInfo *info = Pm_GetDeviceInfo(i); printf("%d: %s, %s", i, info->interf, info->name); @@ -86,6 +87,7 @@ main() gets(line); } + printf("delay %d, tranpose %d\n", delay, transpose); // xjs /* loop, echoing input back transposed with multiple taps */ @@ -111,7 +113,7 @@ main() printf("\nReceived key message = %X %X %X, at time %ld\n", status, data1, data2, buffer[0].timestamp); fflush(stdout); - /* immediately send the echoes to PortMIDI */ + /* immediately send the echoes to PortMIDI (note that only the echoes are to be transposed) */ for (i = 1; i < NUM_ECHOES; i++) { buffer[i].message = Pm_Message(status, data1 + transpose, data2 >> i); buffer[i].timestamp = buffer[0].timestamp + (i * delay); @@ -122,12 +124,16 @@ main() printf("Key C2 pressed. Exiting...\n"); fflush(stdout); + Pt_Stop(); // xjs + /* Give the echoes time to finish before quitting. */ sleep(((NUM_ECHOES * delay) / 1000) + 1); Pm_Close(midi_in); Pm_Close(midi_out); + Pm_Terminate(); // xjs + printf("Done.\n"); return 0; } -- cgit v1.2.1