summaryrefslogtreecommitdiff
path: root/muse2/muse/ctrl
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-11-12 04:49:31 +0000
committerTim E. Real <termtech@rogers.com>2012-11-12 04:49:31 +0000
commitbe1005a6031861b91e1a2df33f62e1c5a0a2aeb6 (patch)
tree89152909549c7dd624f4748f394c3adbcbf65b86 /muse2/muse/ctrl
parent31f618e5461553bd7836677f944acfa233e5ae3c (diff)
Finished Aftertouch controllers
Feature: Piano KB / drum list show coloured dots when per-pitch controllers exist / have data.
Diffstat (limited to 'muse2/muse/ctrl')
-rw-r--r--muse2/muse/ctrl/ctrlcanvas.cpp33
-rw-r--r--muse2/muse/ctrl/ctrlpanel.cpp1
-rw-r--r--muse2/muse/ctrl/ctrlpanel.h1
3 files changed, 22 insertions, 13 deletions
diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp
index 6e92f3c6..0028d426 100644
--- a/muse2/muse/ctrl/ctrlcanvas.cpp
+++ b/muse2/muse/ctrl/ctrlcanvas.cpp
@@ -476,6 +476,7 @@ void CtrlCanvas::songChanged(MusECore::SongChangedFlags_t type)
//---------------------------------------------------------
// partControllers
+// num is the controller number, in 'MidiController terms' (lo-byte = 0xff for per-note controllers).
//---------------------------------------------------------
void CtrlCanvas::partControllers(const MusECore::MidiPart* part, int num, int* dnum, int* didx, MusECore::MidiController** mc, MusECore::MidiCtrlValList** mcvl)
@@ -510,20 +511,27 @@ void CtrlCanvas::partControllers(const MusECore::MidiPart* part, int num, int* d
MusECore::MidiPort* mp;
int di;
int n;
-
- if((mt->type() == MusECore::Track::DRUM) && (curDrumPitch >= 0) && ((num & 0xff) == 0xff))
- {
- di = (num & ~0xff) | curDrumPitch;
- n = (num & ~0xff) | MusEGlobal::drumMap[curDrumPitch].anote; // construct real controller number
- mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[curDrumPitch].port];
- }
- else if ((mt->type() == MusECore::Track::NEW_DRUM || mt->type() == MusECore::Track::MIDI) &&
- (curDrumPitch >= 0) && ((num & 0xff) == 0xff)) //FINDMICHJETZT does this work?
+
+ if((curDrumPitch >= 0) && ((num & 0xff) == 0xff))
{
di = (num & ~0xff) | curDrumPitch;
- n = (num & ~0xff) | curDrumPitch;
- mp = &MusEGlobal::midiPorts[mt->outPort()];
+ if((mt->type() == MusECore::Track::DRUM))
+ {
+ n = (num & ~0xff) | MusEGlobal::drumMap[curDrumPitch].anote;
+ mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[curDrumPitch].port];
+ }
+ if(mt->type() == MusECore::Track::NEW_DRUM)
+ {
+ n = di; // Simple one-to-one correspondence.
+ mp = &MusEGlobal::midiPorts[mt->outPort()];
+ }
+ else if(mt->type() == MusECore::Track::MIDI)
+ {
+ n = di; // Simple one-to-one correspondence. There is no 'mapping' for piano roll midi - yet.
+ mp = &MusEGlobal::midiPorts[mt->outPort()];
+ }
}
+
else
{
di = num;
@@ -611,7 +619,6 @@ void CtrlCanvas::updateItems()
{
if(curDrumPitch < 0)
continue;
-
int port = MusEGlobal::drumMap[ctl & 0x7f].port;
int chan = MusEGlobal::drumMap[ctl & 0x7f].channel;
int cur_port = MusEGlobal::drumMap[curDrumPitch].port;
@@ -2026,7 +2033,7 @@ void CtrlCanvas::setCurDrumPitch(int instrument)
// Crash protection by Tim.
// FIXME: Still, drum list is blank, editor can't edit. Other values of instrument or curDrumPitch just crash too.
// Seems only with drum tracks that were created by importing a midi file (then changed to use fluidsynth device?).
- if(instrument == -1) curDrumPitch = -1;
+ if(instrument == -1) curDrumPitch = -1;
else if (drumedit->get_instrument_map()[instrument].tracks.contains(curTrack))
curDrumPitch = drumedit->get_instrument_map()[instrument].pitch;
diff --git a/muse2/muse/ctrl/ctrlpanel.cpp b/muse2/muse/ctrl/ctrlpanel.cpp
index b4d089ff..84d155ea 100644
--- a/muse2/muse/ctrl/ctrlpanel.cpp
+++ b/muse2/muse/ctrl/ctrlpanel.cpp
@@ -3,6 +3,7 @@
// Linux Music Editor
// $Id: ctrlpanel.cpp,v 1.10.2.9 2009/06/14 05:24:45 terminator356 Exp $
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+// (C) Copyright 2012 Tim E. Real (terminator356 on users dot sourceforge dot net)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
diff --git a/muse2/muse/ctrl/ctrlpanel.h b/muse2/muse/ctrl/ctrlpanel.h
index 261f982f..a8c24c65 100644
--- a/muse2/muse/ctrl/ctrlpanel.h
+++ b/muse2/muse/ctrl/ctrlpanel.h
@@ -3,6 +3,7 @@
// Linux Music Editor
// $Id: ctrlpanel.h,v 1.2.2.5 2009/06/10 00:34:59 terminator356 Exp $
// (C) Copyright 1999-2001 Werner Schweer (ws@seh.de)
+// (C) Copyright 2012 Tim E. Real (terminator356 on users dot sourceforge dot net)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License