Skip to content

Commit

Permalink
Fixed a bug in MIDIdrum caused by an AWOL constrain function.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshnishikawa committed Mar 30, 2021
1 parent 800bc27 commit 2f1c9d3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MIDIcontroller 2.3.4
# MIDIcontroller 2.4.0
### A library for creating Teensy MIDI controllers.
###### by Josh Nishikawa <github.com/joshnishikawa/MIDIcontroller>

Expand All @@ -16,6 +16,10 @@ ___
___

### VERSION LOG:
2.4.0
- The .4. is for the added inputRange() and setWaitTime() functions
- This update also (actually) fixes that MIDIdrum bug preventing high velocity

2.3.4
- Added inputRange() to MIDIdrum.
- Added an example for muxed input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ void setup(){
for(int i=0; i<8; i++){ // change to i<16 if using MUX-16
Pots[i] = new MIDIpot(mux_input_pin, 12+i);
// CC 12~ are probably safe to use but you can use any CC number you like.

Pots[i]->inputRange(15, 1000); // helps reach the full output range
}
}

Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=MIDIcontroller
version=2.3.4
version=2.4.0
author=Josh Nishikawa <joshnishikawa@gmail.com>
maintainer=Josh Nishikawa <joshnishikawa@gmail.com>
sentence=A library for creating Teensy MIDI controllers.
paragraph=Includes easy to follow examples for implementing velocity sensitive FSR, Piezo or Capacitive Touch inputs; momentary, latch or 'trigger' type MIDI buttons (also works with Cap Touch); stable analog to MIDI conversion for potentiometers and other sensors; stable Capacitive Touch to MIDI conversion for expression control; support for encoders; Min/Max output can be set (or inverted) for all MIDI; Min/Max input can also be set for analog input (maintaining stability in conversion)
paragraph=Includes easy to follow examples for implementing velocity sensitive FSR, Piezo or Capacitive Touch inputs - momentary, latch or trigger type MIDI buttons (also works with Cap Touch) - stable analog to MIDI conversion for potentiometers and other sensors - stable Capacitive Touch to MIDI conversion for expression control - support for encoders - Min/Max output can be set (or inverted) for all MIDI - Min/Max input can also be set for analog input (maintaining stability in conversion)
category=Sensors
url=https://github.com/joshnishikawa/MIDIcontroller
architectures=avr
Expand Down
1 change: 1 addition & 0 deletions src/MIDIdrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ int MIDIdrum::read(){
newValue = -1;
}
else if (timer >= 10){
newValue = constrain(peak, threshold, inHi);
newValue = newValue >= inHi ? outHi : map(peak,threshold,inHi,outLo,outHi);
state = 2;
timer = 0;
Expand Down

0 comments on commit 2f1c9d3

Please sign in to comment.