Fix for initial velocity.
This commit is contained in:
parent
b077a392fa
commit
fbe1e29a5d
1 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ PROGRAMME FUNCTION: EVI Wind Controller using the Freescale MP3V5004GP breath
|
||||||
|
|
||||||
// Compile options, comment/uncomment to change
|
// Compile options, comment/uncomment to change
|
||||||
|
|
||||||
//#define REVB
|
#define REVB
|
||||||
|
|
||||||
|
|
||||||
// Pin definitions
|
// Pin definitions
|
||||||
|
@ -625,13 +625,13 @@ void loop() {
|
||||||
// Yes, so calculate MIDI note and velocity, then send a note on event
|
// Yes, so calculate MIDI note and velocity, then send a note on event
|
||||||
readSwitches();
|
readSwitches();
|
||||||
// We should be at tonguing peak, so set velocity based on current pressureSensor value unless fixed velocity is set
|
// We should be at tonguing peak, so set velocity based on current pressureSensor value unless fixed velocity is set
|
||||||
|
breathLevel=constrain(max(pressureSensor,initial_breath_value),breathThrVal,breathMaxVal);
|
||||||
if (!velocity) {
|
if (!velocity) {
|
||||||
unsigned int breathValHires = breathCurve(map(constrain(breathLevel,breathThrVal,breathMaxVal),breathThrVal,breathMaxVal,0,16383));
|
unsigned int breathValHires = breathCurve(map(constrain(breathLevel,breathThrVal,breathMaxVal),breathThrVal,breathMaxVal,0,16383));
|
||||||
velocitySend = (breathValHires >>7) & 0x007F;
|
velocitySend = (breathValHires >>7) & 0x007F;
|
||||||
velocitySend = constrain(velocitySend,1,127);
|
velocitySend = constrain(velocitySend,1,127);
|
||||||
//velocitySend = map(constrain(max(pressureSensor,initial_breath_value),breathThrVal,breathMaxVal),breathThrVal,breathMaxVal,1,127);
|
//velocitySend = map(constrain(max(pressureSensor,initial_breath_value),breathThrVal,breathMaxVal),breathThrVal,breathMaxVal,1,127);
|
||||||
} else velocitySend = velocity;
|
} else velocitySend = velocity;
|
||||||
breathLevel=constrain(max(pressureSensor,initial_breath_value),breathThrVal,breathMaxVal);
|
|
||||||
breath(); // send breath data
|
breath(); // send breath data
|
||||||
fingeredNote=noteValueCheck(fingeredNote);
|
fingeredNote=noteValueCheck(fingeredNote);
|
||||||
usbMIDI.sendNoteOn(fingeredNote, velocitySend, activeMIDIchannel); // send Note On message for new note
|
usbMIDI.sendNoteOn(fingeredNote, velocitySend, activeMIDIchannel); // send Note On message for new note
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue