summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2013-05-12 17:49:40 +0000
committerRobert Jonsson <spamatica@gmail.com>2013-05-12 17:49:40 +0000
commita4b19f67d039c20369c44ca81845cd4b9eda4878 (patch)
treea8f40cede3f40f5673dede44238933d2b05b4d9e
parent9f953d39bb81a6817d3d5c52a6f6569924553b95 (diff)
fixed drum playback in new drum editor
-rw-r--r--muse2/ChangeLog3
-rw-r--r--muse2/muse/midiedit/dcanvas.cpp11
2 files changed, 13 insertions, 1 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index bff1dfde..c49ae072 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,6 @@
+12.05.2013:
+ - Fixed bug with playback of drums clicking on notes in the new drum editor,
+ it was playing the wrong instrument (rj)
08.05.2013:
- Yet another MAJOR audio engine and plugin/synth process chain re-write. (Tim...)
- Track controllers (vol, pan) now sample-accurate.
diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp
index 734871ef..ebe3a6c8 100644
--- a/muse2/muse/midiedit/dcanvas.cpp
+++ b/muse2/muse/midiedit/dcanvas.cpp
@@ -209,7 +209,7 @@ bool DrumCanvas::index2Note(int index, int* port, int* channel, int* note)
*channel = ch;
if(note)
*note = old_style_drummap_mode ? ourDrumMap[index].anote : instrument_map[index].pitch;
-
+
return true;
}
@@ -576,6 +576,15 @@ void DrumCanvas::itemPressed(const MusEGui::CItem* item)
MusECore::Event e = ((DEvent*)item)->event();
int index = e.pitch();
// play note:
+
+ if (!old_style_drummap_mode) {
+ for (int i = 0; i < instrument_map.size(); ++i) {
+ if (instrument_map.at(i).pitch == index) {
+ index = i;
+ break;
+ }
+ }
+ }
int pitch, port, channel;
if(index2Note(index, &port, &channel, &pitch))
startPlayEvent(pitch, e.velo(), port, channel);