Tonejs / Midi

Convert MIDI into Tone.js-friendly JSON
http://tonejs.github.io/Midi/
MIT License
885 stars 117 forks source link

Read/Write midi with lyrics loses text events #150

Closed Meekohi closed 2 years ago

Meekohi commented 2 years ago

Read in a file with text events and immediately write it -- resulting file has no text events.

const fs = require('fs')
const { Midi } = require('@tonejs/midi')

const midiBuffer = fs.readFileSync("input.mid")
const midi = new Midi(midiBuffer)
fs.writeFileSync("output.mid", Buffer.from(midi.toArray()))
Meekohi commented 2 years ago

Note this isn't a problem with midi-file

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.