diff --git a/docs/ControllerChangeEvent.html b/docs/ControllerChangeEvent.html index 4da4410..0e62ae2 100644 --- a/docs/ControllerChangeEvent.html +++ b/docs/ControllerChangeEvent.html @@ -24,7 +24,7 @@
@@ -160,7 +160,7 @@
Parameters:
- {controllerNumber: integer, controllerValue: integer} + {controllerNumber: integer, controllerValue: integer, delta: integer} @@ -238,7 +238,7 @@
Returns:

diff --git a/docs/CopyrightEvent.html b/docs/CopyrightEvent.html index 0a805f8..535a1bb 100644 --- a/docs/CopyrightEvent.html +++ b/docs/CopyrightEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new CopyrightEvent(text) → {CopyrightEvent}

+

new CopyrightEvent(fields) → {CopyrightEvent}

@@ -143,13 +143,13 @@
Parameters:
- text + fields -string +object @@ -160,7 +160,7 @@
Parameters:
- Copyright text + {text: string, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/CuePointEvent.html b/docs/CuePointEvent.html index 6287e79..a7ad534 100644 --- a/docs/CuePointEvent.html +++ b/docs/CuePointEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new CuePointEvent(text) → {CuePointEvent}

+

new CuePointEvent(fields) → {CuePointEvent}

@@ -143,13 +143,13 @@
Parameters:
- text + fields -string +object @@ -160,7 +160,7 @@
Parameters:
- Cue point text + {text: string, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/EndTrackEvent.html b/docs/EndTrackEvent.html index df1d61a..9827ead 100644 --- a/docs/EndTrackEvent.html +++ b/docs/EndTrackEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new EndTrackEvent() → {EndTrackEvent}

+

new EndTrackEvent(fields) → {EndTrackEvent}

@@ -99,7 +99,7 @@

new EndT
Source:
@@ -118,6 +118,58 @@

new EndT +

Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fields + + +object + + + + + {delta: integer} + +
+ + @@ -186,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/HeaderChunk.html b/docs/HeaderChunk.html index 7174956..344c838 100644 --- a/docs/HeaderChunk.html +++ b/docs/HeaderChunk.html @@ -24,7 +24,7 @@
@@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/InstrumentNameEvent.html b/docs/InstrumentNameEvent.html index 5178c5c..03e6168 100644 --- a/docs/InstrumentNameEvent.html +++ b/docs/InstrumentNameEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new InstrumentNameEvent(bpm) → {InstrumentNameEvent}

+

new InstrumentNameEvent(fields) → {InstrumentNameEvent}

@@ -143,13 +143,13 @@
Parameters:
- bpm + fields -number +object @@ -160,7 +160,7 @@
Parameters:
- Beats per minute + {text: string, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/KeySignatureEvent.html b/docs/KeySignatureEvent.html index 3f6b19d..d2beab4 100644 --- a/docs/KeySignatureEvent.html +++ b/docs/KeySignatureEvent.html @@ -24,7 +24,7 @@
@@ -186,7 +186,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/LyricEvent.html b/docs/LyricEvent.html index 1920945..6b713e7 100644 --- a/docs/LyricEvent.html +++ b/docs/LyricEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new LyricEvent(text) → {LyricEvent}

+

new LyricEvent(fields) → {LyricEvent}

@@ -143,13 +143,13 @@
Parameters:
- text + fields -string +object @@ -160,7 +160,7 @@
Parameters:
- Lyric text + {text: string, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/MarkerEvent.html b/docs/MarkerEvent.html index 8761367..fb4f36c 100644 --- a/docs/MarkerEvent.html +++ b/docs/MarkerEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new MarkerEvent(text) → {MarkerEvent}

+

new MarkerEvent(fields) → {MarkerEvent}

@@ -143,13 +143,13 @@
Parameters:
- text + fields -string +object @@ -160,7 +160,7 @@
Parameters:
- Marker text + {text: string, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/NoteEvent.html b/docs/NoteEvent.html index 4433e6b..468590f 100644 --- a/docs/NoteEvent.html +++ b/docs/NoteEvent.html @@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@

new NoteEven
Source:
@@ -273,7 +273,7 @@

buildDataSource:
@@ -346,7 +346,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/NoteOffEvent.html b/docs/NoteOffEvent.html index f4375a7..27247ac 100644 --- a/docs/NoteOffEvent.html +++ b/docs/NoteOffEvent.html @@ -24,7 +24,7 @@
@@ -273,7 +273,7 @@

buildDataSource:
@@ -431,7 +431,7 @@

getStatu
Source:
@@ -504,7 +504,7 @@

Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/NoteOnEvent.html b/docs/NoteOnEvent.html index 9e78288..d3d89e0 100644 --- a/docs/NoteOnEvent.html +++ b/docs/NoteOnEvent.html @@ -24,7 +24,7 @@
@@ -273,7 +273,7 @@

buildDataSource:
@@ -431,7 +431,7 @@

getStatu
Source:
@@ -504,7 +504,7 @@

Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/ProgramChangeEvent.html b/docs/ProgramChangeEvent.html index dd6763c..1c41ffa 100644 --- a/docs/ProgramChangeEvent.html +++ b/docs/ProgramChangeEvent.html @@ -24,7 +24,7 @@
@@ -160,7 +160,7 @@
Parameters:
- {instrument: integer} + {instrument: integer, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/TempoEvent.html b/docs/TempoEvent.html index a89f0e4..c17cffb 100644 --- a/docs/TempoEvent.html +++ b/docs/TempoEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new TempoEvent(bpm) → {TempoEvent}

+

new TempoEvent(fields) → {TempoEvent}

@@ -143,13 +143,13 @@
Parameters:
- bpm + fields -number +object @@ -160,7 +160,7 @@
Parameters:
- Beats per minute + {bpm: integer, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/TextEvent.html b/docs/TextEvent.html index 7e352c6..66d840c 100644 --- a/docs/TextEvent.html +++ b/docs/TextEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new TextEvent(bpm) → {TextEvent}

+

new TextEvent(fields) → {TextEvent}

@@ -143,13 +143,13 @@
Parameters:
- bpm + fields -number +object @@ -160,7 +160,7 @@
Parameters:
- Beats per minute + {text: string, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/TimeSignatureEvent.html b/docs/TimeSignatureEvent.html index 9bf2112..76d8a28 100644 --- a/docs/TimeSignatureEvent.html +++ b/docs/TimeSignatureEvent.html @@ -24,7 +24,7 @@
@@ -186,7 +186,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/Track.html b/docs/Track.html index 4467c13..db9ec6e 100644 --- a/docs/Track.html +++ b/docs/Track.html @@ -24,7 +24,7 @@
@@ -273,7 +273,7 @@

addCopyri
Source:
@@ -429,7 +429,7 @@

addCuePoin
Source:
@@ -772,7 +772,7 @@

addI
Source:
@@ -928,7 +928,7 @@

addLyricSource:
@@ -1084,7 +1084,7 @@

addMarkerSource:
@@ -1240,7 +1240,7 @@

addTextSource:
@@ -1396,7 +1396,7 @@

addTrackN
Source:
@@ -1509,7 +1509,7 @@

Returns:
-

buildData() → {Track}

+

buildData(options) → {Track}

@@ -1552,7 +1552,7 @@

buildDataSource:
@@ -1571,6 +1571,58 @@

buildDataParameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +object + + + + + + +
+ + @@ -1656,7 +1708,7 @@

contr
Source:
@@ -1838,7 +1890,7 @@

merge
Source:
@@ -1997,7 +2049,7 @@

mergeTrack<
Source:
@@ -2153,7 +2205,7 @@

polyModeOn<
Source:
@@ -2257,7 +2309,7 @@

rem
Source:
@@ -2413,7 +2465,7 @@

setKey
Source:
@@ -2595,7 +2647,7 @@

setPitchB
Source:
@@ -2708,7 +2760,7 @@

Returns:
-

setTempo(bpm) → {Track}

+

setTempo(bpm, tick) → {Track}

@@ -2751,7 +2803,7 @@

setTempoSource:
@@ -2785,6 +2837,8 @@
Parameters:
+ Default + Description @@ -2810,6 +2864,10 @@
Parameters:
+ + + + Tempo in beats per minute. @@ -2818,6 +2876,38 @@
Parameters:
+ + + + tick + + + + + +number + + + + + + + + + + + 0 + + + + + + Start tick. + + + + + @@ -2907,7 +2997,7 @@

setTi
Source:
@@ -3110,7 +3200,7 @@

Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/TrackNameEvent.html b/docs/TrackNameEvent.html index 206fac0..748b2c4 100644 --- a/docs/TrackNameEvent.html +++ b/docs/TrackNameEvent.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new TrackNameEvent(bpm) → {TrackNameEvent}

+

new TrackNameEvent(fields) → {TrackNameEvent}

@@ -143,13 +143,13 @@
Parameters:
- bpm + fields -number +object @@ -160,7 +160,7 @@
Parameters:
- Beats per minute + {text: string, delta: integer} @@ -238,7 +238,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/Utils.html b/docs/Utils.html index 0d2b9b4..75a39e9 100644 --- a/docs/Utils.html +++ b/docs/Utils.html @@ -24,7 +24,7 @@
@@ -200,7 +200,7 @@

(static) Source:
@@ -357,7 +357,7 @@

(stati
Source:
@@ -470,7 +470,7 @@
Returns:
-

(static) getPitch(pitch) → {number}

+

(static) getPitch(pitch, middleC) → {number}

@@ -514,7 +514,7 @@

(static) get
Source:
@@ -548,6 +548,8 @@

Parameters:
+ Default + Description @@ -576,6 +578,10 @@
Parameters:
+ + + + 'C#4' or midi note code @@ -584,6 +590,38 @@
Parameters:
+ + + + middleC + + + + + +string + + + + + + + + + + + C4 + + + + + + + + + + + @@ -675,7 +713,7 @@

(static) Source:
@@ -832,7 +870,7 @@

(static) <
Source:
@@ -989,7 +1027,7 @@

(static) Source:
@@ -1304,7 +1342,7 @@

(static) Source:
@@ -1460,7 +1498,7 @@

(static) Source:
@@ -1649,7 +1687,7 @@

(stat
Source:
@@ -1809,7 +1847,7 @@

(static) Source:
@@ -2121,7 +2159,7 @@

(static) toAr
Source:
@@ -2350,7 +2388,7 @@

Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/Writer.html b/docs/Writer.html index 567eb5e..c3277de 100644 --- a/docs/Writer.html +++ b/docs/Writer.html @@ -24,7 +24,7 @@
@@ -60,7 +60,7 @@

Constructor

-

new Writer(tracks) → {Writer}

+

new Writer(tracks, options) → {Writer}

@@ -99,7 +99,7 @@

new WriterSource:
@@ -169,6 +169,32 @@
Parameters:
+ + + + options + + + + + +object + + + + + + + + + + + {middleC: 'C4'} + + + + + @@ -276,7 +302,7 @@

base64Source:
@@ -330,6 +356,110 @@
Returns:
+

+ + +
+ + + +

buildData() → {array}

+ + + + + +
+ Builds array of data from chunkschunks. +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +array + + +
+
+ + + +
+ + +
@@ -380,7 +510,7 @@

buildFileSource:
@@ -484,7 +614,7 @@

dataUriSource:
@@ -538,6 +668,188 @@
Returns:
+

+ + +
+ + + +

setOption(key, value) → {Writer}

+ + + + + +
+ Set option on instantiated Writer. +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + + +
value + + +any + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Writer + + +
+
+ + + +
+ + +
@@ -588,7 +900,7 @@

stdoutSource:
@@ -661,7 +973,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/constants.js.html b/docs/constants.js.html index cbe55f4..1b83cf2 100644 --- a/docs/constants.js.html +++ b/docs/constants.js.html @@ -24,7 +24,7 @@
@@ -45,7 +45,7 @@

constants.js

*/ const Constants = { - VERSION : require('../package.json').version, + VERSION : '2.1.0', HEADER_CHUNK_TYPE : [0x4d, 0x54, 0x68, 0x64], // Mthd HEADER_CHUNK_LENGTH : [0x00, 0x00, 0x00, 0x06], // Header size for SMF HEADER_CHUNK_FORMAT0 : [0x00, 0x00], // Midi Type 0 id @@ -83,7 +83,7 @@

constants.js


- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/global.html b/docs/global.html index 03dcaf8..94ada02 100644 --- a/docs/global.html +++ b/docs/global.html @@ -24,7 +24,7 @@
@@ -290,7 +290,7 @@
Parameters:
- { bend : float, channel : int } + { bend : float, channel : int, delta: int } @@ -354,7 +354,7 @@
Returns:

- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/header-chunk.js.html b/docs/header-chunk.js.html index 0319951..627f0cd 100644 --- a/docs/header-chunk.js.html +++ b/docs/header-chunk.js.html @@ -24,7 +24,7 @@
@@ -75,7 +75,7 @@

header-chunk.js


- Generated by JSDoc 3.6.7 on Tue Jun 29 2021 21:42:14 GMT-0700 (Pacific Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.10 on Sun Feb 13 2022 08:07:10 GMT-0800 (Pacific Standard Time) using the Minami theme.
diff --git a/docs/index.html b/docs/index.html index b655d66..bf07d35 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
@@ -59,20 +59,20 @@

Install

npm install midi-writer-js
 

Getting Started

-
var MidiWriter = require('midi-writer-js');
+
const MidiWriter = require('midi-writer-js');
 
 // Start with a new track
-var track = new MidiWriter.Track();
+const track = new MidiWriter.Track();
 
 // Define an instrument (optional):
 track.addEvent(new MidiWriter.ProgramChangeEvent({instrument: 1}));
 
 // Add some notes:
-var note = new MidiWriter.NoteEvent({pitch: ['C4', 'D4', 'E4'], duration: '4'});
+const note = new MidiWriter.NoteEvent({pitch: ['C4', 'D4', 'E4'], duration: '4'});
 track.addEvent(note);
 
 // Generate a data URI
-var write = new MidiWriter.Writer(track);
+const write = new MidiWriter.Writer(track);
 console.log(write.dataUri());
 

Documentation

@@ -96,6 +96,7 @@

MidiWriter.NoteEvent({options})

Name Type + Default Description @@ -103,11 +104,13 @@

MidiWriter.NoteEvent({options})

pitch string or array + Each pitch can be a string or valid MIDI note code. Format for string is C#4. Pro tip: You can use the output from tonal functions to build scales, chords, intervals, etc. in this parameter. duration string or array + How long the note should sound.