Fix remap being reset if floating isn't true
+ change max pitch bend to 8191
This commit is contained in:
parent
cd14cb8d3e
commit
ccac17666a
3 changed files with 8 additions and 15 deletions
4
README
4
README
|
|
@ -104,8 +104,8 @@ remap=<x:y>
|
||||||
float=<true/false>
|
float=<true/false>
|
||||||
}
|
}
|
||||||
-
|
-
|
||||||
*range: controller value from -8192 to 8192 that triggers command. Can enter an interval x:y or single value
|
*range: controller value from -8192 to 8191 that triggers command. Can enter an interval x:y or single value
|
||||||
> optional, default -8192:8192
|
> optional, default -8192:8191
|
||||||
*remap: remaps the range to given interval. Interval can be inversed and float
|
*remap: remaps the range to given interval. Interval can be inversed and float
|
||||||
> optional, default same as range
|
> optional, default same as range
|
||||||
*float: boolean value defining if output is a floating point value
|
*float: boolean value defining if output is a floating point value
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
id=42
|
id=42
|
||||||
channel=0
|
channel=0
|
||||||
remap=-100:100
|
remap=-100:100
|
||||||
float=true
|
|
||||||
shell=echo "Knob #$id ch$channel:$value r:$rawvalue"
|
shell=echo "Knob #$id ch$channel:$value r:$rawvalue"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,6 @@ bool Device::import_chunk(Chunk const& ch)
|
||||||
high=stoi(tt.substr(tpos, tt.size()-tpos));
|
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->noteCommands[id].push_back(NoteCommand(id,channel,low,high,shell));
|
||||||
this->nb_command++;
|
this->nb_command++;
|
||||||
}
|
}
|
||||||
|
|
@ -143,6 +142,11 @@ bool Device::import_chunk(Chunk const& ch)
|
||||||
tpos++;
|
tpos++;
|
||||||
mapMax=stof(map.substr(tpos, map.size()-tpos));
|
mapMax=stof(map.substr(tpos, map.size()-tpos));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mapMin=min;
|
||||||
|
mapMax=max;
|
||||||
|
}
|
||||||
|
|
||||||
//floating
|
//floating
|
||||||
ttch=tch.subChunkPtr("float");
|
ttch=tch.subChunkPtr("float");
|
||||||
|
|
@ -152,11 +156,6 @@ bool Device::import_chunk(Chunk const& ch)
|
||||||
if( tfl == "true" || tfl == "yes" || tfl == "y")
|
if( tfl == "true" || tfl == "yes" || tfl == "y")
|
||||||
floating=true;
|
floating=true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mapMin=min;
|
|
||||||
mapMax=max;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->ctrlCommands[id].push_back(ControllerCommand(id,channel,min,max,mapMin,mapMax,floating,shell));
|
this->ctrlCommands[id].push_back(ControllerCommand(id,channel,min,max,mapMin,mapMax,floating,shell));
|
||||||
this->nb_command++;
|
this->nb_command++;
|
||||||
|
|
@ -164,7 +163,7 @@ bool Device::import_chunk(Chunk const& ch)
|
||||||
else if(tstr == "pitch") //type pitch bend
|
else if(tstr == "pitch") //type pitch bend
|
||||||
{
|
{
|
||||||
int16_t min=-8192;
|
int16_t min=-8192;
|
||||||
int16_t max=8192;
|
int16_t max=8191;
|
||||||
float mapMin;
|
float mapMin;
|
||||||
float mapMax;
|
float mapMax;
|
||||||
bool floating=false;
|
bool floating=false;
|
||||||
|
|
@ -209,11 +208,6 @@ bool Device::import_chunk(Chunk const& ch)
|
||||||
if( tfl == "true" || tfl == "yes" || tfl == "y")
|
if( tfl == "true" || tfl == "yes" || tfl == "y")
|
||||||
floating=true;
|
floating=true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mapMin=min;
|
|
||||||
mapMax=max;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->pitchCommands.push_back(PitchCommand(channel,min,max,mapMin,mapMax,floating,shell));
|
this->pitchCommands.push_back(PitchCommand(channel,min,max,mapMin,mapMax,floating,shell));
|
||||||
this->nb_command++;
|
this->nb_command++;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue