Skip to content

Commit

Permalink
Make animation work in multivoice tunes.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrosen committed Jul 20, 2014
1 parent 4a8f75e commit 9b95f98
Show file tree
Hide file tree
Showing 13 changed files with 519 additions and 86 deletions.
55 changes: 39 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,35 @@ If you are looking at someone else's website and see ABC on the page and want to

Downloads:
---
[Release Notes](RELEASE.md)

Here are the latest versions. You can just download these:

Basic:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_basic_1.10-min.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_basic_1.11-min.js

Editor:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_editor_1.10-min.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_editor_1.11-min.js

Plugin:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin_1.10-min.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin_1.11-min.js

Greasemonkey script:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin_1.10.user.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin_1.11.user.js

And here are versions packaged without the standard libraries. To use these, you need to include those libraries yourself:

Basic without Raphael:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_basic_noraphael_1.10-min.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_basic_noraphael_1.11-min.js

Editor without Raphael:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_editor_noraphael_1.10-min.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_editor_noraphael_1.11-min.js

Plugin without JQuery:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin-nojquery_1.10-min.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin_nojquery_1.11-min.js

Plugin without JQuery or Raphael:
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin_noraphael_nojquery_1.10-min.js
https://raw.github.com/paulrosen/abcjs/master/bin/abcjs_plugin_noraphael_nojquery_1.11-min.js

Partial list of some websites using abcjs:
---
Expand All @@ -85,11 +87,31 @@ Partial list of some websites using abcjs:
Some notes:
---

ABC 1.6 is pretty much implemented
Very simple multi-voice ABC and other features beyond ABC 1.6 are slowly making their way in, based on the behaviour of abcm2ps
Midi playback is at a very early stage and does not yet feature ornamentation, dynamics, chords or multi voice.
Midi playback will not work in Internet Explorer

* ABC 1.6 is pretty much implemented
* Very simple multi-voice ABC and other features beyond ABC 1.6 are slowly making their way in, based on the behaviour of abcm2ps
* Midi playback is at a very early stage and does not yet feature ornamentation, dynamics, chords or multi voice.
* Midi playback will not work in Internet Explorer

API Changes for Version 1.11
===

"Bouncing Ball" cursor:

ABCJS.startAnimation(paper, tune, options)
paper: the output div that the music is in.
tune: the tune object returned by renderAbc.
options: a hash containing the following:
hideFinishedMeasures: true or false [ false is the default ]
showCursor: true or false [ false is the default ]
bpm: number of beats per minute [ the default is whatever is in the Q: field ]

renderABC() now returns the object that was created by the process. This allows further processing.

highlight() and unhighlight() now can be passed an optional class name and color.

Descriptive classes to all SVG elements: If you include { add_classes: true } in the rendering params,
then a set of classes are applied to each SVG element so they can be manipulated with css.

API Changes for Version 1.3
===

Expand Down Expand Up @@ -152,7 +174,7 @@ The abcjs editor transforms an html textarea into an area for editing abc. See:
Typical usage would be:

```html
<script src="abcjs_editor_X.X-min.js" type="text/javascript"></script>
<script src="abcjs_editor_1.11-min.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function() {
abc_editor = new ABCJS.Editor("abc", { canvas_id: "canvas0", midi_id:"midi", warnings_id:"warnings" });
Expand All @@ -171,7 +193,7 @@ The ABCJS.Editor constructor takes the following parameters:
warnings_id -- the id of the html element within which abc syntax warnings should be added (if this key is present, generate_warnings is assumed to be true)
parser_options -- a hashtable of options to pass to the parser
midi_options -- a hashtable of options to pass to the midi creator (see MidiOptions) since 1.0.2

render_options -- a hashtable of options to pass to the printing engine. (since 1.11)
abcjs plugin
---

Expand All @@ -180,7 +202,7 @@ The abcjs plugin renders all the abc in a page (determined as a new line beginni
To use, include the plugin version in the page:

```html
<script src="abcjs_plugin_X.X-min.js" type="text/javascript"></script>
<script src="abcjs_plugin_1.11-min.js" type="text/javascript"></script>
```

The abcjs plugin currently uses the JQuery library and may conflict with other libraries. If you are using other libraries which expose a $ function, you can include (since 1.0.2):
Expand Down Expand Up @@ -243,6 +265,7 @@ printerParams
paddingright 50 the spacing that the music should have on the webpage
paddingleft 15 the spacing that the music should have on the webpage
editable false if true, then when a note is clicked, it is highlighted and a callback allows the editor to move the cursor
add_classes false if true, then each element that is drawn on the SVG will have an identifying class with it that you can use to style, move, or hide the element.
midiParams
qpm 180 the tempo, if not specified in abcString
program 2 the midi program to use, if not specified in abcString
Expand Down
59 changes: 59 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Version 1.11
===

Features
---

* Added new entry points: ABCJS.startAnimation() and ABCJS.stopAnimation(), which allow for a bouncing ball-type cursor.

* Added getBeatLength() to the returned tune to get the length of a beat in measures.

* Return the tune object from renderABC() so it can be manipulated further by the caller.

* Put a copy of the engraver with the outputted tune, so that it can be manipulated later.

* Made highlighting notes more flexible: both the class name for the highlight and the note-head color can be specified or not used.

* Added descriptive classes to all SVG elements, including element type, line number, and measure number.

Bugs
---

* Fixed positioning of the highlighted characters in the editor when a line begins with a space.

* Fix the duration of whole rests to always be the length of a measure.

* Fixed bug in "unpausing" the editor's connection with the rendering.

* Move chord names above everything else on the line.

* Made more room for decorations, so they don't overlap.

* Center whole rests in the measure.

* Put accent on opposite side of the note stem.

Refactoring
---

* Moved Raphael out of the "write" folder; updated jQuery version.

* Split graphelements file into many different files.

* Changed the internal name of "printer" to "engraver" as a first step in refactoring.

* Updated the minify script to find all js files.

* Updated the minify script to change the version number in the readme automatically.

* Updated the minify script to support "a" and "b" in the version name for alpha and beta versions.

Examples
---

* Created versions of the minimized files with a name that includes "_latest", for easy reference.

* Updated the example files to always use the latest version.

* Fixed font displaying html file to note have the elements write on top of each other.

Loading

0 comments on commit 9b95f98

Please sign in to comment.