Skip to content

Commit 4ce5738

Browse files
committed
just commiiiit
1 parent 59f6589 commit 4ce5738

File tree

4 files changed

+97
-5
lines changed

4 files changed

+97
-5
lines changed

build/ts.bundle.js

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ts.es5.js

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gen-stochastic.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,38 @@ function expand(a=[0, 0], l=0){
352352
exports.expand = expand;
353353
exports.extrapolate = expand;
354354

355+
// generate a "cantus firmus" WIP
356+
//
357+
// function cantusFirmus(){
358+
// let tonic = 0;
359+
// let current = tonic;
360+
// let _prev;
361+
// let arr = [];
362+
// arr.push(current);
363+
364+
// let maxDistance = 0;
365+
// let minLength = 8;
366+
// let maxLength = 16;
367+
368+
// for (let i = 0; i < 20; i++){
369+
// let ivl = rng() < 0.5 ? 1 : -1;
370+
// current += ivl;
371+
// arr.push(current);
372+
// _prev = current;
373+
// }
374+
// console.log(arr);
375+
// }
376+
// exports.cantusFirmus = cantusFirmus;
377+
// cantusFirmus();
378+
379+
// generate a "first species" counterpoint
380+
//
381+
// function firstSpeciesCounterpoint(a=[0]){
382+
// let prevInterval;
383+
// }
384+
// exports.firstSpeciesCounterpoint = firstSpeciesCounterpoint;
385+
// exports.counterpoint = firstSpeciesCounterpoint;
386+
355387
// Initialize a Markov Chain Model (One of the simpelest forms of ML)
356388
// A Markov chain is a stochastic model describing a sequence
357389
// of possible events in which the probability of each event depends

test/serialism.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,10 +1069,10 @@ function testTranslate(){
10691069
expect(TL.mtof(60)).toStrictEqual(261.6255653005986);
10701070
});
10711071
test("TL.mtof([48, 55, 51, 43])", () => {
1072-
expect(TL.mtof([48, 55, 51, 43])).toStrictEqual([ 130.8127826502993, 195.99771799087463, 155.56349186104043, 97.99885899543733 ]);
1072+
expect(TL.mtof([48, 55, 51, 43])).toStrictEqual([ 130.8127826502993, 195.99771799087463, 155.56349186104046, 97.99885899543733 ]);
10731073
});
10741074
test("TL.mtof([48, [[55, 51], 43]])", () => {
1075-
expect(TL.mtof([48, [[55, 51], 43]])).toStrictEqual([ 130.8127826502993, [ [ 195.99771799087463, 155.56349186104043 ], 97.99885899543733 ] ]);
1075+
expect(TL.mtof([48, [[55, 51], 43]])).toStrictEqual([ 130.8127826502993, [ [ 195.99771799087463, 155.56349186104046 ], 97.99885899543733 ] ]);
10761076
});
10771077
test("TL.mtof(60.3)", () => {
10781078
expect(TL.mtof(60.3)).toStrictEqual(266.19869962824436);
@@ -1118,7 +1118,7 @@ function testTranslate(){
11181118
expect(TL.ntof('c4')).toStrictEqual(261.6255653005986);
11191119
});
11201120
test("TL.ntof(['c3', [['g3', 'eb3'], 'g2']])", () => {
1121-
expect(TL.ntof(['c3', [['g3', 'eb3'], 'g2']])).toStrictEqual([ 130.8127826502993, [ [ 195.99771799087463, 155.56349186104043 ], 97.99885899543733 ] ]);
1121+
expect(TL.ntof(['c3', [['g3', 'eb3'], 'g2']])).toStrictEqual([ 130.8127826502993, [ [ 195.99771799087463, 155.56349186104046 ], 97.99885899543733 ] ]);
11221122
});
11231123

11241124
test("TL.ctor()", () => {
@@ -1203,7 +1203,7 @@ function testTranslate(){
12031203

12041204
test("TL.toFreq([0, [1, 2, 3], [4, 5, [6, 7], 8], 9, 10, 11]])", () => {
12051205
TL.setScale('minor_pentatonic', 'c');
1206-
expect(TL.toFreq([0, [1, 2, 3], [4, 5, [6, 7], 8], 9, 10, 11])).toStrictEqual([ 261.6255653005986, [ 261.6255653005986, 261.6255653005986, 311.12698372208087 ], [ 311.12698372208087, 349.2282314330039, [ 349.2282314330039, 391.99543598174927 ], 391.99543598174927 ], 391.99543598174927, 466.1637615180899, 466.1637615180899 ]);
1206+
expect(TL.toFreq([0, [1, 2, 3], [4, 5, [6, 7], 8], 9, 10, 11])).toStrictEqual([ 261.6255653005986, [ 261.6255653005986, 261.6255653005986, 311.1269837220809 ], [ 311.1269837220809, 349.2282314330039, [ 349.2282314330039, 391.99543598174927 ], 391.99543598174927 ], 391.99543598174927, 466.1637615180899, 466.1637615180899 ]);
12071207
});
12081208

12091209
test("TL.rtoc()", () => {

0 commit comments

Comments
 (0)