Removed 2nd breath CC filter
This commit is contained in:
parent
d0aff0c220
commit
a0deec24eb
1 changed files with 13 additions and 12 deletions
|
|
@ -89,7 +89,6 @@ const int rollerHarmonic[2][7] = { {0, 7, 12, 16, 19, 24, 26}, // F horn 2,3,4
|
||||||
const int trumpetHarmonic[2][7] = { {0, 7, 12, 16, 19, 26, 31}, //! K4: hrm 8->9, 10->12
|
const int trumpetHarmonic[2][7] = { {0, 7, 12, 16, 19, 26, 31}, //! K4: hrm 8->9, 10->12
|
||||||
{0, 7, 12, 16, 19, 24, 28} }; // trumpet 2,3,4,5,6,8,10 hrm
|
{0, 7, 12, 16, 19, 24, 28} }; // trumpet 2,3,4,5,6,8,10 hrm
|
||||||
|
|
||||||
FilterOnePole breathCCFilter;
|
|
||||||
FilterOnePole breathBaselineFilter;
|
FilterOnePole breathBaselineFilter;
|
||||||
|
|
||||||
//_______________________________________________________________________________________________ SETUP
|
//_______________________________________________________________________________________________ SETUP
|
||||||
|
|
@ -233,7 +232,6 @@ int breath() {
|
||||||
} else {
|
} else {
|
||||||
breathCCvalHires = -breathCurve(mapConstrain(-diff, calibration.breathThrValOffset, calibration.breathMaxValOffset, 0, 16383));
|
breathCCvalHires = -breathCurve(mapConstrain(-diff, calibration.breathThrValOffset, calibration.breathMaxValOffset, 0, 16383));
|
||||||
}
|
}
|
||||||
// breathCCvalHires = breathCCFilter.input(breathCCvalHires);
|
|
||||||
if (instrument.mode == MODE_DEBUG) {
|
if (instrument.mode == MODE_DEBUG) {
|
||||||
Serial.print(">accdelta:");
|
Serial.print(">accdelta:");
|
||||||
Serial.println(breathCCvalHires);
|
Serial.println(breathCCvalHires);
|
||||||
|
|
@ -244,7 +242,7 @@ int breath() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
breathCCvalHires = breathCurve(mapConstrain(instrument.breathSignal, instrument.breathBaseline, instrument.breathMaxVal, 0, 16383));
|
breathCCvalHires = breathCurve(mapConstrain(instrument.breathSignal, instrument.breathBaseline, instrument.breathMaxVal, 0, 16383));
|
||||||
breathCCvalHires = breathCCFilter.input(breathCCvalHires);
|
// breathCCvalHires = breathCCFilter.input(breathCCvalHires);
|
||||||
}
|
}
|
||||||
|
|
||||||
breathCCval = (breathCCvalHires >> 7) & 0x007F;
|
breathCCval = (breathCCvalHires >> 7) & 0x007F;
|
||||||
|
|
@ -810,6 +808,10 @@ uint8_t breathVel() {
|
||||||
unsigned int breathValHires = breathCurve(mapConstrain(instrument.breathSignal, instrument.breathBaseline, instrument.breathMaxVal, 0, 16383));
|
unsigned int breathValHires = breathCurve(mapConstrain(instrument.breathSignal, instrument.breathBaseline, instrument.breathMaxVal, 0, 16383));
|
||||||
velocitySend = (breathValHires >> 7) & 0x007F;
|
velocitySend = (breathValHires >> 7) & 0x007F;
|
||||||
velocitySend = constrain(velocitySend + velocitySend * .1 * state.currentPreset->velBias, 1, 127);
|
velocitySend = constrain(velocitySend + velocitySend * .1 * state.currentPreset->velBias, 1, 127);
|
||||||
|
if (instrument.mode == MODE_DEBUG) {
|
||||||
|
Serial.print(">velocity:");
|
||||||
|
Serial.println(velocitySend);
|
||||||
|
}
|
||||||
|
|
||||||
return velocitySend;
|
return velocitySend;
|
||||||
}
|
}
|
||||||
|
|
@ -876,7 +878,6 @@ void initState() {
|
||||||
|
|
||||||
instrument.activeMIDIchannel = state.currentPreset->MIDIchannel;
|
instrument.activeMIDIchannel = state.currentPreset->MIDIchannel;
|
||||||
midiInitialize(state.currentPreset->MIDIchannel);
|
midiInitialize(state.currentPreset->MIDIchannel);
|
||||||
breathCCFilter.setFilter(LOWPASS, 3, 0.0);
|
|
||||||
breathBaselineFilter.setFilter(LOWPASS, 1, 0.0);
|
breathBaselineFilter.setFilter(LOWPASS, 1, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1007,14 +1008,14 @@ void runStateMachine() {
|
||||||
if ((lever_trigger ? instrument.leverVal > 0 : instrument.breathSignal > instrument.breathMovingThrVal)) {
|
if ((lever_trigger ? instrument.leverVal > 0 : instrument.breathSignal > instrument.breathMovingThrVal)) {
|
||||||
// Has enough time passed for us to collect our second sample?
|
// Has enough time passed for us to collect our second sample?
|
||||||
if ((millis() - breath_on_time > state.currentPreset->velSmpDl) || (0 == state.currentPreset->velSmpDl) || state.currentPreset->fixedVelocity) {
|
if ((millis() - breath_on_time > state.currentPreset->velSmpDl) || (0 == state.currentPreset->velSmpDl) || state.currentPreset->fixedVelocity) {
|
||||||
noteOn(instrument.fingeredNote);
|
breath(); // send breath data
|
||||||
if (instrument.fingeredNote != instrument.fingeredNote2) {
|
noteOn(instrument.fingeredNote);
|
||||||
noteOn(instrument.fingeredNote2);
|
if (instrument.fingeredNote != instrument.fingeredNote2) {
|
||||||
}
|
noteOn(instrument.fingeredNote2);
|
||||||
breath(); // send breath data
|
}
|
||||||
state.mainState = NOTE_ON;
|
state.mainState = NOTE_ON;
|
||||||
instrument.activeNote = instrument.fingeredNote;
|
instrument.activeNote = instrument.fingeredNote;
|
||||||
instrument.activeNote2 = instrument.fingeredNote2;
|
instrument.activeNote2 = instrument.fingeredNote2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Value fell below threshold before velocity sample delay time passed. Return to NOTE_OFF state
|
// Value fell below threshold before velocity sample delay time passed. Return to NOTE_OFF state
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue