diff options
author | Wohlstand <admin@wohlnet.ru> | 2017-11-05 00:59:28 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2017-11-05 00:59:28 +0300 |
commit | 7552aa5b8d496ab7215f8330e1f84decf441ed99 (patch) | |
tree | 69407c1b4a0c697c8a91f6b2e6926ee7cf70804a /src/adlmidi_midiplay.cpp | |
parent | 266667cb34ee3e31ed439afc72444a08ef8cf721 (diff) | |
download | libADLMIDI-7552aa5b8d496ab7215f8330e1f84decf441ed99.tar.gz libADLMIDI-7552aa5b8d496ab7215f8330e1f84decf441ed99.tar.bz2 libADLMIDI-7552aa5b8d496ab7215f8330e1f84decf441ed99.zip |
Use longer minimal real time delay in the drum note length fixer
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r-- | src/adlmidi_midiplay.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 49195df..5c663c3 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -483,8 +483,9 @@ bool MIDIplay::buildTrackData() /********************************************************************************/ #if 1 //Use this to record WAVEs for comparison before/after implementing of this { - //#define DRUM_NOTE_MIN_TIME 0.0085 - #define DRUM_NOTE_MIN_TIME 0.0085 + //! Minimal real time in seconds + #define DRUM_NOTE_MIN_TIME 0.03 + //! Minimal ticks count #define DRUM_NOTE_MIN_TICKS 15 struct NoteState { @@ -504,6 +505,7 @@ bool MIDIplay::buildTrackData() for(MidiTrackQueue::iterator it = track.begin(); it != track.end(); it++) { MidiTrackRow &pos = *it; + for(ssize_t e = 0; e < (ssize_t)pos.events.size(); e++) { MidiEvent *et = &pos.events[(size_t)e]; @@ -518,12 +520,6 @@ bool MIDIplay::buildTrackData() { uint8_t note = et->data[0] & 0x7F; NoteState &ns = drNotes[note]; - //if(ns.isOn)//already on? add NoteOff into the tail! - //{ - // MidiEvent shutUp = *et; - // shutUp.type = MidiEvent::T_NOTEOFF; - // pos.events.push_back(shutUp); - //} ns.isOn = true; ns.delay = 0.0; ns.delayTicks = 0; @@ -575,6 +571,7 @@ bool MIDIplay::buildTrackData() } } #undef DRUM_NOTE_MIN_TIME + #undef DRUM_NOTE_MIN_TICKS } #endif |