UNPKG

@tonejs/midi

Version:

Convert binary midi into JSON

43 lines 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PitchBend = void 0; var privateHeaderMap = new WeakMap(); /** * Represents a pitch bend event. */ var PitchBend = /** @class */ (function () { /** * @param event * @param header */ function PitchBend(event, header) { privateHeaderMap.set(this, header); this.ticks = event.absoluteTime; this.value = event.value; } Object.defineProperty(PitchBend.prototype, "time", { /** * The time of the event in seconds */ get: function () { var header = privateHeaderMap.get(this); return header.ticksToSeconds(this.ticks); }, set: function (t) { var header = privateHeaderMap.get(this); this.ticks = header.secondsToTicks(t); }, enumerable: false, configurable: true }); PitchBend.prototype.toJSON = function () { return { ticks: this.ticks, time: this.time, value: this.value, }; }; return PitchBend; }()); exports.PitchBend = PitchBend; //# sourceMappingURL=PitchBend.js.map