From 8fb1bc14b861a42efed79cc8924404d5c41214ee Mon Sep 17 00:00:00 2001 From: Michael Stewart Date: Sat, 24 Feb 2024 23:47:23 -0500 Subject: [PATCH] exploratory is almost there! (right?) --- components/chordScaleBucketScore.js | 42 +- components/exploratoryCompose.js | 33 +- components/flatEditor.js | 48 +- components/pasted.json | 1852 ++++++++++++++++++++++ components/source.json | 1156 ++++++++++++++ components/student/create/aural.js | 10 +- components/student/create/explore.js | 237 +-- components/student/create/theoretical.js | 49 +- components/variationsFromMotiveScore.js | 330 +--- lib/flat.js | 818 +--------- lib/variations.js | 33 +- 11 files changed, 3286 insertions(+), 1322 deletions(-) create mode 100644 components/pasted.json create mode 100644 components/source.json diff --git a/components/chordScaleBucketScore.js b/components/chordScaleBucketScore.js index b0b35c8..ff55331 100644 --- a/components/chordScaleBucketScore.js +++ b/components/chordScaleBucketScore.js @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; import Embed from 'flat-embed'; -import { getChordScaleInKey, keyFromScoreJSON } from '../lib/flat'; +import { colorNotes, getChordScaleInKey, keyFromScoreJSON, colorMap} from '../lib/flat'; function ChordScaleBucketScore({ height, @@ -95,7 +95,7 @@ function ChordScaleBucketScore({ // start from bucket, create the notes, add them to measure template['score-partwise'].part[0].measure[0].note = bucket.map( - ({ alter, octave, step, $color = '#00000' }) => { + ({ alter, octave, step, $color = '#000000' }) => { const note = { staff: '1', voice: '1', @@ -142,34 +142,6 @@ function ChordScaleBucketScore({ return resultTransposed; }; - function colorNotes(notes, color) { - for (let i = 0; i < notes.length; i++) { - notes[i].$color = color; - } - } - /** - * Given a measure, and a string consisting of "rgbgrb..." we match the notes of the corresponding measure to that value. - * For example, given a measure (1,2,3) and a string "rgb", the first measure would be colored red, second would be green, third would be green. - */ - const colorMeasures = (measures, colorSpecs) => { - /** - * Colors an array of notes to a given hex color attribute. - */ - const BLACK = '#000000'; - const ORANGE = '#f5bd1f'; - for (let i = 0; i < measures.length; i++) { - if (colorSpecs) { - if (Array.isArray(colorSpecs) && colorSpecs[i]) { - colorNotes(measures[i].note, colorSpecs[i]); - } else if (!Array.isArray(colorSpecs)) { - colorNotes(measures[i].note, colorSpecs); - } - } else { - colorNotes(measures[i], BLACK); - } - } - return measures; - }; useEffect(() => { const embedParams = { // sharingKey: score.sharingKey, @@ -182,6 +154,7 @@ function ChordScaleBucketScore({ controlsFullscreen: false, controlsZoom: false, controlsPrint: false, + displayFirstLinePartsNames: false, toolsetId: '64be80de738efff96cc27edd', }; let computedHeight = 300; @@ -215,7 +188,14 @@ function ChordScaleBucketScore({ } if (colors) { - colorNotes(bucket, colors); + console.log('colors', colors); + let mappedColors = colors; + if(Array.isArray(colors) && colors.length > 0) { + mappedColors = colors.map(colorMap); + } else { + mappedColors = colorMap(colors); + } + colorNotes(bucket, mappedColors); } // console.log('current JSON', copyJSON); diff --git a/components/exploratoryCompose.js b/components/exploratoryCompose.js index a97d831..83a8faa 100644 --- a/components/exploratoryCompose.js +++ b/components/exploratoryCompose.js @@ -5,6 +5,7 @@ import Embed from 'flat-embed'; import { trimScore, pitchesToRests, + colorMeasures, } from '../lib/flat' function ExploratoryCompose({ @@ -13,6 +14,7 @@ function ExploratoryCompose({ onUpdate, referenceScoreJSON, trim, + colors, }) { const [embed, setEmbed] = useState(); const editorRef = React.createRef(); @@ -27,6 +29,7 @@ function ExploratoryCompose({ controlsFullscreen: false, controlsZoom: false, controlsPrint: false, + displayFirstLinePartsNames: false, toolsetId: '64be80de738efff96cc27edd', mode: 'edit' }; @@ -41,9 +44,14 @@ function ExploratoryCompose({ }, [height]); - function createJsonFromReference(reference) { + function createJsonFromReference(reference, colors) { let result = pitchesToRests(JSON.parse(reference)); result = trim ? trimScore(result, trim) : result; + if (colors && colors.length > result['score-partwise'].part[0].measure.length) { + let measures = result['score-partwise'].part[0].measure; + result['score-partwise'].part[0].measure = colorMeasures(measures, colors); + // result['score-partwise'].part[0].measure + } return result; } @@ -55,14 +63,33 @@ function ExploratoryCompose({ .then(() => { if (!referenceScoreJSON) return embed; - const result = createJsonFromReference(referenceScoreJSON) + const result = createJsonFromReference(referenceScoreJSON, colors); return ( embed.loadJSON(result).then(() => { embed.off('noteDetails'); - embed.on('noteDetails', () => { + embed.on('noteDetails', (ev) => { + console.log('noteDetails', ev); + console.log('should color?', colors); embed.getJSON().then((jd) => { const jsonData = jd; + if ( + colors && + jsonData['score-partwise'].part[0].measure.some((m) => + m.note.some((n) => !n.$color || n.$color === '#000000') + ) + ) { + jsonData['score-partwise'].part[0].measure = + colorMeasures( + jsonData['score-partwise'].part[0].measure, + colors + ); + embed.getCursorPosition().then((position) => + embed.loadJSON(jsonData).then(() => { + embed.setCursorPosition(position); + }) + ); + } if (onUpdate) { onUpdate(JSON.stringify(jsonData)); } diff --git a/components/flatEditor.js b/components/flatEditor.js index 1f2f800..81fa7f9 100644 --- a/components/flatEditor.js +++ b/components/flatEditor.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; import Embed from 'flat-embed'; @@ -52,9 +52,18 @@ function FlatEditor({ instrumentName, slice, sliceIdx, - debugMsg + debugMsg, + selectedMeasureNotes }) { - const [json, setJson] = useState(''); + + function onFlatEditorError(e) { + if (debugMsg) { + console.error('debugMsg', debugMsg); + } + console.error('error in flat editor', e); + } + // const [json, setJson] = useState(''); + const json = useRef(''); const [embed, setEmbed] = useState(); const [refId, setRefId] = useState('0'); const editorRef = React.createRef(); @@ -179,8 +188,8 @@ function FlatEditor({ } const resultTransposed = embed.ready().then(() => { - return embed.loadJSON(template); - }); + return embed.loadJSON(template).catch(onFlatEditorError); + }).catch(onFlatEditorError); return resultTransposed; }; @@ -281,6 +290,19 @@ function FlatEditor({ // if a user adds a note that is black or does not have a color assigned to it, then we apply the color from the chord scale pattern to match. score.scoreId === 'blank' && embed.loadJSON(result).then(() => { + embed.off('cursorPosition'); + embed.on('cursorPosition', (ev) => { + console.log('cursorPos', ev) + // selectedMeasureNotes + console.log('json.current', json.current) + if (selectedMeasureNotes && selectedMeasureNotes.current && selectedMeasureNotes.current.length > 0 && json.current !== '') { + console.log('selectedMeasureNotes.current', selectedMeasureNotes.current) + const scoreData = JSON.parse(json.current); + scoreData['score-partwise'].part[0].measure[ev.measureIdx].note = JSON.parse(JSON.stringify(selectedMeasureNotes.current)); + selectedMeasureNotes.current = []; + embed.loadJSON(JSON.stringify(scoreData)).catch(onFlatEditorError); + } + }); embed.off('noteDetails'); embed.on('noteDetails', (info) => { // console.log('noteDetails', info); @@ -304,18 +326,18 @@ function FlatEditor({ if (edit) { embed.setCursorPosition(position); } - }) + }).catch(onFlatEditorError) ); } const data = JSON.stringify(jsonData); // validateScore(jsonData, []) - setJson(data); + json.current = data; if (onUpdate) { onUpdate(data); } }); }); - }) + }).catch(onFlatEditorError) ); } return embed; @@ -354,7 +376,8 @@ function FlatEditor({ // console.error(e); throw e; }) - ); + ) + .catch(onFlatEditorError); } else if (scoreJSON && embed) { // this is currently for the grade creativity screen embed @@ -367,7 +390,7 @@ function FlatEditor({ embed.on('noteDetails', (info) => { embed.getJSON().then((jsonData) => { const data = JSON.stringify(jsonData); - setJson(data); + json.current = data; if (onUpdate) { onUpdate(data); } @@ -376,6 +399,9 @@ function FlatEditor({ } }) .catch((e) => { + if (debugMsg) { + console.error('debugMsg', debugMsg); + } console.error('score not loaded from json'); console.error(e); }); @@ -391,7 +417,7 @@ function FlatEditor({ if (embed) { embed.getJSON().then((jsonData) => { onSubmit(jsonData); - }); + }).catch(onFlatEditorError); } }}>Done Composing} diff --git a/components/pasted.json b/components/pasted.json new file mode 100644 index 0000000..6f69402 --- /dev/null +++ b/components/pasted.json @@ -0,0 +1,1852 @@ +{ + "score-partwise": { + "$version": "3.1", + "identification": { + "creator": { + "content": "Brittany J. Green", + "$type": "composer" + }, + "encoding": { + "software": "Flat", + "encoding-date": "2024-02-25" + }, + "source": "https://flat.io/score/62ec0df25205540013decb45-freedom-2040-the-tomorrow-we-ll-build-melody-concert-pitch-bc?sharingKey=66cf421ace7733fa9d91bd2b10899642c27058fe4cdbdda5d7297db2176bc4ed7b086d12c0de3a47c7e8beafc0b92a4a60a41c72c652205598a3471507ea5a12" + }, + "defaults": { + "scaling": { + "millimeters": "7.2319", + "tenths": "40" + }, + "page-layout": { + "page-height": "1545", + "page-width": "1194", + "page-margins": { + "$type": "both", + "left-margin": "70", + "right-margin": "70", + "top-margin": "70", + "bottom-margin": "70" + } + }, + "system-layout": { + "system-margins": { + "left-margin": "0", + "right-margin": "0" + }, + "system-distance": "121", + "top-system-distance": "70" + }, + "appearance": { + "line-width": [ + { + "content": "0.7487", + "$type": "stem" + }, + { + "content": "5", + "$type": "beam" + }, + { + "content": "0.7487", + "$type": "staff" + }, + { + "content": "0.7487", + "$type": "light barline" + }, + { + "content": "5", + "$type": "heavy barline" + }, + { + "content": "0.7487", + "$type": "leger" + }, + { + "content": "0.7487", + "$type": "ending" + }, + { + "content": "0.7487", + "$type": "wedge" + }, + { + "content": "0.7487", + "$type": "enclosure" + }, + { + "content": "0.7487", + "$type": "tuplet bracket" + } + ], + "note-size": [ + { + "content": "60", + "$type": "grace" + }, + { + "content": "60", + "$type": "cue" + } + ], + "distance": [ + { + "content": "120", + "$type": "hyphen" + }, + { + "content": "7.5", + "$type": "beam" + } + ] + }, + "music-font": { + "$font-family": "Bravura" + }, + "staff-layout": { + "staff-distance": "70.24433413072636" + }, + "$adagio-systemBreakPolicy": { + "maxNbMeasuresPerLine": 4, + "forbiddenCounts": { + + } + } + }, + "credit": [ + { + "credit-type": "title", + "credit-words": "Freedom 2040: The Tomorrow We'll Build Melody - Concert Pitch BC" + } + ], + "part-list": { + "score-part": [ + { + "$id": "P1", + "part-name": { + "content": "Bass Clef", + "$print-object": "no" + }, + "part-abbreviation": { + "content": "Tbn.", + "$print-object": "no" + }, + "score-instrument": { + "$id": "P1-I1", + "instrument-name": "SmartMusicSoftSynth", + "instrument-sound": "brass.trombone", + "virtual-instrument": { + + } + }, + "midi-device": "SmartMusicSoftSynth", + "midi-instrument": { + "$id": "P1-I1", + "midi-channel": "12", + "midi-bank": "15489", + "midi-program": 58, + "pan": "11" + }, + "uuid": "b5df740f-a552-a687-e79c-87ee073ec48b", + "voiceMapping": { + "0": [ + 0 + ] + }, + "staffMapping": [ + { + "voices": [ + 0 + ], + "mainVoiceIdx": 0, + "staffUuid": "6c402e97-f252-438a-e745-40f27e480ad6" + } + ], + "voiceIdxToUuidMapping": { + "0": "1da43ccc-c300-6740-7cf9-6b445b100dc9" + }, + "voiceUuidToIdxMapping": { + "1da43ccc-c300-6740-7cf9-6b445b100dc9": 0 + } + } + ] + }, + "part": [ + { + "$id": "P1", + "measure": [ + { + "$number": "1", + "$width": "179", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "3", + "step": "E", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "32nd", + "$color": "#E75B5C", + "isRest": false, + "oPos": 6, + "uPos": 7, + "split": true, + "beam": [ + { + "$number": "1", + "content": "begin" + }, + { + "$number": "2", + "content": "begin" + }, + { + "$number": "3", + "content": "forward hook" + } + ] + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 1 + }, + "type": "16th", + "$color": "#E75B5C", + "isRest": false, + "oPos": 0, + "uPos": 1, + "beam": [ + { + "$number": "1", + "content": "continue" + }, + { + "$number": "2", + "content": "continue" + } + ] + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "B", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 3 + }, + "type": "16th", + "$color": "#E75B5C", + "isRest": false, + "oPos": 2, + "uPos": 3, + "beam": [ + { + "$number": "1", + "content": "continue" + }, + { + "$number": "2", + "content": "continue" + } + ] + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 5 + }, + "type": "16th", + "$color": "#E75B5C", + "isRest": false, + "oPos": 4, + "uPos": 5, + "beam": [ + { + "$number": "1", + "content": "continue" + }, + { + "$number": "2", + "content": "continue" + } + ] + }, + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "3", + "step": "E", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 7 + }, + "type": "32nd", + "$color": "#E75B5C", + "isRest": false, + "oPos": 6, + "uPos": 7, + "beam": [ + { + "$number": "1", + "content": "end" + }, + { + "$number": "2", + "content": "end" + }, + { + "$number": "3", + "content": "backward hook" + } + ] + } + ], + "attributes": [ + { + "divisions": "8", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + }, + "$adagio-time": { + "beats": "1", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "sound": [ + { + "$adagio-swing": { + "swing": false + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + } + }, + { + "$tempo": "120", + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + } + } + ], + "direction": [ + { + "$placement": "above", + "staff": "1", + "$adagio-location": { + "timePos": 0 + }, + "direction-type": { + "metronome": { + "per-minute": "120", + "beat-unit": "quarter" + } + }, + "noteBefore": -1, + "$adagio-isFirst": true + } + ], + "$adagio-beatsList": [ + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "2", + "$width": "44", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#E75B5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "3", + "$width": "65", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "A", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#265C5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "4", + "$width": "45", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#E75B5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "5", + "$width": "63", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#E75B5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "6", + "$width": "55", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "C" + }, + "kind": { + "content": "minor", + "$halign": "center", + "$text": "m" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#265C5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "7", + "$width": "63", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "B", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "bass": { + "bass-step": "D" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#4390E2", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "8", + "$width": "44", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#E75B5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "9", + "$width": "62", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#E75B5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "10", + "$width": "44", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "A", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#265C5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "11", + "$width": "67", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "B", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#4390E2", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "12", + "$width": "44", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#E75B5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "13", + "$width": "63", + "harmony": [ + { + "root": { + "root-step": "C" + }, + "kind": "minor", + "$adagio-kind": "minor", + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "$type": "explicit", + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#265C5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "14", + "$width": "51", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "A", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#265C5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#265C5C", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "15", + "$width": "53", + "harmony": [ + { + "root": { + "root-step": "B", + "root-alter": "-1" + }, + "kind": "major", + "$adagio-kind": "major", + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "$type": "explicit", + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#4390E2", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#4390E2", + "type": "quarter" + } + ], + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + }, + { + "$number": "16", + "$width": "44", + "harmony": [ + { + "$default-y": "40", + "root": { + "root-step": "E", + "root-alter": "-1" + }, + "kind": { + "content": "major", + "$halign": "center", + "$text": "" + }, + "$adagio-location": { + "timePos": 0, + "dpq": 8 + }, + "staff": "1", + "$placement": "above", + "noteBefore": -1 + } + ], + "note": [ + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 0 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 8 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 16 + }, + "$color": "#E75B5C", + "type": "quarter" + }, + { + "rest": { + + }, + "duration": "8", + "$adagio-location": { + "timePos": 24 + }, + "$color": "#E75B5C", + "type": "quarter" + } + ], + "barline": { + "$location": "right", + "bar-style": "light-heavy", + "$adagio-location": { + "timePos": 32, + "dpq": 8 + }, + "noteBefore": 3 + }, + "attributes": [ + { + "$adagio-time": { + "beats": "4", + "beat-type": "4" + }, + "noteBefore": -1, + "$adagio-location": { + "timePos": 0, + "dpq": 1 + } + } + ], + "$adagio-beatsList": [ + 1, + 1, + 1, + 1 + ], + "$adagio-restsInsideBeams": false + } + ], + "uuid": "b5df740f-a552-a687-e79c-87ee073ec48b" + } + ], + "measure-list": { + "score-measure": [ + { + "uuid": "4aff7f54-e591-b150-3722-6d307d492d5f" + }, + { + "uuid": "e46ebd5c-0021-2132-2df7-fd93d834cbeb" + }, + { + "uuid": "c70cac65-0d38-1424-554f-553e2337fef6" + }, + { + "uuid": "ab720bba-4190-6993-0579-8bdfe1bbfb4a" + }, + { + "uuid": "5bbca97e-fb80-c283-cf76-f2dee933b5bb" + }, + { + "uuid": "aaafab19-e95f-3b55-41b9-ce0458286fe1" + }, + { + "uuid": "aca1df6a-b73a-3487-eb50-efe1facd854d" + }, + { + "uuid": "142dfc0b-6a65-9309-7d13-6e0652a7128b" + }, + { + "uuid": "dad683ea-a2d6-5255-b65d-ed9cb24a274d" + }, + { + "uuid": "b1f6e36b-ec30-d5df-9982-b28b8e3e204b" + }, + { + "uuid": "7b987ed8-1e2c-7dd7-3e72-f4b7b41c8b28" + }, + { + "uuid": "5ed15da9-79ad-4126-a599-a9053fa1b3c7" + }, + { + "uuid": "9401461c-1148-e775-7dfe-5bf112988efc" + }, + { + "uuid": "830a61d8-6769-1fed-1b2d-93fe46d16a75" + }, + { + "uuid": "15286491-e4af-c76e-7ecd-b11ec26a10b0" + }, + { + "uuid": "1782cf56-edeb-f270-0544-43fe7ec63f2c" + } + ] + }, + "$adagio-formatVersion": 55, + "work": { + "work-title": "Freedom 2040: The Tomorrow We'll Build Melody - Concert Pitch BC" + } + } +} diff --git a/components/source.json b/components/source.json new file mode 100644 index 0000000..33f1b43 --- /dev/null +++ b/components/source.json @@ -0,0 +1,1156 @@ +{ + "current": { + "score-partwise": { + "part-list": { + "score-part": [ + { + "part-name": { + "content": "Bass Clef", + "$print-object": "no" + }, + "voiceMapping": { + "0": [ + 0 + ] + }, + "staffMapping": [ + { + "voices": [ + 0 + ], + "mainVoiceIdx": 0, + "staffUuid": "6c402e97-f252-438a-e745-40f27e480ad6" + } + ], + "voiceIdxToUuidMapping": { + "0": "1da43ccc-c300-6740-7cf9-6b445b100dc9" + }, + "voiceUuidToIdxMapping": { + "1da43ccc-c300-6740-7cf9-6b445b100dc9": 0 + }, + "part-abbreviation": { + "content": "Tbn.", + "$print-object": "no" + }, + "score-instrument": { + "$id": "P1-I1", + "instrument-name": "SmartMusicSoftSynth", + "instrument-sound": "brass.trombone", + "virtual-instrument": {} + }, + "$id": "P1", + "uuid": "P1" + } + ] + }, + "part": [ + { + "measure": [ + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 2 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 4 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 6 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 2 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 4 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 6 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 7, + "split": true + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 1 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 0, + "uPos": 1 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 3 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 2, + "uPos": 3 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 5 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 5 + }, + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 7 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 7 + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 8 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 2 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 0, + "uPos": 2 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 4 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 2, + "uPos": 4 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 6 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 6 + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 7, + "split": true + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 9 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 3 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 0, + "uPos": 3 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 5 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 2, + "uPos": 5 + }, + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 7 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 7 + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 2 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 4 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 6 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 2 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 4 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 6 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 2 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 4 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 6 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 7, + "split": true + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 1 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 0, + "uPos": 1 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 3 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 2, + "uPos": 3 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 5 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 5 + }, + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 7 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 7 + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 8 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 2 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 0, + "uPos": 2 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 4 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 2, + "uPos": 4 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 6 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 6 + } + ], + "$number": "1", + "barline": { + "bar-style": "light-barline", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + }, + { + "note": [ + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 7, + "split": true + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "A", + "alter": "-1" + }, + "$adagio-location": { + "timePos": 0 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 6, + "uPos": 9 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "2", + "step": "G" + }, + "$adagio-location": { + "timePos": 3 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 0, + "uPos": 3 + }, + { + "staff": "1", + "voice": "1", + "duration": "2", + "pitch": { + "octave": "3", + "step": "G" + }, + "$adagio-location": { + "timePos": 5 + }, + "type": "quarter", + "$color": "#265C5C", + "isRest": false, + "oPos": 2, + "uPos": 5 + }, + { + "staff": "1", + "voice": "1", + "duration": "1", + "pitch": { + "octave": "3", + "step": "D" + }, + "$adagio-location": { + "timePos": 7 + }, + "type": "eighth", + "$color": "#265C5C", + "isRest": false, + "oPos": 4, + "uPos": 7 + } + ], + "$number": "1", + "barline": { + "bar-style": "light-heavy", + "noteBefore": -1 + }, + "attributes": [ + { + "divisions": "2", + "time": { + "beats": "4", + "beat-type": "4" + }, + "clef": { + "sign": "F", + "line": "4" + }, + "key": { + "fifths": "-3" + }, + "staff-details": { + "staff-lines": "5" + } + } + ] + } + ], + "$id": "P1", + "uuid": "P1" + } + ] + } + } +} \ No newline at end of file diff --git a/components/student/create/aural.js b/components/student/create/aural.js index 16b8013..aec5307 100644 --- a/components/student/create/aural.js +++ b/components/student/create/aural.js @@ -125,7 +125,7 @@ export default function CreativityAuralActivity() { height={150} referenceScoreJSON={json} chordScaleBucket="tonic" - colors={bucketColors.tonic} + colors='tonic' instrumentName={currentAssignment?.instrument} /> @@ -134,7 +134,7 @@ export default function CreativityAuralActivity() { height={150} referenceScoreJSON={json} chordScaleBucket="subdominant" - colors={bucketColors.subdominant} + colors='subdominant' instrumentName={currentAssignment?.instrument} /> @@ -143,7 +143,7 @@ export default function CreativityAuralActivity() { height={150} referenceScoreJSON={json} chordScaleBucket="dominant" - colors={bucketColors.dominant} + colors='dominant' instrumentName={currentAssignment?.instrument} /> @@ -162,9 +162,7 @@ export default function CreativityAuralActivity() { composition = data; }} orig={json} - colors={currentAssignment?.part?.chord_scale_pattern?.map( - (color) => bucketColors[color] - )} + colors={currentAssignment?.part?.chord_scale_pattern} /> state.currentUser); @@ -86,7 +104,7 @@ export default function CreativityActivity() { const mutation = useMutation(mutateCreateSubmission({ slug })); - let composition = ''; // FIXME: why isn't this useState??? + // let composition = ''; // FIXME: why isn't this useState??? // const currentAssignment = assignments && assignments?.filter((assn) => assn.part.piece.slug === piece && assn.activity.activity_type.category === actCategory)?.[0] const currentAssignment = @@ -121,7 +139,7 @@ export default function CreativityActivity() { slug, assignmentId: currentAssignment.id, audio, - composition, + composition: composition.current, submissionId, }) ); @@ -131,144 +149,171 @@ export default function CreativityActivity() { scoreJSON = JSON.parse(flatIOScoreForTransposition); } - const handleTonicUpdate = useCallback((data) => { - setTonicJson(data); - }, [setTonicJson]); + // const handleTonicUpdate = useCallback((data) => { + // setTonicJson(data); + // }, [setTonicJson]); + + function handleTonicUpdate(data) { + tonicJson.current = data; + } - const handleSubdominantUpdate = useCallback((data) => { - setSubdominantJson(data); - }, [setSubdominantJson]) + // const handleSubdominantUpdate = useCallback((data) => { + // setSubdominantJson(data); + // }, [setSubdominantJson]) + function handleSubdominantUpdate(data) { + subdominantJson.current = data; + } - const handleDominantUpdate = useCallback((data) => { - setDominantJson(data) - }, [setDominantJson]) + // const handleDominantUpdate = useCallback((data) => { + // setDominantJson(data) + // }, [setDominantJson]) + function handleDominantUpdate(data) { + dominantJson.current = data; + } function generateVariations() { if (startedVariationGeneration) return; - - setFinalTonicJson(tonicJson); - setFinalSubdominantJson(subdominantJson); - setFinalDominantJson(dominantJson); + // setFinalTonicJson(tonicJson.current); + // setFinalSubdominantJson(subdominantJson.current); + // setFinalDominantJson(dominantJson.current); setStartedVariationGeneration(true); } - + return flatIOScoreForTransposition ? (
- +
Create a melody one measure in length using only these 5 pitches. You can use rests or note durations from 1/8 - 1/2. -
-
+
+ +
- +
Create a melody one measure in length using only these 5 pitches. You can use rests or note durations from 1/8 - 1/2. -
-
+
+ +
- +
Create a melody one measure in length using only these 5 pitches. You can use rests or note durations from 1/8 - 1/2. -
-
+
+ +
- + {startedVariationGeneration && ( - - - - - + - - - - - + + + + + + + + + + + { + composition.current = data; + console.log('composition updated', data) + }} submittingStatus={mutation.status} orig={melodyJson} - colors={currentAssignment?.part?.chord_scale_pattern?.map( - (color) => bucketColors[color] - )} + colors={currentAssignment?.part?.chord_scale_pattern} + selectedMeasureNotes={selectedMeasureNotes} + debugMsg='final explore composition flateditor instance' /> - + +
)} + ) : ( import('../../flatEditor'), { @@ -45,8 +41,6 @@ const bucketColors = { }; export default function CreativityActivity() { - // const tonicNotes = notes(tonicScoreJSON); - const dispatch = useDispatch(); // I think this should show the melody for the current piece, but in the student's transposition // need to get the student's current assignment @@ -96,9 +90,7 @@ export default function CreativityActivity() { partialScores.push(JSON.stringify(slice)); - const colorSlice = currentAssignment?.part?.chord_scale_pattern?.slice(i, i+MEASURES_PER_STEP).map( - (color) => bucketColors[color] - ) + const colorSlice = currentAssignment?.part?.chord_scale_pattern?.slice(i, i+MEASURES_PER_STEP) partialColors.push(colorSlice); scoreDataRef.current.push({}); } @@ -108,25 +100,8 @@ export default function CreativityActivity() { }, [melodyJson]); - // const assignment = useSelector((state) => state.selectedAssignment); - - // useEffect(() => { - // if (loaded) { - // dispatch( - // fetchSingleStudentAssignment({ - // slug, - // assignmentId: assignment.id, - // }) - // ); - // } - // }, [slug, loaded, assignment]); - - // if (assignments) { - // } - const mutation = useMutation(mutateCreateSubmission({ slug })); - let composition = ''; // FIXME: why isn't this useState??? const currentAssignment = assignments && Object.values(assignments) @@ -143,20 +118,12 @@ export default function CreativityActivity() { (partTransposition) => partTransposition.transposition.name === currentTransposition )?.[0]?.flatio; - - const setJsonWrapper = (data) => { - mutation.mutate({ - submission: { content: data }, - assignmentId: currentAssignment.id, - }); - }; - const submitCreativity = ({ audio, submissionId }) => - dispatch( + const submitCreativity = ({ audio, submissionId }) =>dispatch( postRecording({ slug, assignmentId: currentAssignment.id, audio, - composition, + composition: totalScoreJSON.current, submissionId, }) ); @@ -181,9 +148,6 @@ export default function CreativityActivity() { } } - console.log(scoreDataRef.current, isDoneComposing) - console.log('scoreDataRef.current && scoreDataRef.current.length > 0 && isDoneComposing', scoreDataRef.current && scoreDataRef.current.length > 0 && isDoneComposing) - // const origJSON return flatIOScoreForTransposition ? ( <> @@ -193,21 +157,21 @@ export default function CreativityActivity() { height={150} referenceScoreJSON={melodyJson} chordScaleBucket="tonic" - colors={bucketColors.tonic} + colors='tonic' instrumentName={currentAssignment?.instrument} /> @@ -220,7 +184,6 @@ export default function CreativityActivity() { // scoreData[idx] = data; // }) // scoreData[idx] = {}; - console.log('subScore', idx); return (

Step {idx + 1}

diff --git a/components/variationsFromMotiveScore.js b/components/variationsFromMotiveScore.js index 2bf2749..b129b88 100644 --- a/components/variationsFromMotiveScore.js +++ b/components/variationsFromMotiveScore.js @@ -1,17 +1,11 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; import Embed from 'flat-embed'; -import { pitchesToRests, trimScore } from '../lib/flat'; import { - // elevenVariations, mwCreateVariations, - mwMelodicShift, - mwRhythmicMelodicShift, - mwRhythmicShift, - // reverseFlatScore, - mwRetrograde } from '../lib/variations'; +import { measureNotes } from '../lib/flat'; function VariationsFromMotiveScore({ height, @@ -28,315 +22,11 @@ function VariationsFromMotiveScore({ const [refId, setRefId] = useState('0'); const editorRef = React.createRef(); const [addingNote, setAddingNote] = useState(false); + const variations = useRef(); - function keyFromScoreJSON(pieceScoreJSON) { - const nonNegative = ['C', 'G', 'D', 'A', 'E', 'B', 'F#', 'C#']; // moved from global scope. - const negatives = { - '-1': 'F', - '-2': 'Bb', - '-3': 'Eb', - '-4': 'Ab', - '-5': 'Db', - '-6': 'Gb', - '-7': 'Cb', - }; - const CIRCLE_OF_FIFTHS = { ...nonNegative, ...negatives }; - const minOctave = pieceScoreJSON['score-partwise'].part[0].measure.reduce( - // Gets the min octave within all the measures. - (measureMinOctave, measure) => { - const minForMeasure = measure.note.reduce((noteMinOctave, note) => { - // Gets the min octave within a measure. - if (note.pitch && note.pitch.octave !== undefined) { - // *FIX* Without this statement we get undefined values. Set a default to 0. - - const thisOctave = parseInt(note.pitch.octave, 10); - if (thisOctave < noteMinOctave) { - return thisOctave; - } - return noteMinOctave; - } - // If we get rid of this statement it moves all our octaves up to almost our result. The notes are now off by approx. 1 line. - return 100; - }, 100); - - if (minForMeasure < measureMinOctave) { - return minForMeasure; - } - return measureMinOctave; - }, - 100 - ); // TODO: what if octave can be higher than 10? - const keySignature = { - repr: CIRCLE_OF_FIFTHS[ - pieceScoreJSON['score-partwise'].part[0].measure[0].attributes[0].key - .fifths - ], - keyAsJSON: - pieceScoreJSON['score-partwise'].part[0].measure[0].attributes[0].key, - clef: pieceScoreJSON['score-partwise'].part[0].measure[0].attributes[0] - .clef, - minOctave, - }; - return keySignature; - } - function getChordScaleInKey(chordScale, keyObj) { - const tonicBucketIntervals = [ - // musical facts. - { name: '1', offset: 0 }, // Unison - { name: '2', offset: 2 }, // Major 2nd - { name: '3', offset: 4 }, // Major 3rd - { name: '5', offset: 7 }, // Perfect 5th - { name: '6', offset: 9 }, // Major 6th - ]; - - const subdominantBucketIntervals = [ - { name: '1', offset: 0 }, // Unison - { name: '2', offset: 2 }, // Major 2nd - { name: '4', offset: 5 }, // Perfect 4th - { name: '5', offset: 7 }, // Perfect 5th - { name: '6', offset: 9 }, // Major 6th - ]; - - const dominantBucketIntervals = [ - { name: '2', offset: 2 }, // Major 2nd - { name: '4', offset: 5 }, // Perfect 4th - { name: '5', offset: 7 }, // Perfect 5th - { name: '6', offset: 9 }, // Major 6th - { name: '7', offset: 11 }, // 7th - ]; - - const chordScaleIntervals = { - tonic: tonicBucketIntervals, - subdominant: subdominantBucketIntervals, - dominant: dominantBucketIntervals, - }; - - const noteToScaleIdx = { - C: 0, - 'C#': 1, - Db: 1, - D: 2, - 'D#': 3, - Eb: 3, - E: 4, - F: 5, - 'F#': 6, - Gb: 6, - G: 7, - 'G#': 8, - Ab: 8, - A: 9, - 'A#': 10, - Bb: 10, - B: 11, - Cb: 11, - }; - const chromaticScale = [ - { - sharp: { - step: 'C', - alter: '', - }, - flat: { - step: 'C', - alter: '', - }, - }, - { - sharp: { - repr: 'C#', - alter: '1', - step: 'C', - }, - flat: { - repr: 'Db', - alter: '-1', - step: 'D', - }, - }, - { - sharp: { - repr: 'D', - alter: '', - step: 'D', - }, - flat: { - repr: 'D', - alter: '', - step: 'D', - }, - }, - { - sharp: { - repr: 'D#', - alter: '1', - step: 'D', - }, - flat: { - repr: 'Eb', - alter: '-1', - step: 'E', - }, - }, - { - sharp: { - repr: 'E', - alter: '', - step: 'E', - }, - flat: { - repr: 'E', - alter: '', - step: 'E', - }, - }, - { - sharp: { - repr: 'F', - alter: '', - step: 'F', - }, - flat: { - repr: 'F', - alter: '', - step: 'F', - }, - }, - { - sharp: { - repr: 'F#', - alter: '1', - step: 'F', - }, - flat: { - repr: 'Gb', - alter: '-1', - step: 'G', - }, - }, - { - sharp: { - repr: 'G', - alter: '', - step: 'G', - }, - flat: { - repr: 'G', - alter: '', - step: 'G', - }, - }, - { - sharp: { - repr: 'G#', - alter: '1', - step: 'G', - }, - flat: { - repr: 'Ab', - alter: '-1', - step: 'A', - }, - }, - { - sharp: { - repr: 'A', - alter: '', - step: 'A', - }, - flat: { - repr: 'A', - alter: '', - step: 'A', - }, - }, - { - sharp: { - repr: 'A#', - alter: '1', - step: 'A', - }, - flat: { - repr: 'Bb', - alter: '-1', - step: 'B', - }, - }, - { - sharp: { - repr: 'B', - alter: '', - step: 'B', - }, - flat: { - repr: 'Cb', - alter: '-1', - step: 'C', - }, - }, - ]; - - const key = keyObj.repr; - let alter = 'sharp'; - if (key.includes('b') || key === 'F') { - // musician said so (that F is also flat, and that all else are sharp) - alter = 'flat'; - } - const firstPitchIdx = noteToScaleIdx[key]; - const firstPitchObj = chromaticScale[firstPitchIdx]; - let octave = keyObj.minOctave; - - // start from the pitch that represents the key of the score and find the 5 pitches with the corresponsing relationship from the chordScaleIntervals - const mapped = chordScaleIntervals[chordScale].map((interval) => { - if ( - // if we reach the end of the array, go back to the front (circular array essentially) and increment octave - Math.floor((firstPitchIdx + interval.offset) / chromaticScale.length) > - 0 - ) { - octave = keyObj.minOctave + 1; - } - - const result = - chromaticScale[ - (firstPitchIdx + interval.offset) % chromaticScale.length - ][alter]; - result.octave = `${octave}`; - return result; - }); - return mapped; - } - - function colorNotes(notes, color) { - for (let i = 0; i < notes.length; i++) { - notes[i].$color = color; - } - } - /** - * Given a measure, and a string consisting of "rgbgrb..." we match the notes of the corresponding measure to that value. - * For example, given a measure (1,2,3) and a string "rgb", the first measure would be colored red, second would be green, third would be green. - */ - const colorMeasures = (measures, colorSpecs) => { - /** - * Colors an array of notes to a given hex color attribute. - */ - const BLACK = '#000000'; - const ORANGE = '#f5bd1f'; - for (let i = 0; i < measures.length; i++) { - if (colorSpecs) { - if (Array.isArray(colorSpecs) && colorSpecs[i]) { - colorNotes(measures[i].note, colorSpecs[i]); - } else if (!Array.isArray(colorSpecs)) { - colorNotes(measures[i].note, colorSpecs); - } - } else { - colorNotes(measures[i], BLACK); - } - } - return measures; - }; useEffect(() => { - console.log('got in here'); + // console.log('got in here'); const embedParams = { // sharingKey: score.sharingKey, appId: '60a51c906bcde01fc75a3ad0', @@ -360,24 +50,24 @@ function VariationsFromMotiveScore({ width: '100%', embedParams, }; - console.log('create embed'); + // console.log('create embed'); const createdEmbed = new Embed(editorRef.current, allParams); setEmbed(createdEmbed); if (createdEmbed) { createdEmbed.ready().then(() => { // listen for cursor position + + variations.current = mwCreateVariations(referenceScoreJSON); if (onSelect) { createdEmbed.off('cursorPosition'); createdEmbed.on('cursorPosition', (ev) =>{ console.log('curosrpos', ev, ev.measureIdx) - onSelect(ev.measureIdx); + onSelect(measureNotes(variations.current, ev.measureIdx)); }) ; } - - const variations = mwCreateVariations(referenceScoreJSON); - console.log('algortihmically generated variations', variations); - createdEmbed.loadJSON(variations); + console.log('algorithmically generated variations', variations); + createdEmbed.loadJSON(variations.current); //TODO: save/set the measures array from this `variations` json obj }); diff --git a/lib/flat.js b/lib/flat.js index ee3ecb5..70624fb 100644 --- a/lib/flat.js +++ b/lib/flat.js @@ -1,776 +1,15 @@ -const tonicScoreJSON = { - 'score-partwise': { - $version: '3.1', - 'part-list': { - 'score-part': [ - { - 'part-name': 'Piccolo', - voiceMapping: { - 0: [0], - }, - staffMapping: [ - { - mainVoiceIdx: 0, - voices: [0], - staffUuid: 'ebf5e0b5-2865-87bb-8dde-2f98ab69c5ea', - }, - ], - voiceIdxToUuidMapping: { - 0: '37ebabb9-a367-0bc8-4bf0-bf3b9a3b45cd', - }, - voiceUuidToIdxMapping: { - '37ebabb9-a367-0bc8-4bf0-bf3b9a3b45cd': 0, - }, - 'part-abbreviation': 'Picc.', - 'score-instrument': { - 'instrument-name': 'Piccolo', - $id: 'P1-I1', - }, - 'midi-instrument': { - volume: '100', - 'midi-program': 73, - $id: 'P1-I1', - 'midi-channel': '1', - }, - $id: 'P1', - uuid: 'ca26e132-61b3-27ab-2e64-508c94c82a31', - }, - ], - }, - 'measure-list': { - 'score-measure': [ - { - uuid: '5ab14634-c45c-60ef-c51c-a1d47a42218a', - }, - ], - }, - part: [ - { - measure: [ - { - note: [ - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'E', - alter: '-1', - }, - '$adagio-location': { - timePos: 0, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'F', - }, - '$adagio-location': { - timePos: 1, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'G', - }, - '$adagio-location': { - timePos: 2, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'B', - alter: '-1', - }, - '$adagio-location': { - timePos: 3, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '5', - step: 'C', - }, - '$adagio-location': { - timePos: 4, - }, - type: 'quarter', - }, - ], - harmony: [], - $number: '1', - barline: { - $location: 'right', - 'bar-style': 'light-heavy', - '$adagio-location': { - dpq: 1, - timePos: 5, - }, - noteBefore: 4, - }, - attributes: [ - { - divisions: '1', - time: { - beats: '5', - 'beat-type': '4', - }, - clef: { - sign: 'G', - line: '2', - }, - key: { - fifths: '-3', - }, - transpose: { - chromatic: '0', - 'octave-change': '1', - }, - 'staff-details': { - 'staff-lines': '5', - }, - '$adagio-time': { - beats: '5', - 'beat-type': '4', - }, - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - ], - sound: [ - { - '$adagio-swing': { - swing: false, - }, - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - { - $tempo: '80', - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - ], - direction: [ - { - $placement: 'above', - staff: '1', - '$adagio-location': { - timePos: 0, - }, - 'direction-type': { - metronome: { - 'per-minute': '80', - 'beat-unit': 'quarter', - }, - }, - noteBefore: -1, - '$adagio-isFirst': true, - }, - ], - '$adagio-beatsList': [1, 1, 1, 1, 1], - }, - ], - $id: 'P1', - uuid: 'ca26e132-61b3-27ab-2e64-508c94c82a31', - }, - ], - defaults: { - scaling: { - millimeters: '7', - tenths: '40', - }, - 'page-layout': { - 'page-height': '1596.5714285714287', - 'page-width': '1233.7142857142858', - 'page-margins': { - $type: 'both', - 'top-margin': '38.857142857142854', - 'bottom-margin': '38.857142857142854', - 'left-margin': '38.857142857142854', - 'right-margin': '38.857142857142854', - }, - }, - 'system-layout': { - 'system-distance': '115.2', - }, - 'staff-layout': { - 'staff-distance': '72.57142857142857', - }, - '$adagio-measureNumberingStart': 1, - 'word-font': { - '$font-family': 'Century Schoolbook L', - }, - '$adagio-systemBreakPolicy': { - maxNbMeasuresPerLine: 4, - forbiddenCounts: {}, - }, - }, - '$adagio-formatVersion': 55, - credit: [ - { - 'credit-type': 'title', - 'credit-words': 'E♭ Tonic Chord Scale Bucket', - }, - ], - work: { - 'work-title': 'E♭ Tonic Chord Scale Bucket', - }, - identification: { - encoding: { - software: 'Flat', - 'encoding-date': '2023-09-16', - }, - source: - 'https://flat.io/score/64c0993a9638a82f130dc549-e-tonic-chord-scale-bucket?sharingKey=bd6ef69e50c7822c1f2fc5b262c553b048cf1f60add3ee9cdb1e85536b8f0d18de20b69fe6089b40e4910ba68d762c4218f00410d5d07368f021ae7298fb99c7', - }, - }, -}; -const subdominantScoreJSON = { - 'score-partwise': { - $version: '3.1', - 'part-list': { - 'score-part': [ - { - 'part-name': 'Piccolo', - voiceMapping: { - 0: [0], - }, - staffMapping: [ - { - mainVoiceIdx: 0, - voices: [0], - staffUuid: '8de6d8ff-b816-8d59-ac60-d8fd60709b13', - }, - ], - voiceIdxToUuidMapping: { - 0: '7fbec95f-e09e-edc8-32fa-9222af710a4c', - }, - voiceUuidToIdxMapping: { - '7fbec95f-e09e-edc8-32fa-9222af710a4c': 0, - }, - 'part-abbreviation': 'Picc.', - 'score-instrument': { - 'instrument-name': 'Piccolo', - $id: 'P1-I1', - }, - 'midi-instrument': { - 'midi-program': 73, - volume: '100', - $id: 'P1-I1', - 'midi-channel': '1', - }, - $id: 'P1', - uuid: 'f5ffdbb0-ec2b-d8cb-1dee-167d8f7cd6a6', - }, - ], - }, - 'measure-list': { - 'score-measure': [ - { - uuid: '32e0dceb-6014-dfe2-b464-de9d587e7f1e', - }, - ], - }, - part: [ - { - measure: [ - { - note: [ - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'F', - }, - '$adagio-location': { - timePos: 0, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'A', - alter: '-1', - }, - '$adagio-location': { - timePos: 1, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'B', - alter: '-1', - }, - '$adagio-location': { - timePos: 2, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '5', - step: 'C', - }, - '$adagio-location': { - timePos: 3, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '5', - step: 'E', - alter: '-1', - }, - '$adagio-location': { - timePos: 4, - }, - type: 'quarter', - }, - ], - harmony: [], - $number: '1', - barline: { - $location: 'right', - 'bar-style': 'light-heavy', - '$adagio-location': { - dpq: 1, - timePos: 5, - }, - noteBefore: 4, - }, - attributes: [ - { - divisions: '1', - time: { - beats: '5', - 'beat-type': '4', - }, - clef: { - sign: 'G', - line: '2', - }, - key: { - fifths: '-3', - }, - transpose: { - chromatic: '0', - 'octave-change': '1', - }, - 'staff-details': { - 'staff-lines': '5', - }, - '$adagio-time': { - beats: '5', - 'beat-type': '4', - }, - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - ], - sound: [ - { - '$adagio-swing': { - swing: false, - }, - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - { - $tempo: '80', - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - ], - direction: [ - { - $placement: 'above', - staff: '1', - '$adagio-location': { - timePos: 0, - }, - 'direction-type': { - metronome: { - 'per-minute': '80', - 'beat-unit': 'quarter', - }, - }, - noteBefore: -1, - '$adagio-isFirst': true, - }, - ], - '$adagio-beatsList': [1, 1, 1, 1, 1], - }, - ], - $id: 'P1', - uuid: 'f5ffdbb0-ec2b-d8cb-1dee-167d8f7cd6a6', - }, - ], - defaults: { - scaling: { - millimeters: '7', - tenths: '40', - }, - 'page-layout': { - 'page-height': '1596.5714285714287', - 'page-width': '1233.7142857142858', - 'page-margins': { - $type: 'both', - 'top-margin': '38.857142857142854', - 'bottom-margin': '38.857142857142854', - 'left-margin': '38.857142857142854', - 'right-margin': '38.857142857142854', - }, - }, - 'system-layout': { - 'system-distance': '115.2', - }, - 'staff-layout': { - 'staff-distance': '72.57142857142857', - }, - '$adagio-measureNumberingStart': 1, - 'word-font': { - '$font-family': 'Century Schoolbook L', - }, - '$adagio-systemBreakPolicy': { - maxNbMeasuresPerLine: 4, - forbiddenCounts: {}, - }, - }, - '$adagio-formatVersion': 55, - credit: [ - { - 'credit-type': 'title', - 'credit-words': 'E♭ Subdominant Chord Scale Bucket', - }, - ], - work: { - 'work-title': 'E♭ Subdominant Chord Scale Bucket', - }, - identification: { - encoding: { - software: 'Flat', - 'encoding-date': '2023-09-16', - }, - source: - 'https://flat.io/score/64c099d94d7650a3d9ba7598-e-subdominant-chord-scale-bucket?sharingKey=19663d1b0e19b5f9ff11ad28b80c45546693499c94ed5d7c992bdeb9f7c58e968a219144a3aabaa05845947089607d51d25a37fe94a3ca6fcf14e67cff361c3d', - }, - }, +const CHORD_SCALE_COLORS = { + tonic: '#E75B5C', + subdominant: '#265C5C', + dominant: '#4390E2', + applied: '#CBA338', }; -const dominantScoreJSON = { - 'score-partwise': { - $version: '3.1', - 'part-list': { - 'score-part': [ - { - 'part-name': 'Piccolo', - voiceMapping: { - 0: [0], - }, - staffMapping: [ - { - mainVoiceIdx: 0, - voices: [0], - staffUuid: 'b71045f4-b233-6960-f5bb-b4f7938b1b6b', - }, - ], - voiceIdxToUuidMapping: { - 0: '64eb968a-7841-c741-d082-2d5fba409f7c', - }, - voiceUuidToIdxMapping: { - '64eb968a-7841-c741-d082-2d5fba409f7c': 0, - }, - 'part-abbreviation': 'Picc.', - 'score-instrument': { - 'instrument-name': 'Piccolo', - $id: 'P1-I1', - }, - 'midi-instrument': { - 'midi-program': 73, - volume: '100', - $id: 'P1-I1', - 'midi-channel': '1', - }, - $id: 'P1', - uuid: '878f5374-8f99-6297-ac1c-8e9f58827dc0', - }, - ], - }, - 'measure-list': { - 'score-measure': [ - { - uuid: '003069e7-b981-1ff6-cdfd-7b3ef6cf83fb', - }, - ], - }, - part: [ - { - measure: [ - { - note: [ - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'D', - }, - '$adagio-location': { - timePos: 0, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'F', - }, - '$adagio-location': { - timePos: 1, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'A', - alter: '-1', - }, - '$adagio-location': { - timePos: 2, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '4', - step: 'B', - alter: '-1', - }, - '$adagio-location': { - timePos: 3, - }, - type: 'quarter', - }, - { - staff: '1', - voice: '1', - duration: '1', - pitch: { - octave: '5', - step: 'C', - }, - '$adagio-location': { - timePos: 4, - }, - type: 'quarter', - }, - ], - harmony: [], - $number: '1', - barline: { - $location: 'right', - 'bar-style': 'light-heavy', - '$adagio-location': { - dpq: 1, - timePos: 5, - }, - noteBefore: 4, - }, - attributes: [ - { - divisions: '1', - time: { - beats: '5', - 'beat-type': '4', - }, - clef: { - sign: 'G', - line: '2', - }, - key: { - fifths: '-3', - }, - transpose: { - chromatic: '0', - 'octave-change': '1', - }, - 'staff-details': { - 'staff-lines': '5', - }, - '$adagio-time': { - beats: '5', - 'beat-type': '4', - }, - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - ], - sound: [ - { - '$adagio-swing': { - swing: false, - }, - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - { - $tempo: '80', - noteBefore: -1, - '$adagio-location': { - timePos: 0, - dpq: 1, - }, - }, - ], - direction: [ - { - $placement: 'above', - staff: '1', - '$adagio-location': { - timePos: 0, - }, - 'direction-type': { - metronome: { - 'per-minute': '80', - 'beat-unit': 'quarter', - }, - }, - noteBefore: -1, - '$adagio-isFirst': true, - }, - ], - '$adagio-beatsList': [1, 1, 1, 1, 1], - }, - ], - $id: 'P1', - uuid: '878f5374-8f99-6297-ac1c-8e9f58827dc0', - }, - ], - defaults: { - scaling: { - millimeters: '7', - tenths: '40', - }, - 'page-layout': { - 'page-height': '1596.5714285714287', - 'page-width': '1233.7142857142858', - 'page-margins': { - $type: 'both', - 'top-margin': '38.857142857142854', - 'bottom-margin': '38.857142857142854', - 'left-margin': '38.857142857142854', - 'right-margin': '38.857142857142854', - }, - }, - 'system-layout': { - 'system-distance': '115.2', - }, - 'staff-layout': { - 'staff-distance': '72.57142857142857', - }, - '$adagio-measureNumberingStart': 1, - 'word-font': { - '$font-family': 'Century Schoolbook L', - }, - '$adagio-systemBreakPolicy': { - maxNbMeasuresPerLine: 4, - forbiddenCounts: {}, - }, - }, - '$adagio-formatVersion': 55, - credit: [ - { - 'credit-type': 'title', - 'credit-words': 'E♭ Dominant Chord Scale Bucket', - }, - ], - work: { - 'work-title': 'E♭ Dominant Chord Scale Bucket', - }, - identification: { - encoding: { - software: 'Flat', - 'encoding-date': '2023-09-16', - }, - source: - 'https://flat.io/score/64c09a22168dab0ff8733c35-e-dominant-chord-scale-bucket?sharingKey=adaf25a2ea6be22b81af0658dbff5d0537625d171f9c2fed3406c6ad39a24c3ffaf87cfc662672f5aa11d0d8d9f09989567bde6c8d028586b11873d7596030c0', - }, - }, -}; +function colorMap (color) { + return CHORD_SCALE_COLORS[color]; +} + + const pitchesToRests = (pieceScoreJSON) => { const getMeasureTimeSignature = (measure, current) => { let duration = 8; // default to 8 because i reasoned it might be a quarter in some cases @@ -822,7 +61,6 @@ const pitchesToRests = (pieceScoreJSON) => { }); } - // const bucketColors = ['#E75B5C', '#265C5C', '#4390E2']; // measure.note = Array(currentTimeSig.maxRests).fill({rest: {}, duration:currentTimeSig.duration}) measure.note = Array.from({ length: currentTimeSig.maxRests }, (i, j) => ({ @@ -1098,18 +336,6 @@ function getChordScaleInKey(chordScale, keyObj) { const notes = (score) => score['score-partwise'].part[0].measure[0].note; -const nonNegative = ['C', 'G', 'D', 'A', 'E', 'B', 'F#', 'C#']; -const negatives = { - '-1': 'F', - '-2': 'Bb', - '-3': 'Eb', - '-4': 'Ab', - '-5': 'Db', - '-6': 'Gb', - '-7': 'Cb', -}; -const CIRCLE_OF_FIFTHS = Object.assign({}, nonNegative, negatives); - function keyFromScoreJSON(pieceScoreJSON) { const nonNegative = ['C', 'G', 'D', 'A', 'E', 'B', 'F#', 'C#']; // moved from global scope. const negatives = { @@ -1161,18 +387,18 @@ function keyFromScoreJSON(pieceScoreJSON) { return keySignature; } - -const chordScaleFromOrig = (origJSON, scaleBucket) => { //scalebucket as a string eg "t" - const keySignature = keyFromScoreJSON(origJSON); // this is a cheat code: i check the metadata of THIS STUDENT (already accounting for their instrument and the piece's composition key) as a letter like F - const bucket = getChordScaleInKey(scaleBucket, keySignature); -}; - function colorNotes(notes, color) { for (let i = 0; i < notes.length; i++) { notes[i].$color = color; } } +function measureNotes(score, measureIdx) { + console.log('measureNotes(score, measureIdx)', score, measureIdx) + console.log('score has score-partwise?', score['score-partwise']) + return score['score-partwise'].part[0].measure[measureIdx].note; +} + /** * Given a measure, and a string consisting of "rgbgrb..." we match the notes of the corresponding measure to that value. * For example, given a measure (1,2,3) and a string "rgb", the first measure would be colored red, second would be green, third would be green. @@ -1186,9 +412,9 @@ const colorMeasures = (measures, colorSpecs) => { for (let i = 0; i < measures.length; i++) { if (colorSpecs) { if (Array.isArray(colorSpecs) && colorSpecs[i]) { - colorNotes(measures[i].note, colorSpecs[i]); + colorNotes(measures[i].note, CHORD_SCALE_COLORS[colorSpecs[i]]); } else if (!Array.isArray(colorSpecs)) { - colorNotes(measures[i].note, colorSpecs); + colorNotes(measures[i].note, CHORD_SCALE_COLORS[colorSpecs]); } } else { colorNotes(measures[i], BLACK); @@ -1225,10 +451,7 @@ function mergeScores(scores, instrumentName) { export { pitchesToRests, trimScore, - tonicScoreJSON, - subdominantScoreJSON, - dominantScoreJSON, - notes, + // notes, // seems unused sliceScore, nthScoreSlice, nthSliceIdxs, @@ -1237,4 +460,7 @@ export { colorMeasures, colorNotes, mergeScores, + // CHORD_SCALE_COLORS, //not used externally + colorMap, + measureNotes }; diff --git a/lib/variations.js b/lib/variations.js index b5bb3c8..5b5ad82 100644 --- a/lib/variations.js +++ b/lib/variations.js @@ -28,7 +28,7 @@ function correctScore(orig, key, clef, notes, div) { resultAttributes.key = key; resultAttributes.divisions = "" + div; // I think necessary for rendering result['score-partwise']['part'][0].measure[0].note = [...notes]; - console.log("score immediately after correction", result); + // console.log("score immediately after correction", result); return result; } @@ -46,9 +46,9 @@ function correctMeasure(measure) { let alteredMeasure = JSON.parse(JSON.stringify(measure)); // deep copy let origDivisions = alteredMeasure.attributes[0].divisions; // the original division let beatDivision = defaultDiv / origDivisions; // conversion factor for reconstruction - console.log("beatDivision", beatDivision); - console.log("origDivisions", alteredMeasure.attributes[0].divisions); - console.log("inside correctMeasure measure", JSON.parse(JSON.stringify(alteredMeasure))); + // console.log("beatDivision", beatDivision); + // console.log("origDivisions", alteredMeasure.attributes[0].divisions); + // console.log("inside correctMeasure measure", JSON.parse(JSON.stringify(alteredMeasure))); // check if reconstruction necessary let modify = origDivisions != defaultDiv && (alteredMeasure.attributes[0].divisions = defaultDiv); @@ -65,7 +65,7 @@ function correctMeasure(measure) { alteredMeasure.note.forEach((note) => { note.isRest = (Boolean) (note.rest ?? false); }); - console.log(`outgoing corrected Measure w/ isRest property`, [...alteredMeasure.note]); + // console.log(`outgoing corrected Measure w/ isRest property`, [...alteredMeasure.note]); return alteredMeasure; } @@ -125,10 +125,10 @@ function mwRhythmicShift(orig, shift) { // .. bypass shift adjustment for shifts by 2 & 3 const adjShift = bypassAdj ? shift : Math.ceil(shift / measure.attributes[0].divisions); let checkList = pitchList.splice(numNotes - adjShift); - console.log(`For shift = ${shift}, orig measure: `, measure); - console.log("Number of notes in incoming measure: ", numNotes); - console.log(`Passed Shift: ${shift}\nAdjusted Shift: ${adjShift}`); - console.log("Maximum number of notes: ", maxNotes); + // console.log(`For shift = ${shift}, orig measure: `, measure); + // console.log("Number of notes in incoming measure: ", numNotes); + // console.log(`Passed Shift: ${shift}\nAdjusted Shift: ${adjShift}`); + // console.log("Maximum number of notes: ", maxNotes); const updateTimePos = (note) => { note['oPos'] = note['$adagio-location'].timePos; // original position @@ -261,7 +261,7 @@ function mwMergeVariations(orig, measures) { // there was a weird issue with divisions needing to be stringified? measure.attributes[0].divisions = measure.attributes[0].divisions.toString(); }); - console.log("after merge modifications", measures); + // console.log("after merge modifications", measures); result['score-partwise'].part[0].measure = [...measures]; result['score-partwise']['part-list']["score-part"].uuid = "variations"; @@ -284,6 +284,7 @@ function mwMergeVariations(orig, measures) { * on that motive */ function mwCreateVariations(origStr) { + // console.log('mwCreateVariations', origStr) const orig = JSON.parse(origStr.slice()); if (!orig || !Object.hasOwn(orig, 'score-partwise')) @@ -296,11 +297,11 @@ function mwCreateVariations(origStr) { const correctedScore = correctScore(orig, key, clef, notes, divs); // correct the whole score const givenMeasure = correctedScore['score-partwise'].part[0].measure[0]; // grab the motive... const correctedMeasure = correctMeasure(givenMeasure); // ...then correct it - console.log("incoming score", orig); - console.log(`outgoing key: ${key}; outgoing clef: ${clef}`); - console.log("corrected score", correctedScore); - console.log("given measure", givenMeasure); - console.log("corrected measure", correctedMeasure); + // console.log("incoming score", orig); + // console.log(`outgoing key: ${key}; outgoing clef: ${clef}`); + // console.log("corrected score", correctedScore); + // console.log("given measure", givenMeasure); + // console.log("corrected measure", correctedMeasure); // alternate solution to 8ths bug - does not coalesce yet, and feels lazy. BUT // bit of pseudo-memoization ? @@ -340,7 +341,7 @@ function mwCreateVariations(origStr) { measures[measures.length - 1].barline['bar-style'] = 'light-heavy'; const result = mwMergeVariations(correctedScore, measures); - console.log("returning from createVariations", result); + // console.log("returning from createVariations", result); return result; }