From cb3adf7b3a7a9a64cb64ee35e33a85fe49253528 Mon Sep 17 00:00:00 2001 From: Mikayla Dobson Date: Thu, 31 Mar 2022 18:48:24 -0500 Subject: [PATCH] detailing structures --- src/App.css | 4 ++++ src/App.js | 2 ++ src/components/PitchLogic.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/src/App.css b/src/App.css index a2a0f8e..0a789f3 100644 --- a/src/App.css +++ b/src/App.css @@ -1,3 +1,7 @@ +html { + background-color: rgb(177, 216, 230); +} + .App { text-align: center; } diff --git a/src/App.js b/src/App.js index fe2b3e4..8a0aee1 100644 --- a/src/App.js +++ b/src/App.js @@ -12,6 +12,8 @@ function App() { return newFirmus; } + mySequence.getSonorities(); + return (

Procedural Music Generation with Javascript

diff --git a/src/components/PitchLogic.js b/src/components/PitchLogic.js index bcc5978..74e156e 100644 --- a/src/components/PitchLogic.js +++ b/src/components/PitchLogic.js @@ -13,6 +13,21 @@ export const letterNames = { 11: 'A-sharp', } +export const harmony = { + 0: 'perfect', + 1: 'dissonance', + 2: 'imperfect', + 3: 'imperfect', + 4: 'imperfect', + 5: 'perfect', + 6: 'dissonance', + 7: 'perfect', + 8: 'imperfect', + 9: 'imperfect', + 10: 'imperfect', + 11: 'dissonance' +} + export class Pitch { // constructor expects to receive an integer representing a pitch @@ -91,6 +106,7 @@ export class Sequence { // Sequence expects that each cantus is the same length constructor(cantii) { this.sequence = cantii; + this.sonorities = null; } getSequence() { @@ -112,6 +128,23 @@ export class Sequence { } return output; } + + getSonorities() { + // output is an array containing sonorities as raw, inner arrays + const output = []; + for (let i = 0; i < this.sequence[0].melody.length; i++) { + let thing = []; + for (let each of this.sequence) { + thing.push(each.melody[i].note); + } + output.push(thing); + } + console.log(output); + } + + evaluate() { + + } } const cantusHelper = (arr) => {