From 785e43a8608ff646bf5592b06c59f10f13b73b90 Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 11:44:18 +0530 Subject: [PATCH 1/9] turtleactions/DrumActions.js: Linting and Prettify --- js/turtleactions/DrumActions.js | 37 +++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/js/turtleactions/DrumActions.js b/js/turtleactions/DrumActions.js index 17fd9c4536..6027a3fb55 100644 --- a/js/turtleactions/DrumActions.js +++ b/js/turtleactions/DrumActions.js @@ -17,11 +17,32 @@ * * Utility methods are in PascalCase. * Action methods are in camelCase. + */ + +/* global Singer,DEFAULTDRUM,DRUMNAMES,last,DEFAULTVOLUME,logo,blocks,MusicBlocks,Mouse,NOISENAMES,_ */ +/* exported setupDrumActions */ +/* + Global Locations + js/utils/utils.js + _ + js/turtleactions/RhythmActions.js + Singer + js/activity.js + logo + js/utils/synthutils.js + DRUMNAMES,NOISENAMES + js/utils/musicutils.js + DEFAULTDRUM + js/logo.js/ + DEFAULTVOLUME + js/blocks.js + blocks + js/js-export/export.js + MusicBlocks, Mouse */ /** * Sets up all the methods related to different actions for each block in Drum palette. - * * @returns {void} */ function setupDrumActions() { @@ -82,8 +103,8 @@ function setupDrumActions() { const noteBeatValue = 4; - const __callback = - () => tur.singer.inNoteBlock.splice(tur.singer.inNoteBlock.indexOf(blk), 1); + const __callback = () => + tur.singer.inNoteBlock.splice(tur.singer.inNoteBlock.indexOf(blk), 1); Singer.processNote(noteBeatValue, false, blk, turtle, __callback); } @@ -117,11 +138,10 @@ function setupDrumActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.drumStyle.pop(); tur.singer.pitchDrumTable = {}; }; @@ -160,11 +180,10 @@ function setupDrumActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => tur.singer.drumStyle.pop(); + const __listener = () => tur.singer.drumStyle.pop(); logo.setTurtleListener(turtle, listenerName, __listener); if (logo.inRhythmRuler) { From 12113c78b0a6baf4ddb6bec14f210c5ef785fb12 Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 12:11:09 +0530 Subject: [PATCH 2/9] turtleactions/MeterActions.js: Linting and Prettify --- js/turtleactions/MeterActions.js | 116 ++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/js/turtleactions/MeterActions.js b/js/turtleactions/MeterActions.js index a96a8481a4..b446a47b3c 100644 --- a/js/turtleactions/MeterActions.js +++ b/js/turtleactions/MeterActions.js @@ -14,11 +14,32 @@ * You should have received a copy of the GNU Affero General Public License along with this * library; if not, write to the Free Software Foundation, 51 Franklin Street, Suite 500 Boston, * MA 02110-1335 USA. + */ + +/* global _,logo,Singer,rationalToFraction,_blk,blk,TONEBPM,Queue,turtles,last,MusicBlocks,blocks,Mouse */ +/* exported setupMeterActions */ +/* + Global Locations + js/utils/utils.js + _,rationalToFraction + js/turtleactions/RhythmActions.js + Singer + js/activity.js + logo + js/utils/synthutils.js + DRUMNAMES,NOISENAMES + js/utils/musicutils.js + DEFAULTDRUM + js/logo.js/ + DEFAULTVOLUME,TONEBPM + js/blocks.js + blocks + js/js-export/export.js + MusicBlocks, Mouse */ /** * Sets up all the methods related to different actions for each block in Meter palette. - * * @returns {void} */ function setupMeterActions() { @@ -53,7 +74,9 @@ function setupMeterActions() { } logo.notation.notationMeter( - turtle, tur.singer.beatsPerMeasure, tur.singer.noteValuePerBeat + turtle, + tur.singer.beatsPerMeasure, + tur.singer.noteValuePerBeat ); } @@ -145,7 +168,7 @@ function setupMeterActions() { static onEveryNoteDo(action, isflow, receivedArg, turtle, blk) { const tur = logo.turtles.ithTurtle(turtle); - const __listener = event => { + const __listener = () => { if (tur.running) { const queueBlock = new Queue(logo.actions[action], 1, blk); tur.parentFlowQueue.push(blk); @@ -154,7 +177,11 @@ function setupMeterActions() { // Since the turtle has stopped running, we need to run the stack from here if (isflow) { logo.runFromBlockNow( - logo, turtle, logo.actions[action], isflow, receivedArg + logo, + turtle, + logo.actions[action], + isflow, + receivedArg ); } else { logo.runFromBlock(logo, turtle, logo.actions[action], isflow, receivedArg); @@ -172,19 +199,17 @@ function setupMeterActions() { static onEveryBeatDo(action, isflow, receivedArg, turtle, blk) { // Set up a listener for every beat for this turtle. const orgTurtle = turtle; - console.debug("used from: ", orgTurtle); - if (!turtles.turtleList[orgTurtle].companionTurtle){ + if (!turtles.turtleList[orgTurtle].companionTurtle) { turtle = logo.turtles.turtleList.length; turtles.turtleList[orgTurtle].companionTurtle = turtle; logo.turtles.addTurtle(logo.blocks.blockList[blk], {}); logo.prepSynths(); - console.debug("beat Turtle: ", turtle); } turtle = turtles.turtleList[orgTurtle].companionTurtle; const tur = logo.turtles.ithTurtle(turtle); - const __listener = event => { + const __listener = () => { if (tur.running) { const queueBlock = new Queue(logo.actions[action], 1, blk); tur.parentFlowQueue.push(blk); @@ -193,7 +218,11 @@ function setupMeterActions() { // Since the turtle has stopped running, we need to run the stack from here if (isflow) { logo.runFromBlockNow( - logo, turtle, logo.actions[action], isflow, receivedArg + logo, + turtle, + logo.actions[action], + isflow, + receivedArg ); } else { logo.runFromBlock(logo, turtle, logo.actions[action], isflow, receivedArg); @@ -213,7 +242,7 @@ function setupMeterActions() { let duration = 60 / (turOrg.singer.bpm.length > 0 ? last(turOrg.singer.bpm) : Singer.masterBPM); // Consider meter when calculating duration. - duration = duration * 4 / turOrg.singer.noteValuePerBeat; + duration = (duration * 4) / turOrg.singer.noteValuePerBeat; if (tur.interval !== undefined) { clearInterval(tur.interval); } @@ -225,7 +254,7 @@ function setupMeterActions() { const tur = logo.turtles.ithTurtle(turtle); // Set up a listener for this turtle/onbeat combo. - const __listener = event => { + const __listener = () => { if (tur.running) { const queueBlock = new Queue(logo.actions[action], 1, blk); tur.parentFlowQueue.push(blk); @@ -234,12 +263,14 @@ function setupMeterActions() { // Since the turtle has stopped running, we need to run the stack from here if (isflow) { logo.runFromBlockNow( - logo, turtle, logo.actions[action], isflow, receivedArg + logo, + turtle, + logo.actions[action], + isflow, + receivedArg ); } else { - logo.runFromBlock( - logo, turtle, logo.actions[action], isflow, receivedArg - ); + logo.runFromBlock(logo, turtle, logo.actions[action], isflow, receivedArg); } } }; @@ -251,7 +282,10 @@ function setupMeterActions() { //remove any default strong beats other than "everybeat " or "offbeat" if (tur.singer.defaultStrongBeats) { for (let i = 0; i < tur.singer.beatList.length; i++) { - if (tur.singer.beatList[i] !== "everybeat" && tur.singer.beatList[i] !== "offbeat") { + if ( + tur.singer.beatList[i] !== "everybeat" && + tur.singer.beatList[i] !== "offbeat" + ) { tur.singer.beatList.splice(i, 1); i--; } @@ -270,7 +304,7 @@ function setupMeterActions() { const tur = logo.turtles.ithTurtle(turtle); // Set up a listener for this turtle/offbeat combo - const __listener = event => { + const __listener = () => { if (tur.running) { const queueBlock = new Queue(logo.actions[action], 1, blk); tur.parentFlowQueue.push(blk); @@ -279,7 +313,11 @@ function setupMeterActions() { // Since the turtle has stopped running, we need to run the stack from here if (isflow) { logo.runFromBlockNow( - logo, turtle, logo.actions[action], isflow, receivedArg + logo, + turtle, + logo.actions[action], + isflow, + receivedArg ); } else { logo.runFromBlock(logo, turtle, logo.actions[action], isflow, receivedArg); @@ -304,21 +342,18 @@ function setupMeterActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => { - if (tur.singer.drift > 0) - tur.singer.drift--; + const __listener = () => { + if (tur.singer.drift > 0) tur.singer.drift--; }; logo.setTurtleListener(turtle, listenerName, __listener); } static getNotesPlayed(noteValue, turtle) { - if (noteValue === null || noteValue === 0) - return 0; + if (noteValue === null || noteValue === 0) return 0; const tur = logo.turtles.ithTurtle(turtle); return tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] / noteValue; @@ -332,32 +367,26 @@ function setupMeterActions() { static getBeatCount(turtle) { const tur = logo.turtles.ithTurtle(turtle); - if (tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] < tur.singer.pickup) - return 0; + if (tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] < tur.singer.pickup) return 0; return ( - ( - ( - tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] - tur.singer.pickup - ) * tur.singer.noteValuePerBeat - ) % tur.singer.beatsPerMeasure - ) + 1; + (((tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] - tur.singer.pickup) * + tur.singer.noteValuePerBeat) % + tur.singer.beatsPerMeasure) + + 1 + ); } static getMeasureCount(turtle) { const tur = logo.turtles.ithTurtle(turtle); - if (tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] < tur.singer.pickup) - return 0; + if (tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] < tur.singer.pickup) return 0; return ( Math.floor( - ( - ( - tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] - - tur.singer.pickup - ) * tur.singer.noteValuePerBeat - ) / tur.singer.beatsPerMeasure + ((tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] - tur.singer.pickup) * + tur.singer.noteValuePerBeat) / + tur.singer.beatsPerMeasure ) + 1 ); } @@ -373,7 +402,10 @@ function setupMeterActions() { } static getBeatFactor(turtle) { - return Singer.RhythmActions.getNoteValue(turtle) * logo.turtles.ithTurtle(turtle).singer.noteValuePerBeat; + return ( + Singer.RhythmActions.getNoteValue(turtle) * + logo.turtles.ithTurtle(turtle).singer.noteValuePerBeat + ); } static getCurrentMeter(turtle) { From 4dc74b20b27a34ce53d3bfbe2060c2767da6311d Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 12:40:21 +0530 Subject: [PATCH 3/9] turtleactions/OrnamentActions.js: Linting and Prettify --- js/turtleactions/OrnamentActions.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/js/turtleactions/OrnamentActions.js b/js/turtleactions/OrnamentActions.js index 8646160d10..40e42d355d 100644 --- a/js/turtleactions/OrnamentActions.js +++ b/js/turtleactions/OrnamentActions.js @@ -14,11 +14,22 @@ * You should have received a copy of the GNU Affero General Public License along with this * library; if not, write to the Free Software Foundation, 51 Franklin Street, Suite 500 Boston, * MA 02110-1335 USA. + */ + +/* global Singer,logo,MusicBlocks,blocks,Mouse */ +/* exported setupOrnamentActions */ +/* + Global Locations + js/turtleactions/RhythmActions.js + Singer + js/activity.js + logo + js/js-export/export.js + MusicBlocks, Mouse */ /** * Sets up all the methods related to different actions for each block in Ornament palette. - * * @returns {void} */ function setupOrnamentActions() { @@ -41,11 +52,10 @@ function setupOrnamentActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => tur.singer.staccato.pop(); + const __listener = () => tur.singer.staccato.pop(); logo.setTurtleListener(turtle, listenerName, __listener); } @@ -72,11 +82,10 @@ function setupOrnamentActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.staccato.pop(); if (tur.singer.justCounting.length === 0) { logo.notation.notationEndSlur(turtle); @@ -107,11 +116,10 @@ function setupOrnamentActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.inNeighbor.pop(); tur.singer.neighborStepPitch.pop(); tur.singer.neighborNoteValue.pop(); From af54bd81af25ce51a95a54519ac11ac9a5d8ad3d Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 12:50:35 +0530 Subject: [PATCH 4/9] turtleactions/RhythmActions.js: Linting and Prettify --- js/turtleactions/MeterActions.js | 4 +++- js/turtleactions/RhythmActions.js | 32 ++++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/js/turtleactions/MeterActions.js b/js/turtleactions/MeterActions.js index b446a47b3c..c8282aea5d 100644 --- a/js/turtleactions/MeterActions.js +++ b/js/turtleactions/MeterActions.js @@ -30,10 +30,12 @@ DRUMNAMES,NOISENAMES js/utils/musicutils.js DEFAULTDRUM - js/logo.js/ + js/logo.js DEFAULTVOLUME,TONEBPM js/blocks.js blocks + js/turtles.js + turtles js/js-export/export.js MusicBlocks, Mouse */ diff --git a/js/turtleactions/RhythmActions.js b/js/turtleactions/RhythmActions.js index 4541fbd53e..fbc24705c8 100644 --- a/js/turtleactions/RhythmActions.js +++ b/js/turtleactions/RhythmActions.js @@ -16,9 +16,28 @@ * MA 02110-1335 USA. */ +/* global _,Singer,logo,MusicBlocks,blocks,Mouse,last,turtles,TONEBPM */ +/* exported setupRhythmActions */ +/* + Global Locations + js/utils/utils.js + _ + js/turtleactions/RhythmActions.js + Singer + js/activity.js + logo + js/turtles.js + turtles + js/logo.js + TONEBPM + js/blocks.js + blocks + js/js-export/export.js + MusicBlocks, Mouse +*/ + /** * Sets up all the methods related to different actions for each block in Rhythm palette. - * * @returns {void} */ function setupRhythmActions() { @@ -118,7 +137,7 @@ function setupRhythmActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { if (tur.singer.multipleVoices) { logo.notation.notationVoices(turtle, tur.singer.inNoteBlock.length); } @@ -224,7 +243,7 @@ function setupRhythmActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { const currentDotFactor = 2 - 1 / Math.pow(2, tur.singer.dotCount); tur.singer.beatFactor *= currentDotFactor; tur.singer.dotCount -= value >= 0 ? value : 1 / value; @@ -262,7 +281,7 @@ function setupRhythmActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.tie = false; // If tieCarryOver > 0, we have one more note to play @@ -361,7 +380,7 @@ function setupRhythmActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => tur.singer.beatFactor *= factor; + const __listener = () => tur.singer.beatFactor *= factor; logo.setTurtleListener(turtle, listenerName, __listener); } @@ -398,7 +417,7 @@ function setupRhythmActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { if (!tur.singer.suppressOutput) { tur.singer.swingTarget.pop(); tur.singer.swing.pop(); @@ -436,7 +455,6 @@ function setupRhythmActions() { ) { value = tur.singer.noteBeat[last(tur.singer.inNoteBlock)]; } else { - console.debug("Cannot find a note for turtle " + turtle); value = 0; } From 2199bb29351aa8b8a8ce31d980cf8c93cd69b8d3 Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 12:51:28 +0530 Subject: [PATCH 5/9] turtleactions/RhythmActions.js: Prettify --- js/turtleactions/RhythmActions.js | 64 +++++++++++++++---------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/js/turtleactions/RhythmActions.js b/js/turtleactions/RhythmActions.js index fbc24705c8..094e8da8dc 100644 --- a/js/turtleactions/RhythmActions.js +++ b/js/turtleactions/RhythmActions.js @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License along with this * library; if not, write to the Free Software Foundation, 51 Franklin Street, Suite 500 Boston, * MA 02110-1335 USA. -*/ + */ /* global _,Singer,logo,MusicBlocks,blocks,Mouse,last,turtles,TONEBPM */ /* exported setupRhythmActions */ @@ -56,13 +56,13 @@ function setupRhythmActions() { */ static playNote(value, blkName, turtle, blk, _enqueue) { /** - * We queue up the child flow of the note clamp and once all of the children are run, we - * trigger a _playnote_ event, then wait for the note to play. The note can be specified - * by pitch or synth blocks. The osctime block specifies the duration in milleseconds - * while the note block specifies duration as a beat value. - * - * @todo We should consider the use of the global timer in Tone.js for more accuracy. - */ + * We queue up the child flow of the note clamp and once all of the children are run, we + * trigger a _playnote_ event, then wait for the note to play. The note can be specified + * by pitch or synth blocks. The osctime block specifies the duration in milleseconds + * while the note block specifies duration as a beat value. + * + * @todo We should consider the use of the global timer in Tone.js for more accuracy. + */ const tur = logo.turtles.ithTurtle(turtle); @@ -72,10 +72,10 @@ function setupRhythmActions() { if (tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] < tur.singer.pickup) { beatValue = measureValue = 0; } else { - const beat = tur.singer.noteValuePerBeat * ( - tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] - tur.singer.pickup - ); - beatValue = 1 + beat % tur.singer.beatsPerMeasure; + const beat = + tur.singer.noteValuePerBeat * + (tur.singer.notesPlayed[0] / tur.singer.notesPlayed[1] - tur.singer.pickup); + beatValue = 1 + (beat % tur.singer.beatsPerMeasure); measureValue = 1 + Math.floor(beat / tur.singer.beatsPerMeasure); } @@ -87,7 +87,7 @@ function setupRhythmActions() { * Put the childFlow into the queue before the beat action so logo the beat action is * at the end of the FILO. * Note: The offbeat cannot be Beat 1. - */ + */ const turtleID = tur.id; if (tur.singer.beatList.indexOf("everybeat") !== -1) { @@ -133,8 +133,7 @@ function setupRhythmActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -202,9 +201,7 @@ function setupRhythmActions() { tur.singer.noteOctaves[last(tur.singer.inNoteBlock)].push(4); tur.singer.noteCents[last(tur.singer.inNoteBlock)].push(0); tur.singer.noteHertz[last(tur.singer.inNoteBlock)].push(0); - tur.singer.noteBeatValues[last(tur.singer.inNoteBlock)].push( - tur.singer.beatFactor - ); + tur.singer.noteBeatValues[last(tur.singer.inNoteBlock)].push(tur.singer.beatFactor); tur.singer.pushedNote = true; } } @@ -239,8 +236,7 @@ function setupRhythmActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -277,8 +273,7 @@ function setupRhythmActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -322,14 +317,18 @@ function setupRhythmActions() { tur.singer.noteBeat[saveBlk] = tur.singer.tieNoteExtras[2]; tur.singer.noteBeatValues[saveBlk] = tur.singer.tieNoteExtras[3]; tur.singer.noteDrums[saveBlk] = tur.singer.tieNoteExtras[4]; - tur.singer.embeddedGraphics[saveBlk] = []; // graphics will have already been rendered + tur.singer.embeddedGraphics[saveBlk] = []; // graphics will have already been rendered Singer.processNote( - noteValue, blocks.blockList[saveBlk].name === "osctime", saveBlk, turtle + noteValue, + blocks.blockList[saveBlk].name === "osctime", + saveBlk, + turtle ); const bpmFactor = - TONEBPM / tur.singer.bpm.length > 0 ? - last(tur.singer.bpm) : Singer.masterBPM; + TONEBPM / tur.singer.bpm.length > 0 + ? last(tur.singer.bpm) + : Singer.masterBPM; // Wait until this note is played before continuing tur.doWait(bpmFactor / noteValue); @@ -376,11 +375,10 @@ function setupRhythmActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = () => tur.singer.beatFactor *= factor; + const __listener = () => (tur.singer.beatFactor *= factor); logo.setTurtleListener(turtle, listenerName, __listener); } @@ -413,8 +411,7 @@ function setupRhythmActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -445,8 +442,9 @@ function setupRhythmActions() { tur.singer.noteValue[last(tur.singer.inNoteBlock)] !== undefined ) { value = - tur.singer.noteValue[last(tur.singer.inNoteBlock)] !== 0 ? - 1 / tur.singer.noteValue[last(tur.singer.inNoteBlock)] : 0; + tur.singer.noteValue[last(tur.singer.inNoteBlock)] !== 0 + ? 1 / tur.singer.noteValue[last(tur.singer.inNoteBlock)] + : 0; } else if (tur.singer.lastNotePlayed !== null) { value = tur.singer.lastNotePlayed[1]; } else if ( From bc32538e81ee79ed80ec9179874f3110a99bf800 Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 12:01:00 +0530 Subject: [PATCH 6/9] turtleactions/IntervalsActions.js: Linting and Prettify --- js/turtleactions/IntervalsActions.js | 32 +++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/js/turtleactions/IntervalsActions.js b/js/turtleactions/IntervalsActions.js index ad9e7fb7f3..2f6c706a28 100644 --- a/js/turtleactions/IntervalsActions.js +++ b/js/turtleactions/IntervalsActions.js @@ -19,6 +19,28 @@ * Action methods are in camelCase. */ +/* global _,Singer,MUSICALMODES,logo,getNote,getModeLength,NOINPUTERRORMSG,blocks,MusicBlocks,Mouse */ +/* exported setupIntervalsActions */ +/* + Global Locations + js/utils/utils.js + _ + js/turtleactions/RhythmActions.js + Singer + js/activity.js + logo + js/turtleactions/IntervalsActions.js + getModeLength + js/utils/musicutils.js + getNote + js/logo.js/ + NOINPUTERRORMSG + js/blocks.js + blocks + js/js-export/export.js + MusicBlocks, Mouse +*/ + /* global _, logo, NOINPUTERRORMSG, Singer, blocks, MUSICALMODES, MusicBlocks, Mouse, MODE_PIE_MENUS, getNote, getModeLength @@ -44,7 +66,6 @@ /** * Sets up all the methods related to different actions for each block in Intervals palette. - * * @returns {void} */ function setupIntervalsActions() { @@ -183,15 +204,6 @@ function setupIntervalsActions() { } const __listener = () => { - if (MODE_PIE_MENUS["12"].indexOf(modeName) === -1) { - const index = MODE_PIE_MENUS["12"].indexOf(" "); - if (index === -1) { - logo.errorMsg(_("Cannot add new mode to Pie Menu.")); - } else { - MODE_PIE_MENUS["12"][index] = modeName; - } - } - MUSICALMODES[modeName] = []; if (tur.singer.defineMode.indexOf(0) === -1) { tur.singer.defineMode.push(0); From d023555bc6100b318ffc6feffa51e20a78cd9e8c Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 12:58:59 +0530 Subject: [PATCH 7/9] turtleactions/ToneActions.js: Linting and Prettify --- js/turtleactions/IntervalsActions.js | 2 +- js/turtleactions/ToneActions.js | 35 +++++++++++++++++++++------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/js/turtleactions/IntervalsActions.js b/js/turtleactions/IntervalsActions.js index 2f6c706a28..5e1dd2759c 100644 --- a/js/turtleactions/IntervalsActions.js +++ b/js/turtleactions/IntervalsActions.js @@ -33,7 +33,7 @@ getModeLength js/utils/musicutils.js getNote - js/logo.js/ + js/logo.js NOINPUTERRORMSG js/blocks.js blocks diff --git a/js/turtleactions/ToneActions.js b/js/turtleactions/ToneActions.js index 608528158f..bf987dc425 100644 --- a/js/turtleactions/ToneActions.js +++ b/js/turtleactions/ToneActions.js @@ -16,9 +16,28 @@ * MA 02110-1335 USA. */ +/* global _,Singer,logo,VOICENAMES,MusicBlocks,blocks,Mouse,last,instrumentsEffects,NOINPUTERRORMSG,arg */ +/* exported setupToneActions */ +/* + Global Locations + js/utils/utils.js + _ + js/turtleactions/RhythmActions.js + Singer + js/activity.js + logo + js/utils/synthutils.js + instrumentsEffects + js/logo.js + NOINPUTERRORMSG + js/blocks.js + blocks + js/js-export/export.js + MusicBlocks, Mouse +*/ + /** * Sets up all the methods related to different actions for each block in Tone palette. - * * @returns {void} */ function setupToneActions() { @@ -74,7 +93,7 @@ function setupToneActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.inSetTimbre = false; tur.singer.instrumentNames.pop(); }; @@ -115,7 +134,7 @@ function setupToneActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.vibratoIntensity.pop(); tur.singer.vibratoRate.pop(); }; @@ -165,7 +184,7 @@ function setupToneActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.chorusRate.pop(); tur.singer.delayTime.pop(); tur.singer.chorusDepth.pop(); @@ -199,7 +218,7 @@ function setupToneActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.rate.pop(); tur.singer.octaves.pop(); tur.singer.baseFrequency.pop(); @@ -239,7 +258,7 @@ function setupToneActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.tremoloFrequency.pop(); tur.singer.tremoloDepth.pop(); }; @@ -276,7 +295,7 @@ function setupToneActions() { } logo.setTurtleListener( - turtle, listenerName, event => tur.singer.distortionAmount.pop() + turtle, listenerName, () => tur.singer.distortionAmount.pop() ); } @@ -317,7 +336,7 @@ function setupToneActions() { mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { tur.singer.inHarmonic.pop(); tur.singer.partials.pop(); logo.notation.notationEndHarmonics(turtle); From 85564afaa2284cda1569abb611f12817d04faff0 Mon Sep 17 00:00:00 2001 From: Daksh Doshi Date: Tue, 9 Feb 2021 13:08:39 +0530 Subject: [PATCH 8/9] turtleactions/VolumeActions.js: Linting and Prettify --- js/turtleactions/ToneActions.js | 52 ++++++++++++++++--------------- js/turtleactions/VolumeActions.js | 36 +++++++++++++++------ 2 files changed, 54 insertions(+), 34 deletions(-) diff --git a/js/turtleactions/ToneActions.js b/js/turtleactions/ToneActions.js index bf987dc425..34a92014b5 100644 --- a/js/turtleactions/ToneActions.js +++ b/js/turtleactions/ToneActions.js @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License along with this * library; if not, write to the Free Software Foundation, 51 Franklin Street, Suite 500 Boston, * MA 02110-1335 USA. -*/ + */ /* global _,Singer,logo,VOICENAMES,MusicBlocks,blocks,Mouse,last,instrumentsEffects,NOINPUTERRORMSG,arg */ /* exported setupToneActions */ @@ -77,10 +77,12 @@ function setupToneActions() { // The electronic synthvolume will track any // changes to the mater volume, e.g., the // articulation block. - tur.singer.synthVolume[synth] = - [last(tur.singer.synthVolume["electronic synth"])]; - tur.singer.crescendoInitialVolume[synth] = - [last(tur.singer.synthVolume["electronic synth"])]; + tur.singer.synthVolume[synth] = [ + last(tur.singer.synthVolume["electronic synth"]) + ]; + tur.singer.crescendoInitialVolume[synth] = [ + last(tur.singer.synthVolume["electronic synth"]) + ]; } } @@ -89,8 +91,7 @@ function setupToneActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -130,8 +131,7 @@ function setupToneActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -180,8 +180,7 @@ function setupToneActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -214,8 +213,7 @@ function setupToneActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -254,8 +252,7 @@ function setupToneActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -290,13 +287,10 @@ function setupToneActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - logo.setTurtleListener( - turtle, listenerName, () => tur.singer.distortionAmount.pop() - ); + logo.setTurtleListener(turtle, listenerName, () => tur.singer.distortionAmount.pop()); } /** @@ -332,8 +326,7 @@ function setupToneActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } const __listener = () => { @@ -373,7 +366,10 @@ function setupToneActions() { if (logo.inTimbre) { logo.timbre.fmSynthParamvals["modulationIndex"] = modulationIndex; logo.synth.createSynth( - turtle, logo.timbre.instrumentName, "fmsynth", logo.timbre.fmSynthParamvals + turtle, + logo.timbre.instrumentName, + "fmsynth", + logo.timbre.fmSynthParamvals ); logo.timbre.FMSynthesizer.push(blk); @@ -409,7 +405,10 @@ function setupToneActions() { if (logo.inTimbre) { logo.timbre.amSynthParamvals["harmonicity"] = harmonicity; logo.synth.createSynth( - turtle, logo.timbre.instrumentName, "amsynth", logo.timbre.amSynthParamvals + turtle, + logo.timbre.instrumentName, + "amsynth", + logo.timbre.amSynthParamvals ); logo.timbre.AMSynthesizer.push(blk); @@ -450,7 +449,10 @@ function setupToneActions() { logo.timbre.duoSynthParamVals["vibratoRate"] = synthVibratoRate; logo.timbre.duoSynthParamVals["vibratoAmount"] = synthVibratoAmount; logo.synth.createSynth( - turtle, logo.timbre.instrumentName, "duosynth", logo.timbre.duoSynthParamVals + turtle, + logo.timbre.instrumentName, + "duosynth", + logo.timbre.duoSynthParamVals ); logo.timbre.duoSynthesizer.push(blk); diff --git a/js/turtleactions/VolumeActions.js b/js/turtleactions/VolumeActions.js index baaa0fd1d6..e9e4acb7f4 100644 --- a/js/turtleactions/VolumeActions.js +++ b/js/turtleactions/VolumeActions.js @@ -14,11 +14,32 @@ * You should have received a copy of the GNU Affero General Public License along with this * library; if not, write to the Free Software Foundation, 51 Franklin Street, Suite 500 Boston, * MA 02110-1335 USA. + */ + +/* global _,Singer,logo,MusicBlocks,blocks,Mouse,last,VOICENAMES,DRUMNAMES,_THIS_IS_MUSIC_BLOCKS_,Tone,instruments,DEFAULTVOLUME */ +/* exported setupVolumeActions */ +/* + Global Locations + js/utils/utils.js + _ + js/turtleactions/RhythmActions.js + Singer + js/activity.js + logo,_THIS_IS_MUSIC_BLOCKS_ + js/js-export/interface.js + instruments + js/utils/synthutils.js + VOICENAMES,DRUMNAMES + js/logo.js + DEFAULTVOLUME + js/blocks.js + blocks + js/js-export/export.js + MusicBlocks, Mouse */ /** * Sets up all the methods related to different actions for each block in Volume palette. - * * @returns {void} */ function setupVolumeActions() { @@ -54,11 +75,10 @@ function setupVolumeActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { if (tur.singer.justCounting.length === 0) { logo.notation.notationEndCrescendo(turtle, last(tur.singer.crescendoDelta)); } @@ -111,11 +131,10 @@ function setupVolumeActions() { logo.setDispatchBlock(blk, turtle, listenerName); } else if (MusicBlocks.isRun) { const mouse = Mouse.getMouseFromTurtle(tur); - if (mouse !== null) - mouse.MB.listeners.push(listenerName); + if (mouse !== null) mouse.MB.listeners.push(listenerName); } - const __listener = event => { + const __listener = () => { for (const synth in tur.singer.synthVolume) { tur.singer.synthVolume[synth].pop(); Singer.setSynthVolume(logo, turtle, synth, last(tur.singer.synthVolume[synth])); @@ -140,8 +159,7 @@ function setupVolumeActions() { static setMasterVolume(volume, turtle, blk) { volume = Math.max(Math.min(volume, 100), 0); - if (volume === 0) - logo.errorMsg(_("Setting volume to 0."), blk); + if (volume === 0) logo.errorMsg(_("Setting volume to 0."), blk); Singer.masterVolume.push(volume); From 1f67f7312eced1964d43405a69b029c0744b46f3 Mon Sep 17 00:00:00 2001 From: Anindya Kundu Date: Thu, 11 Feb 2021 13:44:10 +0530 Subject: [PATCH 9/9] fix: correct dirty occurrences --- js/turtleactions/DictActions.js | 4 +-- js/turtleactions/DrumActions.js | 31 ++++++++++-------- js/turtleactions/IntervalsActions.js | 48 ++++++++-------------------- js/turtleactions/MeterActions.js | 39 +++++++++++----------- js/turtleactions/OrnamentActions.js | 16 ++++++---- js/turtleactions/PitchActions.js | 24 +++++++------- js/turtleactions/RhythmActions.js | 26 +++++++-------- js/turtleactions/ToneActions.js | 33 ++++++++++--------- js/turtleactions/VolumeActions.js | 35 ++++++++++++-------- 9 files changed, 125 insertions(+), 131 deletions(-) diff --git a/js/turtleactions/DictActions.js b/js/turtleactions/DictActions.js index e90f280a65..b26c7e4034 100644 --- a/js/turtleactions/DictActions.js +++ b/js/turtleactions/DictActions.js @@ -28,13 +28,11 @@ js/turtle.js Turtle js/activity.js - turtles + turtles, logo js/turtle-singer.js Singer js/utils/musicutils.js getNote, pitchToNumber - js/activity.js - logo js/logo.js INVALIDPITCH js/blocks/EnsembleBlocks.js diff --git a/js/turtleactions/DrumActions.js b/js/turtleactions/DrumActions.js index 6027a3fb55..a0820f31f1 100644 --- a/js/turtleactions/DrumActions.js +++ b/js/turtleactions/DrumActions.js @@ -19,28 +19,31 @@ * Action methods are in camelCase. */ -/* global Singer,DEFAULTDRUM,DRUMNAMES,last,DEFAULTVOLUME,logo,blocks,MusicBlocks,Mouse,NOISENAMES,_ */ -/* exported setupDrumActions */ /* - Global Locations - js/utils/utils.js + global Singer, DEFAULTDRUM, DRUMNAMES, last, DEFAULTVOLUME, logo, blocks, MusicBlocks, Mouse, + NOISENAMES, _ +*/ + +/* + Global Locations + js/utils/utils.js _ - js/turtleactions/RhythmActions.js + js/turtle-singer.js Singer - js/activity.js - logo - js/utils/synthutils.js - DRUMNAMES,NOISENAMES - js/utils/musicutils.js + js/activity.js + logo, blocks + js/utils/synthutils.js + DRUMNAMES, NOISENAMES + js/utils/musicutils.js DEFAULTDRUM - js/logo.js/ + js/logo.js/ DEFAULTVOLUME - js/blocks.js - blocks - js/js-export/export.js + js/js-export/export.js MusicBlocks, Mouse */ +/* exported setupDrumActions */ + /** * Sets up all the methods related to different actions for each block in Drum palette. * @returns {void} diff --git a/js/turtleactions/IntervalsActions.js b/js/turtleactions/IntervalsActions.js index 5e1dd2759c..2216c3767e 100644 --- a/js/turtleactions/IntervalsActions.js +++ b/js/turtleactions/IntervalsActions.js @@ -19,47 +19,25 @@ * Action methods are in camelCase. */ -/* global _,Singer,MUSICALMODES,logo,getNote,getModeLength,NOINPUTERRORMSG,blocks,MusicBlocks,Mouse */ -/* exported setupIntervalsActions */ /* - Global Locations - js/utils/utils.js - _ - js/turtleactions/RhythmActions.js - Singer - js/activity.js - logo - js/turtleactions/IntervalsActions.js - getModeLength - js/utils/musicutils.js - getNote - js/logo.js - NOINPUTERRORMSG - js/blocks.js - blocks - js/js-export/export.js - MusicBlocks, Mouse + global _, logo, NOINPUTERRORMSG, Singer, blocks, MUSICALMODES, MusicBlocks, Mouse, getNote, + getModeLength */ -/* - global _, logo, NOINPUTERRORMSG, Singer, blocks, MUSICALMODES, MusicBlocks, Mouse, - MODE_PIE_MENUS, getNote, getModeLength - */ - /* Global locations - - js/utils/utils.js + js/utils/utils.js _ - - js/logo.js - NOINPUTERRORMSG - - js/utils/musicutils.js - MUSICALMODES, MODE_PIE_MENUS, getNote, getModeLength - - js/turtle-singer.js - Singer - - js/activity.js - blocks, logo - - js/js-export/export.js - MusicBlocks, Mouse + js/logo.js + NOINPUTERRORMSG + js/utils/musicutils.js + MUSICALMODES, MODE_PIE_MENUS, getNote, getModeLength + js/turtle-singer.js + Singer + js/activity.js + blocks, logo + js/js-export/export.js + MusicBlocks, Mouse */ /* exported setupIntervalsActions*/ diff --git a/js/turtleactions/MeterActions.js b/js/turtleactions/MeterActions.js index c8282aea5d..dd7e5f6dc5 100644 --- a/js/turtleactions/MeterActions.js +++ b/js/turtleactions/MeterActions.js @@ -16,30 +16,33 @@ * MA 02110-1335 USA. */ -/* global _,logo,Singer,rationalToFraction,_blk,blk,TONEBPM,Queue,turtles,last,MusicBlocks,blocks,Mouse */ -/* exported setupMeterActions */ /* - Global Locations - js/utils/utils.js - _,rationalToFraction - js/turtleactions/RhythmActions.js + global _, logo, Singer, rationalToFraction, TONEBPM, Queue, turtles, last, MusicBlocks, blocks, + Mouse +*/ + +/* + Global Locations + js/utils/utils.js + _, rationalToFraction, last + js/turtle-singer.js Singer - js/activity.js - logo - js/utils/synthutils.js + js/activity.js + logo, blocks + js/utils/synthutils.js DRUMNAMES,NOISENAMES - js/utils/musicutils.js + js/utils/musicutils.js DEFAULTDRUM - js/logo.js - DEFAULTVOLUME,TONEBPM - js/blocks.js - blocks - js/turtles.js + js/logo.js + DEFAULTVOLUME, TONEBPM, Queue + js/activity.js turtles - js/js-export/export.js + js/js-export/export.js MusicBlocks, Mouse */ +/* exported setupMeterActions */ + /** * Sets up all the methods related to different actions for each block in Meter palette. * @returns {void} @@ -89,7 +92,7 @@ function setupMeterActions() { logo.notation.notationPickup(turtle, tur.singer.pickup); } - static setBPM(bpm, beatValue, turtle) { + static setBPM(bpm, beatValue, turtle, blk) { let _bpm = (bpm * beatValue) / 0.25; let obj, target; if (_bpm < 30) { @@ -119,7 +122,7 @@ function setupMeterActions() { _("beats per minute is") + " " + target, - _blk + blk ); _bpm = 1000; } diff --git a/js/turtleactions/OrnamentActions.js b/js/turtleactions/OrnamentActions.js index 40e42d355d..10618f5a9f 100644 --- a/js/turtleactions/OrnamentActions.js +++ b/js/turtleactions/OrnamentActions.js @@ -16,18 +16,20 @@ * MA 02110-1335 USA. */ -/* global Singer,logo,MusicBlocks,blocks,Mouse */ -/* exported setupOrnamentActions */ +/* global Singer, logo, MusicBlocks, blocks, Mouse */ + /* - Global Locations - js/turtleactions/RhythmActions.js + Global Locations + js/turtle-singer.js Singer - js/activity.js - logo - js/js-export/export.js + js/activity.js + logo, blocks + js/js-export/export.js MusicBlocks, Mouse */ +/* exported setupOrnamentActions */ + /** * Sets up all the methods related to different actions for each block in Ornament palette. * @returns {void} diff --git a/js/turtleactions/PitchActions.js b/js/turtleactions/PitchActions.js index e5939a3ccb..1d8de50ac7 100644 --- a/js/turtleactions/PitchActions.js +++ b/js/turtleactions/PitchActions.js @@ -16,17 +16,13 @@ * MA 02110-1335 USA. */ -/** - * Sets up all the methods related to different actions for each block in Pitch palette. - * - * @returns {void} - */ - -/*globals logo, Singer, pitchToNumber, getStepSizeUp, getStepSizeDown, calcOctave, last, -getNote, nthDegreeToPitch, SHARP, FLAT, _, pitchToFrequency, SOLFEGENAMES1, SOLFEGECONVERSIONTABLE, -numberToPitch, ACCIDENTALNAMES, ACCIDENTALVALUES, NOTESFLAT, NOTESSHARP, NOTESTEP, MUSICALMODES, -keySignatureToMode, getInterval, blocks, EFFECTSNAMES, NANERRORMSG, frequencyToPitch, MusicBlocks, -Mouse, isCustom*/ +/* + globals logo, Singer, pitchToNumber, getStepSizeUp, getStepSizeDown, calcOctave, last, getNote, + nthDegreeToPitch, SHARP, FLAT, _, pitchToFrequency, SOLFEGENAMES1, SOLFEGECONVERSIONTABLE, + numberToPitch, ACCIDENTALNAMES, ACCIDENTALVALUES, NOTESFLAT, NOTESSHARP, NOTESTEP, MUSICALMODES, + keySignatureToMode, getInterval, blocks, EFFECTSNAMES, NANERRORMSG, frequencyToPitch, + MusicBlocks, Mouse, isCustom +*/ /* Global locations @@ -50,6 +46,12 @@ Mouse, isCustom*/ */ /*exported setupPitchActions*/ + +/** + * Sets up all the methods related to different actions for each block in Pitch palette. + * + * @returns {void} + */ function setupPitchActions() { Singer.PitchActions = class { /** diff --git a/js/turtleactions/RhythmActions.js b/js/turtleactions/RhythmActions.js index 094e8da8dc..d06e73edcf 100644 --- a/js/turtleactions/RhythmActions.js +++ b/js/turtleactions/RhythmActions.js @@ -16,26 +16,24 @@ * MA 02110-1335 USA. */ -/* global _,Singer,logo,MusicBlocks,blocks,Mouse,last,turtles,TONEBPM */ -/* exported setupRhythmActions */ +/* global _, Singer, logo, MusicBlocks, blocks, Mouse, last, turtles, TONEBPM */ + /* - Global Locations - js/utils/utils.js - _ - js/turtleactions/RhythmActions.js + Global Locations + js/utils/utils.js + _, last + js/turtle-singer.js Singer - js/activity.js - logo - js/turtles.js - turtles - js/logo.js + js/activity.js + logo, turtles, blocks + js/logo.js TONEBPM - js/blocks.js - blocks - js/js-export/export.js + js/js-export/export.js MusicBlocks, Mouse */ +/* exported setupRhythmActions */ + /** * Sets up all the methods related to different actions for each block in Rhythm palette. * @returns {void} diff --git a/js/turtleactions/ToneActions.js b/js/turtleactions/ToneActions.js index 34a92014b5..d710da8889 100644 --- a/js/turtleactions/ToneActions.js +++ b/js/turtleactions/ToneActions.js @@ -16,26 +16,29 @@ * MA 02110-1335 USA. */ -/* global _,Singer,logo,VOICENAMES,MusicBlocks,blocks,Mouse,last,instrumentsEffects,NOINPUTERRORMSG,arg */ -/* exported setupToneActions */ /* - Global Locations - js/utils/utils.js - _ - js/turtleactions/RhythmActions.js + global _, Singer, logo, VOICENAMES, MusicBlocks, blocks, Mouse, last, instrumentsEffects, + NOINPUTERRORMSG +*/ + +/* + Global Locations + js/utils/utils.js + _, last + js/turtle-singer.js Singer - js/activity.js - logo - js/utils/synthutils.js - instrumentsEffects - js/logo.js + js/activity.js + logo, blocks + js/utils/synthutils.js + VOICENAMES, instrumentsEffects + js/logo.js NOINPUTERRORMSG - js/blocks.js - blocks - js/js-export/export.js + js/js-export/export.js MusicBlocks, Mouse */ +/* exported setupToneActions */ + /** * Sets up all the methods related to different actions for each block in Tone palette. * @returns {void} @@ -360,7 +363,7 @@ function setupToneActions() { if (modulationIndex < 0) { logo.errorMsg(_("The input cannot be negative.")); - modulationIndex = -arg; + modulationIndex = -modulationIndex; } if (logo.inTimbre) { diff --git a/js/turtleactions/VolumeActions.js b/js/turtleactions/VolumeActions.js index e9e4acb7f4..89cd30fa8a 100644 --- a/js/turtleactions/VolumeActions.js +++ b/js/turtleactions/VolumeActions.js @@ -16,28 +16,35 @@ * MA 02110-1335 USA. */ -/* global _,Singer,logo,MusicBlocks,blocks,Mouse,last,VOICENAMES,DRUMNAMES,_THIS_IS_MUSIC_BLOCKS_,Tone,instruments,DEFAULTVOLUME */ -/* exported setupVolumeActions */ /* - Global Locations - js/utils/utils.js - _ - js/turtleactions/RhythmActions.js + global _, Singer, logo, MusicBlocks, blocks, Mouse, last, VOICENAMES, DRUMNAMES, + _THIS_IS_MUSIC_BLOCKS_, Tone, instruments, DEFAULTVOLUME +*/ + +/* + Global Locations + js/utils/utils.js + _, last + js/turtle-singer.js Singer - js/activity.js - logo,_THIS_IS_MUSIC_BLOCKS_ - js/js-export/interface.js + js/activity.js + logo, _THIS_IS_MUSIC_BLOCKS_ + js/js-export/interface.js instruments - js/utils/synthutils.js - VOICENAMES,DRUMNAMES - js/logo.js + js/utils/synthutils.js + VOICENAMES, DRUMNAMES + js/logo.js DEFAULTVOLUME - js/blocks.js + js/blocks.js blocks - js/js-export/export.js + js/js-export/export.js MusicBlocks, Mouse + index.html + Tone */ +/* exported setupVolumeActions */ + /** * Sets up all the methods related to different actions for each block in Volume palette. * @returns {void}