From a524411bf181d593282accdbd49b3daad2f961c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C3=BAl=20Millanes=20Morimoto?= Date: Wed, 13 Jul 2022 23:24:36 -0700 Subject: [PATCH 1/4] created branch test/time-signatures --- package-lock.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1da9368..a5fbf10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6393,7 +6393,7 @@ "node_modules/cryptiles": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", - "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", + "integrity": "sha512-gvWSbgqP+569DdslUiCelxIv3IYK5Lgmq1UrRnk+s1WxQOQ16j3GPDcjdtgL5Au65DU/xQi6q3xPtf5Kta+3IQ==", "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", "optional": true, "dependencies": { @@ -8937,7 +8937,7 @@ "node_modules/form-data": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", - "integrity": "sha1-kavXiKupcCsaq/qLwBAxoqyeOxI=", + "integrity": "sha512-x8eE+nzFtAMA0YYlSxf/Qhq6vP1f8wSoZ7Aw1GuctBcmudCNuTUmmx45TfEplyb6cjsZO/jvh6+1VpZn24ez+w==", "optional": true, "dependencies": { "async": "~0.9.0", @@ -9344,7 +9344,7 @@ "node_modules/hawk": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", - "integrity": "sha1-h81JH5tG5OKurKM1QWdmiF0tHtk=", + "integrity": "sha512-am8sVA2bCJIw8fuuVcKvmmNnGFUGW8spTkVtj2fXTEZVkfN42bwFZFtDem57eFi+NSxurJB8EQ7Jd3uCHLn8Vw==", "deprecated": "This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", "optional": true, "dependencies": { @@ -9368,7 +9368,7 @@ "node_modules/hoek": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", - "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=", + "integrity": "sha512-ZZ6eGyzGjyMTmpSPYVECXy9uNfqBR7x5CavhUaLOeD6W0vWK1mp/b7O3f86XE0Mtfo9rZ6Bh3fnuw9Xr8MF9zA==", "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", "optional": true, "engines": { @@ -13391,7 +13391,7 @@ "node_modules/mime": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", + "integrity": "sha512-Ysa2F/nqTNGHhhm9MV8ure4+Hc+Y8AWiqUdHxsO7xu8zc92ND9f3kpALHjaP026Ft17UfxrMt95c50PLUeynBw==", "optional": true }, "node_modules/mime-db": { @@ -15463,7 +15463,7 @@ "node_modules/qs": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", - "integrity": "sha1-GbV/8k3CqZzh+L32r82ln472H4g=" + "integrity": "sha512-xEqT+49YIt+BdwQthXKTOkp7atENe6JqrGGerxBPiER6BArOIiVJtpZZYpWOpq2IOkTPVnDM8CgYvppFoJNwyQ==" }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -16986,7 +16986,7 @@ "node_modules/request": { "version": "2.42.0", "resolved": "https://registry.npmjs.org/request/-/request-2.42.0.tgz", - "integrity": "sha1-VyvQFIk4VkBArHqxSLlkI6BjMEo=", + "integrity": "sha512-ZpqQyQWQ7AdVurjxpmP/fgpN3wAZBruO2GeD3zDijWmnqg3SYz9YY6uZC8tJF++IhZ/P2VZkZug/fFEshAkD6g==", "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "engines": [ "node >= 0.8.0" @@ -17604,7 +17604,7 @@ "node_modules/sntp": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", - "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", + "integrity": "sha512-bDLrKa/ywz65gCl+LmOiIhteP1bhEsAAzhfMedPoiHP3dyYnAevlaJshdqb9Yu0sRifyP/fRqSt8t+5qGIWlGQ==", "deprecated": "This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", "optional": true, "dependencies": { @@ -18695,7 +18695,7 @@ "node_modules/tunnel-agent": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "integrity": "sha512-e0IoVDWx8SDHc/hwFTqJDQ7CCDTEeGhmcT9jkWJjoGQSpgBz20nAMr80E3Tpk7PatJ1b37DQDgJR3CNSzcMOZQ==", "engines": { "node": "*" } @@ -24338,7 +24338,7 @@ "cryptiles": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", - "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", + "integrity": "sha512-gvWSbgqP+569DdslUiCelxIv3IYK5Lgmq1UrRnk+s1WxQOQ16j3GPDcjdtgL5Au65DU/xQi6q3xPtf5Kta+3IQ==", "optional": true, "requires": { "boom": "0.4.x" @@ -26168,7 +26168,7 @@ "form-data": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", - "integrity": "sha1-kavXiKupcCsaq/qLwBAxoqyeOxI=", + "integrity": "sha512-x8eE+nzFtAMA0YYlSxf/Qhq6vP1f8wSoZ7Aw1GuctBcmudCNuTUmmx45TfEplyb6cjsZO/jvh6+1VpZn24ez+w==", "optional": true, "requires": { "async": "~0.9.0", @@ -26453,7 +26453,7 @@ "hawk": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", - "integrity": "sha1-h81JH5tG5OKurKM1QWdmiF0tHtk=", + "integrity": "sha512-am8sVA2bCJIw8fuuVcKvmmNnGFUGW8spTkVtj2fXTEZVkfN42bwFZFtDem57eFi+NSxurJB8EQ7Jd3uCHLn8Vw==", "optional": true, "requires": { "boom": "0.4.x", @@ -26470,7 +26470,7 @@ "hoek": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", - "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=", + "integrity": "sha512-ZZ6eGyzGjyMTmpSPYVECXy9uNfqBR7x5CavhUaLOeD6W0vWK1mp/b7O3f86XE0Mtfo9rZ6Bh3fnuw9Xr8MF9zA==", "optional": true }, "hoist-non-react-statics": { @@ -29426,7 +29426,7 @@ "mime": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", + "integrity": "sha512-Ysa2F/nqTNGHhhm9MV8ure4+Hc+Y8AWiqUdHxsO7xu8zc92ND9f3kpALHjaP026Ft17UfxrMt95c50PLUeynBw==", "optional": true }, "mime-db": { @@ -30773,7 +30773,7 @@ "qs": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", - "integrity": "sha1-GbV/8k3CqZzh+L32r82ln472H4g=" + "integrity": "sha512-xEqT+49YIt+BdwQthXKTOkp7atENe6JqrGGerxBPiER6BArOIiVJtpZZYpWOpq2IOkTPVnDM8CgYvppFoJNwyQ==" }, "queue-microtask": { "version": "1.2.3", @@ -31927,7 +31927,7 @@ "request": { "version": "2.42.0", "resolved": "https://registry.npmjs.org/request/-/request-2.42.0.tgz", - "integrity": "sha1-VyvQFIk4VkBArHqxSLlkI6BjMEo=", + "integrity": "sha512-ZpqQyQWQ7AdVurjxpmP/fgpN3wAZBruO2GeD3zDijWmnqg3SYz9YY6uZC8tJF++IhZ/P2VZkZug/fFEshAkD6g==", "requires": { "aws-sign2": "~0.5.0", "bl": "~0.9.0", @@ -32374,7 +32374,7 @@ "sntp": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", - "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", + "integrity": "sha512-bDLrKa/ywz65gCl+LmOiIhteP1bhEsAAzhfMedPoiHP3dyYnAevlaJshdqb9Yu0sRifyP/fRqSt8t+5qGIWlGQ==", "optional": true, "requires": { "hoek": "0.9.x" @@ -33198,7 +33198,7 @@ "tunnel-agent": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=" + "integrity": "sha512-e0IoVDWx8SDHc/hwFTqJDQ7CCDTEeGhmcT9jkWJjoGQSpgBz20nAMr80E3Tpk7PatJ1b37DQDgJR3CNSzcMOZQ==" }, "tweetnacl": { "version": "0.14.5", From 4c93d38734d5c335e1ec7e26e80340fdf89c90df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C3=BAl=20Millanes=20Morimoto?= Date: Mon, 18 Jul 2022 01:33:48 -0700 Subject: [PATCH 2/4] added tests for 3/4 time signature --- test/stringMaker/timeSignatures.test.ts | 199 ++++++++++++++++++++++++ 1 file changed, 199 insertions(+) diff --git a/test/stringMaker/timeSignatures.test.ts b/test/stringMaker/timeSignatures.test.ts index f8e3da3..d26f77c 100644 --- a/test/stringMaker/timeSignatures.test.ts +++ b/test/stringMaker/timeSignatures.test.ts @@ -3,6 +3,7 @@ import PatternMaker from '../../src/utils/classes/patternMaker'; const patternMaker = PatternMaker.getInstance(8); +// QuarterNotes with 3/4 describe('Test quarterNotes on and fill on beat 3', () => { it('should return 100000002000000030000000', () => { patternMaker.setSettings({ @@ -15,3 +16,201 @@ describe('Test quarterNotes on and fill on beat 3', () => { assert.equal(pattern.length, 24); }); }); + +describe('Test custom pattern with quarterNotes', () => { + it('should return 100000002000000020000000', () => { + patternMaker.setSettings({ + playNotes: 'quarterNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeString(); + assert.equal(pattern, '100000002000000020000000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test quarterNotes on and fill on beat 2', () => { + it('should return 100000003000000020000000', () => { + patternMaker.setSettings({ + playNotes: 'quarterNotes', + playFillOn: { beat: '2', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '100000003000000020000000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test quarterNotes on and fill on beat 1', () => { + it('should return 300000002000000020000000', () => { + patternMaker.setSettings({ + playNotes: 'quarterNotes', + playFillOn: { beat: '1', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '300000002000000020000000'); + assert.equal(pattern.length, 24); + }); +}); + +// EighthNotes with 3/4 +describe('Test custom pattern with eighthNotes', () => { + it('should return 100020002000200020002000', () => { + patternMaker.setSettings({ + playNotes: 'eighthNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeString(); + assert.equal(pattern, '100020002000200020002000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test eighthNotes on and fill on beat 3', () => { + it('should return 100020002000200030002000', () => { + patternMaker.setSettings({ + playNotes: 'eighthNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '100020002000200030002000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test eighthNotes on and fill on beat 2', () => { + it('should return 100020003000200020002000', () => { + patternMaker.setSettings({ + playNotes: 'eighthNotes', + playFillOn: { beat: '2', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '100020003000200020002000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test eighthNotes on and fill on beat 1', () => { + it('should return 300020002000200020002000', () => { + patternMaker.setSettings({ + playNotes: 'eighthNotes', + playFillOn: { beat: '1', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '300020002000200020002000'); + assert.equal(pattern.length, 24); + }); +}); + +// EighthNotes with 3/4 +describe('Test custom pattern with sixteenthNotes', () => { + it('should return 102020202020202020202020', () => { + patternMaker.setSettings({ + playNotes: 'sixteenthNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeString(); + assert.equal(pattern, '102020202020202020202020'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test sixteenthNotes on and fill on beat 3', () => { + it('should return 102020202020202030202020', () => { + patternMaker.setSettings({ + playNotes: 'sixteenthNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '102020202020202030202020'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test sixteenthNotes on and fill on beat 2', () => { + it('should return 102020203020202020202020', () => { + patternMaker.setSettings({ + playNotes: 'sixteenthNotes', + playFillOn: { beat: '2', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '102020203020202020202020'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test sixteenthNotes on and fill on beat 1', () => { + it('should return 302020202020202020202020', () => { + patternMaker.setSettings({ + playNotes: 'sixteenthNotes', + playFillOn: { beat: '1', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '302020202020202020202020'); + assert.equal(pattern.length, 24); + }); +}); + +// First Note Only with 3/4 +describe('Test custom pattern with firstNoteOnly', () => { + it('should return 100000000000000000000000', () => { + patternMaker.setSettings({ + playNotes: 'firstNoteOnly', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeString(); + assert.equal(pattern, '100000000000000000000000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test firstNoteOnly on and fill on beat 3', () => { + it('should return 100000000000000030000000', () => { + patternMaker.setSettings({ + playNotes: 'firstNoteOnly', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '100000000000000030000000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test firstNoteOnly on and fill on beat 2', () => { + it('should return 100000003000000000000000', () => { + patternMaker.setSettings({ + playNotes: 'firstNoteOnly', + playFillOn: { beat: '2', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '100000003000000000000000'); + assert.equal(pattern.length, 24); + }); +}); + +describe('Test firstNoteOnly on and fill on beat 1', () => { + it('should return 300000000000000000000000', () => { + patternMaker.setSettings({ + playNotes: 'firstNoteOnly', + playFillOn: { beat: '1', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '300000000000000000000000'); + assert.equal(pattern.length, 24); + }); +}); From 9bcb1fa1b27f9bdf8e9fe438c16f87d3b93cf370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C3=BAl=20Millanes=20Morimoto?= Date: Tue, 26 Jul 2022 23:12:30 -0700 Subject: [PATCH 3/4] Added tests for 3/4 against 3/2, 3/8 and 3/16 --- test/stringMaker/timeSignatures.test.ts | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/test/stringMaker/timeSignatures.test.ts b/test/stringMaker/timeSignatures.test.ts index d26f77c..c3a9d2a 100644 --- a/test/stringMaker/timeSignatures.test.ts +++ b/test/stringMaker/timeSignatures.test.ts @@ -214,3 +214,62 @@ describe('Test firstNoteOnly on and fill on beat 1', () => { assert.equal(pattern.length, 24); }); }); + +// Comparing 3/4 to other time signatures + +describe('Test pattern 3/4 against pattern 3/2', () => { + it('should return 100000002000000020000000', () => { + patternMaker.setSettings({ + playNotes: 'quarterNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const patternQuarter = patternMaker.getMetronomeString(); + patternMaker.setSettings({ + playNotes: 'halfNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '2' }, + }); + const patternHalf = patternMaker.getMetronomeString(); + assert.equal(patternHalf, patternQuarter); + assert.equal(patternHalf.length, patternQuarter.length); + }); +}); + +describe('Test pattern 3/4 against pattern 3/8', () => { + it('should return 100000002000000020000000', () => { + patternMaker.setSettings({ + playNotes: 'quarterNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const patternQuarter = patternMaker.getMetronomeString(); + patternMaker.setSettings({ + playNotes: 'eighthNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '8' }, + }); + const patternEighth = patternMaker.getMetronomeString(); + assert.equal(patternEighth, patternQuarter); + assert.equal(patternEighth.length, patternQuarter.length); + }); +}); + +describe('Test pattern 3/4 against pattern 3/16', () => { + it('should return 100000002000000020000000', () => { + patternMaker.setSettings({ + playNotes: 'quarterNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const patternQuarter = patternMaker.getMetronomeString(); + patternMaker.setSettings({ + playNotes: 'sixteenthNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '3', division: '16' }, + }); + const patternSixteenth = patternMaker.getMetronomeString(); + assert.equal(patternSixteenth, patternQuarter); + assert.equal(patternSixteenth.length, patternQuarter.length); + }); +}); From 3f592d3de6b096e01005528e1ef15ddd908dbe47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=C3=BAl=20Millanes=20Morimoto?= Date: Tue, 26 Jul 2022 23:39:39 -0700 Subject: [PATCH 4/4] Added Tests for 1/4 --- test/stringMaker/timeSignatures.test.ts | 40 +++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/test/stringMaker/timeSignatures.test.ts b/test/stringMaker/timeSignatures.test.ts index c3a9d2a..dbb3a8d 100644 --- a/test/stringMaker/timeSignatures.test.ts +++ b/test/stringMaker/timeSignatures.test.ts @@ -218,7 +218,7 @@ describe('Test firstNoteOnly on and fill on beat 1', () => { // Comparing 3/4 to other time signatures describe('Test pattern 3/4 against pattern 3/2', () => { - it('should return 100000002000000020000000', () => { + it('should match both patterns', () => { patternMaker.setSettings({ playNotes: 'quarterNotes', playFillOn: { beat: '3', subBeat: '0' }, @@ -237,7 +237,7 @@ describe('Test pattern 3/4 against pattern 3/2', () => { }); describe('Test pattern 3/4 against pattern 3/8', () => { - it('should return 100000002000000020000000', () => { + it('should match both patterns', () => { patternMaker.setSettings({ playNotes: 'quarterNotes', playFillOn: { beat: '3', subBeat: '0' }, @@ -256,7 +256,7 @@ describe('Test pattern 3/4 against pattern 3/8', () => { }); describe('Test pattern 3/4 against pattern 3/16', () => { - it('should return 100000002000000020000000', () => { + it('should match both patterns', () => { patternMaker.setSettings({ playNotes: 'quarterNotes', playFillOn: { beat: '3', subBeat: '0' }, @@ -273,3 +273,37 @@ describe('Test pattern 3/4 against pattern 3/16', () => { assert.equal(patternSixteenth.length, patternQuarter.length); }); }); + +// Tests for 1/4 + +describe('Test pattern 1/4 against pattern 1/2', () => { + it('should match both patterns', () => { + patternMaker.setSettings({ + playNotes: 'quarterNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '1', division: '4' }, + }); + const patternQuarter = patternMaker.getMetronomeString(); + patternMaker.setSettings({ + playNotes: 'halfNotes', + playFillOn: { beat: '3', subBeat: '0' }, + timeSignature: { beats: '1', division: '2' }, + }); + const patternHalf = patternMaker.getMetronomeString(); + assert.equal(patternHalf, patternQuarter); + assert.equal(patternHalf.length, patternQuarter.length); + }); +}); + +describe('Test eighthNotes on and fill on beat 1', () => { + it('should return 100020002000200020002000', () => { + patternMaker.setSettings({ + playNotes: 'eighthNotes', + playFillOn: { beat: '1', subBeat: '0' }, + timeSignature: { beats: '3', division: '4' }, + }); + const pattern = patternMaker.getMetronomeStringWithFill(); + assert.equal(pattern, '300020002000200020002000'); + assert.equal(pattern.length, 24); + }); +});