diff --git a/js/abc.js b/js/abc.js index 834472c7e8..7c2c0bc9e0 100644 --- a/js/abc.js +++ b/js/abc.js @@ -123,35 +123,35 @@ const processABCNotes = function(logo, turtle) { counter = 0; break; case "begin articulation": - articulation = true; - break; - case "end articulation": - articulation = false; - break; - case "begin crescendo": - logo.notationNotes[turtle] += "!<(!"; - break; - case "end crescendo": - logo.notationNotes[turtle] += "!<)!"; - break; - case "begin decrescendo": - logo.notationNotes[turtle] += "!>(!"; - break; - case "end decrescendo": - logo.notationNotes[turtle] += "!<(!"; - break; - case "begin slur": - queueSlur = true; - break; - case "end slur": - logo.notationNotes[turtle] += ""; - break; - case "tie": - logo.notationNotes[turtle] += ""; - break; - case "meter": - logo.notationNotes[turtle] += - "M:" + + // articulation = true; + // break; + // case "end articulation": + // articulation = false; + // break; + // case "begin crescendo": + // logo.notationNotes[turtle] += "!<(!"; + // break; + // case "end crescendo": + // // logo.notationNotes[turtle] += "!<)!"; + // break; + // case "begin decrescendo": + // logo.notationNotes[turtle] += "!>(!"; + // break; + // case "end decrescendo": + // logo.notationNotes[turtle] += "!<(!"; + // break; + // case "begin slur": + // queueSlur = true; + // break; + // case "end slur": + // logo.notationNotes[turtle] += ""; + // break; + // case "tie": + // logo.notationNotes[turtle] += ""; + // break; + // case "meter": + // logo.notationNotes[turtle] += + // "M:" + logo.notation.notationStaging[turtle][i + 1] + "/" + logo.notation.notationStaging[turtle][i + 2] + @@ -311,25 +311,25 @@ const processABCNotes = function(logo, turtle) { if (obj[NOTATIONTUPLETVALUE] > 0) { if (incompleteTuplet === 0) { const tupletFraction = toFraction(tupletDuration / - targetDuration); - logo.notationNotes[turtle] += - "(" + tupletFraction[0] + ":" + tupletFraction[1] + ""; - i += __processTuplet( - logo, turtle, i, obj[NOTATIONTUPLETVALUE]) - 1; - } else { - const tupletFraction = toFraction( - obj[NOTATIONTUPLETVALUE] / incompleteTuplet); - logo.notationNotes[turtle] += - "(" + tupletFraction[0] + ":" + tupletFraction[1] + ""; - i += __processTuplet(logo, turtle, i, incompleteTuplet) - 1; - } - - targetDuration = 0; - tupletDuration = 0; - } else { - if (typeof notes === "object") { - if (notes.length > 1) { - logo.notationNotes[turtle] += "["; + // targetDuration); + // logo.notationNotes[turtle] += + // "(" + tupletFraction[0] + ":" + tupletFraction[1] + ""; + // i += __processTuplet( + // logo, turtle, i, obj[NOTATIONTUPLETVALUE]) - 1; + // } else { + // const tupletFraction = toFraction( + // obj[NOTATIONTUPLETVALUE] / incompleteTuplet); + // logo.notationNotes[turtle] += + // "(" + tupletFraction[0] + ":" + tupletFraction[1] + ""; + // i += __processTuplet(logo, turtle, i, incompleteTuplet) - 1; + // } + + // targetDuration = 0; + // tupletDuration = 0; + // } else { + // if (typeof notes === "object") { + // if (notes.length > 1) { + // logo.notationNotes[turtle] += "["; } for (let ii = 0; ii < notes.length; ii++) { @@ -426,16 +426,16 @@ const saveAbcOutput = function(activity) { // for (const t in activity.logo.notation.notationStaging) { // turtleCount += 1; // } - // eslint-disable-next-line no-console - // console.debug("saving as abc: " + turtleCount); - - for (const t in activity.logo.notation.notationStaging) { - activity.logo.notationOutput += - "K:" + activity.turtles.ithTurtle(t).singer.keySignature - .toUpperCase() - .replace(" ", "") - .replace("♭", "b") - .replace("♯", "#") + "\n"; + // // eslint-disable-next-line no-console + // // console.debug("saving as abc: " + turtleCount); + + // for (const t in activity.logo.notation.notationStaging) { + // activity.logo.notationOutput += + // "K:" + activity.turtles.ithTurtle(t).singer.keySignature + // .toUpperCase() + // .replace(" ", "") + // .replace("♭", "b") + // .replace("♯", "#") + "\n"; processABCNotes(activity.logo, t); activity.logo.notationOutput += activity.logo.notationNotes[t]; } diff --git a/js/activity.js b/js/activity.js index 279f09dc2b..562835b871 100644 --- a/js/activity.js +++ b/js/activity.js @@ -169,74 +169,74 @@ if (_THIS_IS_MUSIC_BLOCKS_) { "widgets/pitchslider", "widgets/musickeyboard", "widgets/timbre", - "widgets/oscilloscope", - "widgets/sampler", - "activity/lilypond", - "activity/abc", - "activity/mxml" - ]; - MYDEFINES = MYDEFINES.concat(MUSICBLOCKS_EXTRAS); -} - -// Create a global variable from the Activity obj to provide access to -// blocks, logo, palettes, and turtles for plugins and js-export. -let globalActivity; - -/** - * Performs analysis on the project using the global activity. - * @returns {object} - The analysis result. - */ -const doAnalyzeProject = function() { - return analyzeProject(globalActivity); -}; - -/** - * Represents an activity in the application. - */ -class Activity { - /** - * Creates an Activity instance. - */ - constructor() { - globalActivity = this; - - this.cellSize = 55; - this.searchSuggestions = []; - this.homeButtonContainer; - - this.msgTimeoutID = null; - this.msgText = null; - this.errorMsgTimeoutID = null; - this.errorMsgText = null; - this.errorMsgArrow = null; - this.errorArtwork = {}; - - this.cartesianBitmap = null; - this.polarBitmap = null; - this.trebleBitmap = null; - this.trebleSharpBitmap = [null, null, null, null, null, null, null]; - this.trebleFlatBitmap = [null, null, null, null, null, null, null]; - this.grandBitmap = null; - this.grandSharpBitmap = [null, null, null, null, null, null, null]; - this.grandFlatBitmap = [null, null, null, null, null, null, null]; - this.sopranoBitmap = null; - this.sopranoSharpBitmap = [null, null, null, null, null, null, null]; - this.sopranoFlatBitmap = [null, null, null, null, null, null, null]; - this.altoBitmap = null; - this.altoSharpBitmap = [null, null, null, null, null, null, null]; - this.altoFlatBitmap = [null, null, null, null, null, null, null]; - this.tenorBitmap = null; - this.tenorSharpBitmap = [null, null, null, null, null, null, null]; - this.tenorFlatBitmap = [null, null, null, null, null, null, null]; - this.bassBitmap = null; - this.bassSharpBitmap = [null, null, null, null, null, null, null]; - this.bassFlatBitmap = [null, null, null, null, null, null, null]; - - const ERRORARTWORK = [ - "emptybox", - "emptyheap", - "negroot", - "noinput", +// "widgets/oscilloscope", +// "widgets/sampler", +// "activity/lilypond", +// "activity/abc", +// "activity/mxml" +// ]; +// MYDEFINES = MYDEFINES.concat(MUSICBLOCKS_EXTRAS); +// } + +// // Create a global variable from the Activity obj to provide access to +// // blocks, logo, palettes, and turtles for plugins and js-export. +// let globalActivity; + +// /** +// * Performs analysis on the project using the global activity. +// * @returns {object} - The analysis result. +// */ +// const doAnalyzeProject = function() { +// return analyzeProject(globalActivity); +// }; + +// /** +// * Represents an activity in the application. +// */ +// class Activity { +// /** +// * Creates an Activity instance. +// */ +// constructor() { +// globalActivity = this; + +// this.cellSize = 55; +// this.searchSuggestions = []; +// this.homeButtonContainer; + +// this.msgTimeoutID = null; +// this.msgText = null; +// this.errorMsgTimeoutID = null; +// this.errorMsgText = null; +// this.errorMsgArrow = null; +// this.errorArtwork = {}; + +// this.cartesianBitmap = null; +// this.polarBitmap = null; +// this.trebleBitmap = null; +// this.trebleSharpBitmap = [null, null, null, null, null, null, null]; +// this.trebleFlatBitmap = [null, null, null, null, null, null, null]; +// this.grandBitmap = null; +// this.grandSharpBitmap = [null, null, null, null, null, null, null]; +// this.grandFlatBitmap = [null, null, null, null, null, null, null]; +// this.sopranoBitmap = null; +// this.sopranoSharpBitmap = [null, null, null, null, null, null, null]; +// this.sopranoFlatBitmap = [null, null, null, null, null, null, null]; +// this.altoBitmap = null; +// this.altoSharpBitmap = [null, null, null, null, null, null, null]; +// this.altoFlatBitmap = [null, null, null, null, null, null, null]; +// this.tenorBitmap = null; +// this.tenorSharpBitmap = [null, null, null, null, null, null, null]; +// this.tenorFlatBitmap = [null, null, null, null, null, null, null]; +// this.bassBitmap = null; +// this.bassSharpBitmap = [null, null, null, null, null, null, null]; +// this.bassFlatBitmap = [null, null, null, null, null, null, null]; + +// const ERRORARTWORK = [ +// "emptybox", +// "emptyheap", +// "negroot", +// "noinput", "zerodivide", "notanumber", "nostack", diff --git a/js/block.js b/js/block.js index 3a5ee983f6..7f7613394a 100644 --- a/js/block.js +++ b/js/block.js @@ -250,57 +250,57 @@ class Block { this.overrideName = overrideName; this.name = protoblock.name; - this.activity = this.blocks.activity; - - this.collapsed = false; // Is this collapsible block collapsed? - this.inCollapsed = false; // Is this block in a collapsed stack? - this.trash = false; // Is this block in the trash? - this.loadComplete = false; // Has the block finished loading? - this.label = null; // Editable textview in DOM. - this.labelattr = null; // Editable textview in DOM. - this.text = null; // A dynamically generated text label on block itself. - this.value = null; // Value for number, text, and media blocks. - this.privateData = null; // A block may have some private data, - // e.g., nameboxes use this field to store - // the box name associated with the block. - this.customID = null; // Used by custom temperaments. - this.image = protoblock.image; // The file path of the image. - this.imageBitmap = null; - this.controller = null; // Note blocks get a controller - - // All blocks have at a container and least one bitmap. - this.container = null; - this.bounds = null; - this.width = 0; - this.height = 0; - this.hitHeight = 0; - this.bitmap = null; - this.highlightBitmap = null; - this.disconnectedBitmap = null; - this.disconnectedHighlightBitmap = null; - - // The svg from which the bitmaps are generated - this.artwork = null; - this.collapseArtwork = null; - - // Start and Action blocks has a collapse button - this.collapseButtonBitmap = null; - this.expandButtonBitmap = null; - this.collapseBlockBitmap = null; - this.highlightCollapseBlockBitmap = null; - this.collapseText = null; - - this.size = 1; // Proto size is copied here. - this.docks = []; // Proto dock is copied here. - this.connections = []; - - // Keep track of clamp count for blocks with clamps. - this.clampCount = [1, 1]; - this.argClampSlots = [1]; - - // Some blocks have some post process after they are first loaded. - this.postProcess = null; - this.postProcessArg = this; + // this.activity = this.blocks.activity; + + // this.collapsed = false; // Is this collapsible block collapsed? + // this.inCollapsed = false; // Is this block in a collapsed stack? + // this.trash = false; // Is this block in the trash? + // this.loadComplete = false; // Has the block finished loading? + // this.label = null; // Editable textview in DOM. + // this.labelattr = null; // Editable textview in DOM. + // this.text = null; // A dynamically generated text label on block itself. + // this.value = null; // Value for number, text, and media blocks. + // this.privateData = null; // A block may have some private data, + // // e.g., nameboxes use this field to store + // // the box name associated with the block. + // this.customID = null; // Used by custom temperaments. + // this.image = protoblock.image; // The file path of the image. + // this.imageBitmap = null; + // this.controller = null; // Note blocks get a controller + + // // All blocks have at a container and least one bitmap. + // this.container = null; + // this.bounds = null; + // this.width = 0; + // this.height = 0; + // this.hitHeight = 0; + // this.bitmap = null; + // this.highlightBitmap = null; + // this.disconnectedBitmap = null; + // this.disconnectedHighlightBitmap = null; + + // // The svg from which the bitmaps are generated + // this.artwork = null; + // this.collapseArtwork = null; + + // // Start and Action blocks has a collapse button + // this.collapseButtonBitmap = null; + // this.expandButtonBitmap = null; + // this.collapseBlockBitmap = null; + // this.highlightCollapseBlockBitmap = null; + // this.collapseText = null; + + // this.size = 1; // Proto size is copied here. + // this.docks = []; // Proto dock is copied here. + // this.connections = []; + + // // Keep track of clamp count for blocks with clamps. + // this.clampCount = [1, 1]; + // this.argClampSlots = [1]; + + // // Some blocks have some post process after they are first loaded. + // this.postProcess = null; + // this.postProcessArg = this; // Lock on label change this._labelLock = false;