Skip to content

Instantly share code, notes, and snippets.

@ptrv
Created March 1, 2014 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptrv/9299567 to your computer and use it in GitHub Desktop.
Save ptrv/9299567 to your computer and use it in GitHub Desktop.
audio plugin parameter conversion
float convertToHost (float val, float min, float max)
{
float range = (max) - (min);
val= (val - min)/range;
return val;
}
float convertFromHost (float val,float min,float max)
{
float range = (max) - (min);
return (val*range) + min;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment