summaryrefslogtreecommitdiff
path: root/muse2/muse/driver
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-10-22 06:54:39 +0000
committerTim E. Real <termtech@rogers.com>2012-10-22 06:54:39 +0000
commitb6cb5a7a97c4959ddd6ef4fabdf0ddf0b3604d1b (patch)
treecb957648f670b4f7697eddbe37adcda8b620fb6d /muse2/muse/driver
parentbb2ae55efec337e3b372937582dcd154fb36e9e9 (diff)
Fixed regression: Re-add default managed controllers to midi ports at Song::clear.
W.I.P. Preparations for Aftertouch and Poly Aftertouch graph editing.
Diffstat (limited to 'muse2/muse/driver')
-rw-r--r--muse2/muse/driver/alsamidi.cpp10
-rw-r--r--muse2/muse/driver/jackmidi.cpp9
2 files changed, 16 insertions, 3 deletions
diff --git a/muse2/muse/driver/alsamidi.cpp b/muse2/muse/driver/alsamidi.cpp
index d8b3a947..978cca98 100644
--- a/muse2/muse/driver/alsamidi.cpp
+++ b/muse2/muse/driver/alsamidi.cpp
@@ -386,7 +386,7 @@ bool MidiAlsaDevice::putMidiEvent(const MidiPlayEvent& e)
snd_seq_ev_set_pitchbend(&event, chn, a);
break;
case ME_POLYAFTER:
- // chnEvent2(chn, 0xa0, a, b);
+ snd_seq_ev_set_keypress(&event, chn, a, b);
break;
case ME_AFTERTOUCH:
snd_seq_ev_set_chanpress(&event, chn, a);
@@ -1278,7 +1278,6 @@ void alsaProcessMidiInput()
switch(ev->type)
{
case SND_SEQ_EVENT_NOTEON:
- case SND_SEQ_EVENT_KEYPRESS:
event.setChannel(ev->data.note.channel);
event.setType(ME_NOTEON);
event.setA(ev->data.note.note);
@@ -1292,6 +1291,13 @@ void alsaProcessMidiInput()
event.setB(ev->data.note.velocity);
break;
+ case SND_SEQ_EVENT_KEYPRESS:
+ event.setChannel(ev->data.note.channel);
+ event.setType(ME_POLYAFTER);
+ event.setA(ev->data.note.note);
+ event.setB(ev->data.note.velocity);
+ break;
+
case SND_SEQ_EVENT_CHANPRESS:
event.setChannel(ev->data.control.channel);
event.setType(ME_AFTERTOUCH);
diff --git a/muse2/muse/driver/jackmidi.cpp b/muse2/muse/driver/jackmidi.cpp
index 6b1506e1..a088290a 100644
--- a/muse2/muse/driver/jackmidi.cpp
+++ b/muse2/muse/driver/jackmidi.cpp
@@ -466,6 +466,7 @@ void MidiJackDevice::eventReceived(jack_midi_event_t* ev)
case ME_NOTEON:
case ME_NOTEOFF:
case ME_CONTROLLER:
+ case ME_POLYAFTER:
event.setA(*(ev->buffer + 1));
event.setB(*(ev->buffer + 2));
break;
@@ -845,7 +846,13 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
}
}
- if(a == CTRL_PITCH)
+ if(a == CTRL_AFTERTOUCH)
+ {
+ //printf("MidiJackDevice::processEvent CTRL_AFTERTOUCH v:%d time:%d type:%d ch:%d A:%d B:%d\n", v, event.time(), event.type(), event.channel(), event.dataA(), event.dataB());
+ if(!queueEvent(MidiPlayEvent(t, port, chn, ME_AFTERTOUCH, b & 0x7f, 0)))
+ return false;
+ }
+ else if(a == CTRL_PITCH)
{
int v = b + 8192;
//printf("MidiJackDevice::processEvent CTRL_PITCH v:%d time:%d type:%d ch:%d A:%d B:%d\n", v, event.time(), event.type(), event.channel(), event.dataA(), event.dataB());