diff --git a/package-lock.json b/package-lock.json index dd73bf60..56ad4560 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "musicxml-midi", - "version": "2.5.1", + "version": "2.5.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "musicxml-midi", - "version": "2.5.1", + "version": "2.5.2", "hasInstallScript": true, "license": "GPL-3.0-only", "dependencies": { diff --git a/package.json b/package.json index b5611365..b9a5093e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "musicxml-midi", - "version": "2.5.1", + "version": "2.5.2", "description": "MusicXML to MIDI converter", "type": "module", "directories": { diff --git a/src/js/server.js b/src/js/server.js index 6c345c64..378b8850 100755 --- a/src/js/server.js +++ b/src/js/server.js @@ -175,7 +175,7 @@ app.post('/groove', async (req, res, next) => { const chords = params['chords'].split(',').map(s => s.trim()) const measures = [...Array(parseInt(params['count']))].map((_, index) => { return ` -MidiMark 0 Measure:${index+1}: $Duration +MidiMark 0 Measure:${index}: $Duration ${chords[index % chords.length]} `.trim() }).join('\n') diff --git a/test/server.test.js b/test/server.test.js index 22ce9f50..c51549ab 100644 --- a/test/server.test.js +++ b/test/server.test.js @@ -99,6 +99,8 @@ describe('MusicXML to MIDI conversion server', () => { const track = midi.tracks.find(track => !!track.find(event => event.type === 'marker' && event.text.includes('Measure:'))) expect(track.filter(event => event.type === 'marker' && event.text.includes('Measure:')).length) .toEqual(4) + const measure = track.filter(event => event.type === 'marker' && event.text.includes('Measure:'))[0] + expect(measure.text.split(':')[1]).toEqual('0') }) })