Browse files

fix vel2midi, freq2midi, etc.

  • Loading branch information...
1 parent e7c6d3f commit 15ed0a062bc22011817e94ba4f3bb20cd2cabd81 Michael Heuer committed Sep 2, 2012
Showing with 24 additions and 8 deletions.
  1. +2 −2 Animoog.ck
  2. +10 −2 AnimoogMidi.ck
  3. +2 −2 MeeBlip.ck
  4. +10 −2 MeeBlipMidi.ck
View
4 Animoog.ck
@@ -626,12 +626,12 @@ public class Animoog
fun float midi2freq(int n)
{
- return 0.0;
+ return Std.mtof(n);
}
fun float midi2vel(int v)
{
- return 0.0;
+ return (v / 127.0);
}
fun int toCC(float value)
View
12 AnimoogMidi.ck
@@ -747,12 +747,20 @@ public class AnimoogMidi
fun int freq2midi(float f)
{
- return 0;
+ return Std.ftom(f) $ int;
}
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)
View
4 MeeBlip.ck
@@ -431,12 +431,12 @@ public class MeeBlip
fun float midi2freq(int n)
{
- return 0.0;
+ return Std.mtof(n);
}
fun float midi2vel(int v)
{
- return 0.0;
+ return (v / 127.0);
}
fun int toCC(float value)
View
12 MeeBlipMidi.ck
@@ -530,12 +530,20 @@ http://meeblip.com/use-one/micro-kit-assembly/
fun int freq2midi(float f)
{
- return 0;
+ return Std.ftom(f) $ int;
}
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)

0 comments on commit 15ed0a0

Please sign in to comment.