Skip to content

Instantly share code, notes, and snippets.

@AxGord
Last active August 1, 2021 20:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AxGord/1f1c14d040b63a860c33 to your computer and use it in GitHub Desktop.
Save AxGord/1f1c14d040b63a860c33 to your computer and use it in GitHub Desktop.
package;
import js.Node;
import pony.math.Matrix;
import pony.midi.devices.Launchpad;
import pony.midi.devices.LaunchpadColor;
import pony.text.TextTools;
import pony.time.Timer;
using pony.Tools;
/**
* LaunchpadDemo
* @author AxGord
*/
class LaunchpadDemo {
static function main() {
#if debug
Node.require('source-map-support').install();
#end
var data = TextTools.includeFile('lphaxe.txt');
trace(data);
var m:Matrix<LaunchpadColor> = Matrix.parse(data).map(LaunchpadColor.fromIndex);
var lp = new Launchpad();
lp.setMatrix(m);
Timer.repeat(50, function() {
m = m.hor(1);
lp.setMatrix(m);
});
}
}
4 4 4444 4 4 4444
4 4 4 4 4 4 4
4444 4444 4 4444
4 4 4 4 4 4 4
4 4 4 4 4 4 4444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment