json-midi-encoder
TypeScript icon, indicating that this package has built-in type declarations

5.1.60 • Public • Published

json-midi-encoder

This module encodes a JSON representation of MIDI data into a binary MIDI file.

version

By using this module it is possible to encode a JSON representation of a MIDI file into its binary counterpart. That JSON representation can either be created from scratch or produced by parsing an existing file with the midi-json-parser.

Usage

This module is distributed as package on npm. It can be installed by running the following command:

npm install json-midi-encoder

The only exported function is called encode(). It expects to receive a JSON representation as its only parameter. It returns a Promise which hopefully resolves with an ArrayBuffer containing the binary MIDI file. Here is a little example.

import { encode } from 'json-midi-encoder';

const json = {
    division: 480,
    format: 1,
    tracks: [
        [
            {
                delta: 0,
                trackName: 'example'
            },
            // ... there are probably more events ...
            {
                delta: 0,
                endOfTrack: true
            }
        ]
        // ... maybe there are more tracks ...
    ]
};

encode(json).then((midiFile) => {
    // midiFile is an ArrayBuffer containing the binary data.
});

To see what kind of events this module can handle, you may want to have a look at the JSON files used to test this module. There is also a TypeScript interface which describes the JSON representation.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.1.6028latest

Version History

VersionDownloads (Last 7 Days)Published
5.1.6028
5.1.590
5.1.580
5.1.570
5.1.561
5.1.553
5.1.541
5.1.531
5.1.520
5.1.510
5.1.500
5.1.490
5.1.480
5.1.471
5.1.461
5.1.450
5.1.440
5.1.430
5.1.421
5.1.411
5.1.400
5.1.391
5.1.380
5.1.370
5.1.360
5.1.351
5.1.341
5.1.331
5.1.321
5.1.310
5.1.300
5.1.290
5.1.281
5.1.270
5.1.260
5.1.250
5.1.240
5.1.230
5.1.220
5.1.210
5.1.202
5.1.190
5.1.180
5.1.170
5.1.160
5.1.150
5.1.140
5.1.131
5.1.120
5.1.110
5.1.100
5.1.91
5.1.80
5.1.71
5.1.61
5.1.51
5.1.41
5.1.30
5.1.20
5.1.10
5.1.01
5.0.520
5.0.510
5.0.500
5.0.490
5.0.481
5.0.470
5.0.461
5.0.451
5.0.441
5.0.430
5.0.420
5.0.410
5.0.402
5.0.391
5.0.380
5.0.370
5.0.360
5.0.352
5.0.340
5.0.330
5.0.320
5.0.310
5.0.301
5.0.291
5.0.281
5.0.271
5.0.260
5.0.252
5.0.240
5.0.230
5.0.220
5.0.210
5.0.201
5.0.191
5.0.180
5.0.170
5.0.160
5.0.150
5.0.141
5.0.130
5.0.120
5.0.112
5.0.100
5.0.91
5.0.80
5.0.70
5.0.60
5.0.50
5.0.41
5.0.30
5.0.20
5.0.11
5.0.01
4.0.120
4.0.111
4.0.101
4.0.90
4.0.80
4.0.70
4.0.60
4.0.51
4.0.40
4.0.30
4.0.21
4.0.11
4.0.00
3.4.200
3.4.191
3.4.181
3.4.170
3.4.161
3.4.150
3.4.140
3.4.130
3.4.121
3.4.110
3.4.100
3.4.90
3.4.81
3.4.70
3.4.60
3.4.50
3.4.40
3.4.30
3.4.21
3.4.11
3.4.00
3.3.01
3.2.120
3.2.113
3.2.100
3.2.91
3.2.81
3.2.71
3.2.61
3.2.51
3.2.40
3.2.30
3.2.24
3.2.11
3.2.00
3.1.13
3.1.00
3.0.221
3.0.210
3.0.200
3.0.190
3.0.182
3.0.171
3.0.160
3.0.151
3.0.140
3.0.131
3.0.120
3.0.110
3.0.101
3.0.90
3.0.80
3.0.70
3.0.60
3.0.50
3.0.42
3.0.30
3.0.20
3.0.10
3.0.00
2.1.600
2.1.590
2.1.580
2.1.570
2.1.561
2.1.550
2.1.540
2.1.530
2.1.520
2.1.510
2.1.501
2.1.490
2.1.480
2.1.472
2.1.460
2.1.450
2.1.441
2.1.430
2.1.421
2.1.410
2.1.401
2.1.391
2.1.380
2.1.370
2.1.360
2.1.350
2.1.340
2.1.331
2.1.321
2.1.310
2.1.300
2.1.290
2.1.281
2.1.271
2.1.261
2.1.251
2.1.241
2.1.230
2.1.220
2.1.210
2.1.200
2.1.191
2.1.180
2.1.170
2.1.160
2.1.150
2.1.141
2.1.130
2.1.120
2.1.110
2.1.100
2.1.90
2.1.80
2.1.70
2.1.60
2.1.50
2.1.41
2.1.30
2.1.20
2.1.11
2.1.00
2.0.261
2.0.250
2.0.240
2.0.230
2.0.220
2.0.211
2.0.201
2.0.192
2.0.180
2.0.170
2.0.160
2.0.150
2.0.130
2.0.121
2.0.110
2.0.101
2.0.91
2.0.81
2.0.71
2.0.60
2.0.50
2.0.40
2.0.30
2.0.20
2.0.12
2.0.00
1.0.61
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.21
0.0.11

Package Sidebar

Install

npm i json-midi-encoder

Weekly Downloads

149

Version

5.1.60

License

MIT

Unpacked Size

60.3 kB

Total Files

15

Last publish

Collaborators

  • chrisguttandin