diff --git a/README b/README index b508538..4b4b958 100644 --- a/README +++ b/README @@ -104,8 +104,8 @@ remap= float= } - -*range: controller value from -8192 to 8192 that triggers command. Can enter an interval x:y or single value - > optional, default -8192:8192 +*range: controller value from -8192 to 8191 that triggers command. Can enter an interval x:y or single value + > optional, default -8192:8191 *remap: remaps the range to given interval. Interval can be inversed and float > optional, default same as range *float: boolean value defining if output is a floating point value diff --git a/example.mim b/example.mim index 2872c9a..01cfffd 100644 --- a/example.mim +++ b/example.mim @@ -29,7 +29,6 @@ id=42 channel=0 remap=-100:100 - float=true shell=echo "Knob #$id ch$channel:$value r:$rawvalue" }, { diff --git a/src/device.cpp b/src/device.cpp index 9e2354a..29ba719 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -96,7 +96,6 @@ bool Device::import_chunk(Chunk const& ch) high=stoi(tt.substr(tpos, tt.size()-tpos)); } } - printf("%d:%d\n",low,high); this->noteCommands[id].push_back(NoteCommand(id,channel,low,high,shell)); this->nb_command++; } @@ -143,6 +142,11 @@ bool Device::import_chunk(Chunk const& ch) tpos++; mapMax=stof(map.substr(tpos, map.size()-tpos)); } + else + { + mapMin=min; + mapMax=max; + } //floating ttch=tch.subChunkPtr("float"); @@ -152,11 +156,6 @@ bool Device::import_chunk(Chunk const& ch) if( tfl == "true" || tfl == "yes" || tfl == "y") floating=true; } - else - { - mapMin=min; - mapMax=max; - } this->ctrlCommands[id].push_back(ControllerCommand(id,channel,min,max,mapMin,mapMax,floating,shell)); this->nb_command++; @@ -164,7 +163,7 @@ bool Device::import_chunk(Chunk const& ch) else if(tstr == "pitch") //type pitch bend { int16_t min=-8192; - int16_t max=8192; + int16_t max=8191; float mapMin; float mapMax; bool floating=false; @@ -209,11 +208,6 @@ bool Device::import_chunk(Chunk const& ch) if( tfl == "true" || tfl == "yes" || tfl == "y") floating=true; } - else - { - mapMin=min; - mapMax=max; - } this->pitchCommands.push_back(PitchCommand(channel,min,max,mapMin,mapMax,floating,shell)); this->nb_command++;