Skip to content

Commit

Permalink
fix vel2midi, freq2midi, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Heuer committed Sep 2, 2012
1 parent e7c6d3f commit 15ed0a0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Animoog.ck
Expand Up @@ -626,12 +626,12 @@ public class Animoog


fun float midi2freq(int n) fun float midi2freq(int n)
{ {
return 0.0; return Std.mtof(n);
} }


fun float midi2vel(int v) fun float midi2vel(int v)
{ {
return 0.0; return (v / 127.0);
} }


fun int toCC(float value) fun int toCC(float value)
Expand Down
12 changes: 10 additions & 2 deletions AnimoogMidi.ck
Expand Up @@ -747,12 +747,20 @@ public class AnimoogMidi


fun int freq2midi(float f) fun int freq2midi(float f)
{ {
return 0; return Std.ftom(f) $ int;
} }


fun int vel2midi(float v) fun int vel2midi(float v)
{ {
return 0; if (v < 0.0)
{
return 0;
}
if (v > 1.0)
{
return 127;
}
return (v * 127.0) $ int;
} }


fun int toCC(float value) fun int toCC(float value)
Expand Down
4 changes: 2 additions & 2 deletions MeeBlip.ck
Expand Up @@ -431,12 +431,12 @@ public class MeeBlip


fun float midi2freq(int n) fun float midi2freq(int n)
{ {
return 0.0; return Std.mtof(n);
} }


fun float midi2vel(int v) fun float midi2vel(int v)
{ {
return 0.0; return (v / 127.0);
} }


fun int toCC(float value) fun int toCC(float value)
Expand Down
12 changes: 10 additions & 2 deletions MeeBlipMidi.ck
Expand Up @@ -530,12 +530,20 @@ http://meeblip.com/use-one/micro-kit-assembly/


fun int freq2midi(float f) fun int freq2midi(float f)
{ {
return 0; return Std.ftom(f) $ int;
} }


fun int vel2midi(float v) fun int vel2midi(float v)
{ {
return 0; if (v < 0.0)
{
return 0;
}
if (v > 1.0)
{
return 127;
}
return (v * 127.0) $ int;
} }


fun int toCC(float value) fun int toCC(float value)
Expand Down

0 comments on commit 15ed0a0

Please sign in to comment.