Skip to content

Instantly share code, notes, and snippets.

@AxGord
Last active Aug 1, 2021
Embed
What would you like to do?
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