Code Monkey home page Code Monkey logo

scorerenderer's People

Contributors

ethanroday avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

scorerenderer's Issues

Rename accept() pattern

Since the renderer now makes multiple passes, the accept() method should be renamed to something more sensible, like positionElements().

Duplicate Methods in ScoreLeaf and ScoreComposite

Several methods in ScoreLeaf and ScoreComposite are identical and should be factored out into a new ScoreComponent class, from which ScoreLeaf and ScoreComposite should inherit.
Specifically, the methods are:

  • isStretchableX
  • isShrinkableX
  • accept
  • generateSims
  • drawCrosshair
  • drawBoundingBox

Rename ScoreComponent's pattern methods

In order to correctly discern between the score's tree and the actual formatted object graph, we must make the following distinction:

  • add() will now be the method for the developer-facing score model.

  • addChild() will now be the method for the internal composite structure.

  • Each class will keep track of a nextLevelDown attribute, so that the implementation of the add() method can be encapsulated in ScoreComponent as:

    add(child) {
        this.nextLevelDown.addChild(child);
    }
    

    Thus, the constructor of ScoreComponent should contain this.nextLevelDown = this as the default, and subclasses can modify if needed. For example, Part should have this.nextLevelDown = this.voiceGroup.

Score update methods should be object properties

Update methods should be eliminated and replaced with Object.defineProperty() for the properties involved. For example,

Renderer.Chord.prototype.update = function(duration,numDots,articulation) {
    this.updateDuration(duration);
    this.updateNumDots(numDots);
    this.updateArticulation(articulation);
};

and the methods that it calls should in turn be refactored into three Object.defineProperty() calls: one for duration, one for numDots, and one for articulation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.