Skip to content

Commit

Permalink
Clip object
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Nov 22, 2023
1 parent 5f909bf commit ea26819
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ function populate(x, m) {
if (m instanceof JZZ.MIDI.Clip) {
h = { type: 'clip', ppqn: m.ppqn };
x.header = h;
h[0] = [0, JZZ.UMP.umpTicksPQN(m.ppqn).toString()];
for (j = 0; j < m.header.length; j++) h[j + 1] = [m.header[j].tt, m.header[j].toString()];
k = 'data';
x[k] = [];
x[k].push([0, JZZ.UMP.umpStartClip().toString()]);
for (j = 0; j < m.length; j++) x[k].push([m[j].tt, m[j].toString()]);
}
else {
h = { type: m.type, tracks: m.length };
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "runkit-midi",
"version": "1.1.1",
"version": "1.1.2",
"description": "MIDI player/viewer for RunKit",
"main": "index.js",
"scripts": {
Expand All @@ -19,13 +19,13 @@
"author": "jazz-soft (https://jazz-soft.net/)",
"dependencies": {
"jzz": "^1.7.4",
"jzz-gui-player": "^1.6.8",
"jzz-gui-player": "^1.6.9",
"jzz-midi-smf": "^1.8.1",
"jzz-synth-tiny": "^1.3.7"
},
"devDependencies": {
"@runkit/value-viewer": "^1.0.0",
"eslint": "^8.53.0",
"eslint": "^8.54.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0"
},
Expand Down
1 change: 1 addition & 0 deletions test/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ smf1.push(trk1);
smf2.push(trk1);
smf2.push(trk2);
trk1.noteOn(0, 'C6', 127).tick(96).noteOff(0, 'C6');
clip.header.umpBPM(0, 100);
clip.noteOn(0, 0, 'C6', 127).tick(96).noteOff(0, 0, 'C6');

describe('MIDI files', function() {
Expand Down

0 comments on commit ea26819

Please sign in to comment.