Skip to content

Commit

Permalink
2.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmdude committed Dec 8, 2022
1 parent 9bbdfd0 commit 816bb98
Show file tree
Hide file tree
Showing 49 changed files with 105 additions and 110 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/release-package.yml

This file was deleted.

27 changes: 21 additions & 6 deletions browser/midiwriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var MidiWriter = (function () {
* @return {Constants}
*/
var Constants = {
VERSION: '2.1.3',
VERSION: '2.1.4',
HEADER_CHUNK_TYPE: [0x4d, 0x54, 0x68, 0x64],
// Mthd
HEADER_CHUNK_LENGTH: [0x00, 0x00, 0x00, 0x06],
Expand Down Expand Up @@ -1283,6 +1283,12 @@ var MidiWriter = (function () {
return _this.events.push(e);
});
}
} else if (event instanceof EndTrackEvent) {
// Only one EndTrackEvent is allowed, so remove
// any existing ones before adding.
_this.removeEventsByType('end-track');

_this.events.push(event);
} else {
_this.events.push(event);
}
Expand All @@ -1301,9 +1307,12 @@ var MidiWriter = (function () {
var _this2 = this;

var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Remove existing end track event and add one.
// This makes sure it's at the very end of the event list.
this.removeEventsByType('end-track').addEvent(new EndTrackEvent()); // Reset

// If the last event isn't EndTrackEvent, then tack it onto the data.
if (!this.events.length || !(this.events[this.events.length - 1] instanceof EndTrackEvent)) {
this.addEvent(new EndTrackEvent());
} // Reset


this.data = [];
this.size = [];
Expand Down Expand Up @@ -1384,8 +1393,14 @@ var MidiWriter = (function () {
}, {
key: "mergeSingleEvent",
value: function mergeSingleEvent(event) {
// Find index of existing event we need to follow with
var lastEventIndex = 0;
// There are no events yet, so just add it in.
if (!this.events.length) {
this.addEvent(event);
return;
} // Find index of existing event we need to follow with


var lastEventIndex;

for (var i = 0; i < this.events.length; i++) {
if (this.events[i].tick > event.tick) break;
Expand Down
2 changes: 1 addition & 1 deletion docs/ControllerChangeEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/CopyrightEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/CuePointEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/EndTrackEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/HeaderChunk.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/InstrumentNameEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/KeySignatureEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/LyricEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/MarkerEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/NoteEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/NoteOffEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/NoteOnEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/ProgramChangeEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/TempoEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/TextEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/TimeSignatureEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
36 changes: 18 additions & 18 deletions docs/Track.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h4 class="name" id="addCopyright"><span class="type-signature"></span>addCopyri

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line258">line 258</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line271">line 271</a>
</li></ul></dd>


Expand Down Expand Up @@ -429,7 +429,7 @@ <h4 class="name" id="addCuePoint"><span class="type-signature"></span>addCuePoin

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line294">line 294</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line307">line 307</a>
</li></ul></dd>


Expand Down Expand Up @@ -772,7 +772,7 @@ <h4 class="name" id="addInstrumentName"><span class="type-signature"></span>addI

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line276">line 276</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line289">line 289</a>
</li></ul></dd>


Expand Down Expand Up @@ -928,7 +928,7 @@ <h4 class="name" id="addLyric"><span class="type-signature"></span>addLyric<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line303">line 303</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line316">line 316</a>
</li></ul></dd>


Expand Down Expand Up @@ -1084,7 +1084,7 @@ <h4 class="name" id="addMarker"><span class="type-signature"></span>addMarker<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line285">line 285</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line298">line 298</a>
</li></ul></dd>


Expand Down Expand Up @@ -1240,7 +1240,7 @@ <h4 class="name" id="addText"><span class="type-signature"></span>addText<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line249">line 249</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line262">line 262</a>
</li></ul></dd>


Expand Down Expand Up @@ -1396,7 +1396,7 @@ <h4 class="name" id="addTrackName"><span class="type-signature"></span>addTrackN

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line267">line 267</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line280">line 280</a>
</li></ul></dd>


Expand Down Expand Up @@ -1552,7 +1552,7 @@ <h4 class="name" id="buildData"><span class="type-signature"></span>buildData<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line95">line 95</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line101">line 101</a>
</li></ul></dd>


Expand Down Expand Up @@ -1708,7 +1708,7 @@ <h4 class="name" id="controllerChange"><span class="type-signature"></span>contr

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line333">line 333</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line346">line 346</a>
</li></ul></dd>


Expand Down Expand Up @@ -1890,7 +1890,7 @@ <h4 class="name" id="mergeSingleEvent"><span class="type-signature"></span>merge

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line172">line 172</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line179">line 179</a>
</li></ul></dd>


Expand Down Expand Up @@ -2049,7 +2049,7 @@ <h4 class="name" id="mergeTrack"><span class="type-signature"></span>mergeTrack<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line159">line 159</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line166">line 166</a>
</li></ul></dd>


Expand Down Expand Up @@ -2205,7 +2205,7 @@ <h4 class="name" id="polyModeOn"><span class="type-signature"></span>polyModeOn<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line311">line 311</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line324">line 324</a>
</li></ul></dd>


Expand Down Expand Up @@ -2309,7 +2309,7 @@ <h4 class="name" id="removeEventsByType"><span class="type-signature"></span>rem

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line202">line 202</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line215">line 215</a>
</li></ul></dd>


Expand Down Expand Up @@ -2465,7 +2465,7 @@ <h4 class="name" id="setKeySignature"><span class="type-signature"></span>setKey

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line240">line 240</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line253">line 253</a>
</li></ul></dd>


Expand Down Expand Up @@ -2647,7 +2647,7 @@ <h4 class="name" id="setPitchBend"><span class="type-signature"></span>setPitchB

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line322">line 322</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line335">line 335</a>
</li></ul></dd>


Expand Down Expand Up @@ -2803,7 +2803,7 @@ <h4 class="name" id="setTempo"><span class="type-signature"></span>setTempo<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line218">line 218</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line231">line 231</a>
</li></ul></dd>


Expand Down Expand Up @@ -2997,7 +2997,7 @@ <h4 class="name" id="setTimeSignature"><span class="type-signature"></span>setTi

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line230">line 230</a>
<a href="track.js.html">track.js</a>, <a href="track.js.html#line243">line 243</a>
</li></ul></dd>


Expand Down Expand Up @@ -3200,7 +3200,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
Loading

0 comments on commit 816bb98

Please sign in to comment.