1.0.1 • Published 5 years ago

@tim-smart/mtc v1.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

@tim-smart/mtc

A transform stream that consumes MIDI messages and outputs timecode objects.

Usage

import { MTCStream } from "@tim-smart/mtc";
import { Input } from "easymidi";

const input = new Input("Network MIDI device");
const mtc = new MTCStream();

input._input.on("message", (delta: number, msg: number[]) => {
  const msgBuffer = Buffer.from(msg);
  mtc.write(msgBuffer);
});

mtc.on("data", timecode => {
  console.log(timecode.toString());
});