summaryrefslogtreecommitdiff
path: root/muse2/muse/midi.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-10-09 16:02:35 +0000
committerFlorian Jung <flo@windfisch.org>2011-10-09 16:02:35 +0000
commit9a4a4ee6fd5c2a73216240da912f7273aacaa11e (patch)
tree9f7b2aa792d292d45d0bc670a47e4d4329b92f6d /muse2/muse/midi.cpp
parent159a2b58fd28c7a00b9b723dcea77e6c2ec2e874 (diff)
recording and importing midi now works for new style drum tracks plus
fixes for old-style drum tracks
Diffstat (limited to 'muse2/muse/midi.cpp')
-rw-r--r--muse2/muse/midi.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/muse2/muse/midi.cpp b/muse2/muse/midi.cpp
index 65bccc70..0138f1d8 100644
--- a/muse2/muse/midi.cpp
+++ b/muse2/muse/midi.cpp
@@ -262,9 +262,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
e.setPitch(instr);
}
else
- {
e.setPitch(ev.dataA());
- }
e.setVelo(ev.dataB());
e.setLenTick(0);
@@ -277,6 +275,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
}
else
e.setPitch(ev.dataA());
+
e.setVelo(0);
e.setVeloOff(ev.dataB());
e.setLenTick(0);
@@ -751,19 +750,15 @@ void Audio::collectEvents(MusECore::MidiTrack* track, unsigned int cts, unsigned
int pitch = ev.pitch();
int velo = ev.velo();
if (track->type() == Track::DRUM) {
- //
// Map drum-notes to the drum-map values
- //
int instr = ev.pitch();
pitch = MusEGlobal::drumMap[instr].anote;
port = MusEGlobal::drumMap[instr].port; //This changes to non-default port
channel = MusEGlobal::drumMap[instr].channel;
velo = int(double(velo) * (double(MusEGlobal::drumMap[instr].vol) / 100.0)) ;
}
- else { //FINDMICHJETZT don't transpose for new style drum tracks
- //
+ else if (track->type() != Track::NEW_DRUM) {
// transpose non drum notes
- //
pitch += (track->transposition + MusEGlobal::song->globalPitchShift());
}
@@ -985,7 +980,7 @@ void Audio::processMidi()
//
//Apply drum inkey:
- if (track->type() == Track::DRUM) //FINDMICHJETZT schwierig...
+ if (track->type() == Track::DRUM) //FINDMICHJETZT does this work?
{
int pitch = event.dataA();
//Map note that is played according to MusEGlobal::drumInmap
@@ -996,7 +991,11 @@ void Audio::processMidi()
event.setA(MusEGlobal::drumMap[(unsigned int)MusEGlobal::drumInmap[pitch]].anote);
event.setChannel(channel);
}
- else
+ else if (track->type() == Track::NEW_DRUM)
+ {
+ event.setA(track->map_drum_in(event.dataA()));
+ }
+ else
{ //Track transpose if non-drum
prePitch = event.dataA();
int pitch = prePitch + track->transposition;