Fix remap being reset if floating isn't true

+ change max pitch bend to 8191
This commit is contained in:
zawz 2019-06-16 15:35:01 +02:00
parent cd14cb8d3e
commit ccac17666a
3 changed files with 8 additions and 15 deletions

4
README
View file

@ -104,8 +104,8 @@ remap=<x:y>
float=<true/false>
}
-
*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

View file

@ -29,7 +29,6 @@
id=42
channel=0
remap=-100:100
float=true
shell=echo "Knob #$id ch$channel:$value r:$rawvalue"
},
{

View file

@ -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++;