Skip to content

Commit

Permalink
Out of order data
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Feb 9, 2024
1 parent 5307197 commit 5f097d4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const TEST = require('test-midi-files');
- [**test-c-major-scale-m1-g1.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-c-major-scale-m1-g1.midi2)
- [**test-c-major-scale-m2-g0.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-c-major-scale-m2-g0.midi2)
- [**test-c-major-scale-m2-g1.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-c-major-scale-m2-g1.midi2)
- [**test-data-out-of-order.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-data-out-of-order.midi2)
- [**test-data.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-data.midi2)
- [**test-empty.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-empty.midi2)
- [**test-minimal.midi2**](https://github.com/jazz-soft/test-midi-files/raw/main/midi2/test-minimal.midi2)
Expand Down
22 changes: 22 additions & 0 deletions code2/test-data-out-of-order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var TEST = require('..');
var JZZ = require('jzz');
require('jzz-midi-smf')(JZZ);

var data = JZZ.UMP.umpData(0, 'This is a 8-bit data that requires several UMP packets...');

var clip = new JZZ.MIDI.Clip();
clip.header
.umpClipName(0, 'MIDI2 out of order Data')
.umpCopyright(0, 'https:/jazz-soft.net')
.umpMetadata(0, 'Testing MIDI2 out of order 8-bit data message.\n');
clip
.gr(0).umpMetadata('This file contains out of order 8-bit data. Most likely, the player should ignore it.')
.send(data[4])
.send(data[3])
.send(data[2])
.send(data[1])
.send(data[0])
.umpMetadata('Thank you!');

TEST.write(clip);
TEST.play(clip);
Binary file added midi2/test-data-out-of-order.midi2
Binary file not shown.

0 comments on commit 5f097d4

Please sign in to comment.