updates to imports
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { soundChord } from "../app.js";
|
||||
import { getRandomPitches } from "./vector_logic/getRandomPitches.js";
|
||||
import { getRandomPitches } from "./pitch_generation/getRandomPitches.js";
|
||||
import { getProceduralPitches } from "./pitch_generation/getProceduralPitches.js";
|
||||
import { extractPitchset } from "./vector_logic/extractPitchset.js";
|
||||
import { getProceduralPitches } from "./vector_logic/getProceduralPitches.js";
|
||||
|
||||
// initial test: generate a single, random chord
|
||||
export const fullRandomChord = () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { pitchsets, musicalPitches } from "../harmonyUtil.js";
|
||||
import { extractPitchName } from "./extractPitchName.js";
|
||||
import { extractPitchName } from "../vector_logic/extractPitchName.js";
|
||||
import { getRandomIndex } from "./getRandomPitches.js";
|
||||
|
||||
// an additional method based on the structure of getRandomPitches,
|
||||
@@ -1,5 +1,5 @@
|
||||
import { pitchsets } from "../harmonyUtil.js";
|
||||
import { extractPitchName } from "./extractPitchName.js";
|
||||
import { extractPitchName } from "../vector_logic/extractPitchName.js";
|
||||
|
||||
// helper function for assigning a random index for a given voice's pitchset
|
||||
export const getRandomIndex = (voice) => Math.floor(Math.random() * 100) % voice.length;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getRandomPitches } from './getRandomPitches.js';
|
||||
import { getRandomPitches } from '../pitch_generation/getRandomPitches.js';
|
||||
import { extractPitchset } from "./extractPitchset.js";
|
||||
import { findVector } from "./findVector.js";
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
const regex = /[A-Gb#]/g;
|
||||
export const extractPitchName = (tonePitchName) => tonePitchName.match(regex).join('');
|
||||
export const extractPitchName = (tonePitchName) => tonePitchName.match(/[A-Gb#]/g).join('');
|
||||
|
||||
@@ -13,9 +13,13 @@ export const findVector = (pitches) => {
|
||||
}
|
||||
|
||||
do {
|
||||
let thing = (sorted[j] - sorted[i]) % 6
|
||||
if (!(intervalClasses.includes(thing))) {
|
||||
intervalClasses.push(thing);
|
||||
let interval = (sorted[j] - sorted[i]);
|
||||
if (interval > 6) {
|
||||
interval = 12 - interval;
|
||||
}
|
||||
|
||||
if (!(intervalClasses.includes(interval))) {
|
||||
intervalClasses.push(interval);
|
||||
}
|
||||
j++;
|
||||
} while (j < sorted.length);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { pitchsets, musicalPitches } from '../harmonyUtil.js';
|
||||
import { extractPitchName } from './extractPitchName.js';
|
||||
import { getRandomIndex } from './getRandomPitches.js';
|
||||
import { getRandomIndex } from '../pitch_generation/getRandomPitches.js';
|
||||
import { findVector } from './findVector.js';
|
||||
|
||||
let callCount = 0;
|
||||
|
||||
@@ -62,11 +63,6 @@ const iteratePitchsets = () => {
|
||||
}
|
||||
}
|
||||
|
||||
let final = iteratePitchsets();
|
||||
console.log(final);
|
||||
|
||||
|
||||
|
||||
function twoPointIteration() {
|
||||
let caught = false;
|
||||
let data = [1,2,3,4,5,6];
|
||||
|
||||
Reference in New Issue
Block a user