GUI: kinda working MIDI note input

This commit is contained in:
tildearrow 2022-03-30 18:18:39 -05:00
parent 501ecc063d
commit a8ee4b1245
1 changed files with 7 additions and 7 deletions

View File

@ -782,7 +782,6 @@ void FurnaceGUI::noteInput(int num, int key) {
} }
if (latchEffect!=-1) pat->data[cursor.y][4]=latchEffect; if (latchEffect!=-1) pat->data[cursor.y][4]=latchEffect;
if (latchEffectVal!=-1) pat->data[cursor.y][5]=latchEffectVal; if (latchEffectVal!=-1) pat->data[cursor.y][5]=latchEffectVal;
previewNote(cursor.xCoarse,num);
} }
makeUndo(GUI_UNDO_PATTERN_EDIT); makeUndo(GUI_UNDO_PATTERN_EDIT);
editAdvance(); editAdvance();
@ -854,10 +853,9 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
if (edit) { if (edit) {
noteInput(num,key); noteInput(num,key);
} else { }
if (key!=100 && key!=101 && key!=102) { if (key!=100 && key!=101 && key!=102) {
previewNote(cursor.xCoarse,num); previewNote(cursor.xCoarse,num);
}
} }
} catch (std::out_of_range& e) { } catch (std::out_of_range& e) {
} }
@ -1917,8 +1915,10 @@ bool FurnaceGUI::loop() {
doAction(action); doAction(action);
} else switch (msg.type&0xf0) { } else switch (msg.type&0xf0) {
case TA_MIDI_NOTE_ON: case TA_MIDI_NOTE_ON:
noteInput(msg.data[0],0); if (edit && msg.data[1]!=0) {
// TODO volume input noteInput(msg.data[0]-12,0);
// TODO volume input
}
break; break;
case TA_MIDI_PROGRAM: case TA_MIDI_PROGRAM:
if (midiMap.programChange) { if (midiMap.programChange) {