ethanroday / scorerenderer Goto Github PK
View Code? Open in Web Editor NEWA very experimental open-source Javascript renderer for musical scores.
License: Other
A very experimental open-source Javascript renderer for musical scores.
License: Other
Since the renderer now makes multiple passes, the accept()
method should be renamed to something more sensible, like positionElements()
.
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:
All direct access to component.children
should instead use the pattern methods addChild
, removeChild
, and getChild
.
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
.
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
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.