31 |
|
|
32 |
err = MIDIClientCreate(CFSTR("LinuxSampler"), NotifyProc, NULL, &hCoreMidiClient); |
err = MIDIClientCreate(CFSTR("LinuxSampler"), NotifyProc, NULL, &hCoreMidiClient); |
33 |
if (!hCoreMidiClient) { |
if (!hCoreMidiClient) { |
34 |
fprintf(stderr, "Can not open CoreMidi client\n"); |
fprintf(stderr, "Cannot open CoreMidi client\n"); |
35 |
goto error; |
goto error; |
36 |
} |
} |
37 |
|
|
38 |
err = MIDIInputPortCreate(hCoreMidiClient, CFSTR("Input port"), ReadProc, this, &hCoreMidiInPort); |
err = MIDIInputPortCreate(hCoreMidiClient, CFSTR("Input port"), ReadProc, this, &hCoreMidiInPort); |
39 |
if (!hCoreMidiInPort) { |
if (!hCoreMidiInPort) { |
40 |
fprintf(stderr, "Can not open Midi in por\n"); |
fprintf(stderr, "Cannot open Midi in port\n"); |
41 |
goto error; |
goto error; |
42 |
} |
} |
43 |
|
|
114 |
break; |
break; |
115 |
|
|
116 |
case 0x90: |
case 0x90: |
117 |
if (packet->data[1] < 128) |
if (packet->data[1] < 128){ |
118 |
driver->DispatchNoteOn(packet->data[1],packet->data[2], packet->data[0]&0x0F); |
if (packet->data[2] > 0){ |
119 |
|
driver->DispatchNoteOn(packet->data[1],packet->data[2], packet->data[0]&0x0F); |
120 |
|
}else{ |
121 |
|
driver->DispatchNoteOff(packet->data[1],packet->data[2],packet->data[0]&0x0F); |
122 |
|
} |
123 |
|
} |
124 |
break; |
break; |
125 |
|
|
126 |
case 0x80: |
case 0x80: |
127 |
if (packet->data[1] < 128) |
if (packet->data[1] < 128){ |
128 |
driver->DispatchNoteOff(packet->data[1],packet->data[2],packet->data[0]&0x0F); |
driver->DispatchNoteOff(packet->data[1],packet->data[2],packet->data[0]&0x0F); |
129 |
|
} |
130 |
break; |
break; |
131 |
} |
} |
132 |
|
|