Coder Social home page Coder Social logo

paulrosen / abcjs Goto Github PK

View Code? Open in Web Editor NEW
1.9K 58.0 275.0 64.08 MB

javascript for rendering abc music notation

License: Other

HTML 54.85% JavaScript 45.00% Shell 0.03% CSS 0.10% Dockerfile 0.01%
abc-notation midi javascript sheet-music abcjs music music-notation music-player

abcjs's People

Contributors

8633brown avatar alensiljak avatar alexgiesting avatar bwl21 avatar cameron-hicks avatar caseywatts avatar db-ryan avatar dependabot[bot] avatar dermolly avatar dranidis avatar foxbunny avatar gg314 avatar gregdyke avatar hwellmann avatar jetsons avatar jonathanlb avatar jymen avatar leocaseiro avatar lokimidgard avatar macno avatar medur avatar mikkelricky avatar milanobrtlik avatar paulrosen avatar raffadrummer avatar rigobauer avatar seisiuneer avatar simplgy avatar stevealee avatar tchandelle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abcjs's Issues

should support continuation syntax

From abc standard http://abcnotation.com/wiki/abc:standard:v2.1?s[]=comment#field_continuation

3.3 Field continuation

A field that is too long for one line may be continued by prefixing +: at the start of the following line. For string-type information fields (see the information fields table for a list of string-type fields), the continuation is considered to add a space between the two half lines.

Example: The following two excerpts are considered equivalent.

w:Sa-ys my au-l' wan to your aul' wan,
+:will~ye come to the Wa-x-ies dar-gle?

Node JS Support

What

Support for Node JS, preferably as a NPM package.

Why

This is a one of a kind Javascript package that would fill an empty void if the package were to support Node.

I am currently in need for a package that can render ABC notation and that can run in a Node environment.

Multimeasure rests

Are multi-measure rests (Z) implementend?
I see code dealing with this but they don't seem to work. Is this still something in progress?

Support for callback after render

Is it possible to add a callback after the output has been rendered? This would help get around race conditions such that logic that is dependent on the output of ABC.render is executed via callback.

Editor should keep highlighted input and output visible

It would be nice if the editor would render the notes in a scroll box and keep the highlighted sections of the abc input and the rendered output visible simultaneously at all times by updating the scroll bar positions.

Currently, selecting a note in one representation does highlight it in the other, but the user often has to scroll manually to see this. It would be nice if both highlighted elements were made visible on the screen automatically.

Bad key on some parts in multivoices tunes with key changes

In the following tune the second voice does not have an initial key declared ( and it doesn't have to have this) it is shown and played in the key of the end of the previous part.
The second part/voice should be started in G the same as the first part but it starts in D

X:1
T:Upplandsschottis
O:Sweden
M:4/4
L:1/8
Z:From Klaus Rõhling - Zeilitzheim 2013
Z:2nd part by Ben Thackeray
K:G
V:1
"G"G,2B,D G2G2|"Am"G<F A<F "D7"D4|D2FA c2c2|"G"c<B d<B G4|
"G"G2 Bd "G7"g2g2|"C"e2ce g2g2|"G"d2B<d "D7"c<A F<A|"G"G<F "D7"G<A "G"G4:||
K:D
|:"D"d2A<d "A7"c2A<c|"D"d<A d<e f2 a<f|"G"g2e<g "D"f2 d<f|"Em"e<d c<B "A7"A4|
"D"d2 A<d "A7"c2 A<c|"D"d<A d<e "D7"f2 a<f|"Em"g2 e<c "A7"A<c e<c|"D"d<c "G"d<e "D"d4:|]
V:2
D2GB d2d2|B<A c<A F4|F2Ac e2e2|e<d g<d B4|
B2 dg d2d2|G2EG c2 c2|b2 g<b a<d c<d|B2c2d4:||
K:D
|:f2d2g4|f<d f<g a4|b2g<b a2f<a|e<f g<^g a2=g2|
f2d2g4|f<d f<g a4|G2c2e2g2|f2g2f4:|]

Support different line breaks

This yields an error: Unknown character ignored at line DDDD | $ EEEE position 12:8

X:1017
F:1017_line enedings
T:linebreaks with linebreak character
C:
S:
M:4/4
L:1/4
Q:1/4=120
K:C
I: linebreak $
V:T1 clef=treble-8 name="Sopran" snm="S"
DDDD | $ EEEE
W: In the tune, there should be a new line after the Ds

abcjs should tolerate application specific instructions

I would like to use instructions like

%%hn:print {"t":"alle Stimmen", "v":[1,2,3,4], "s": [[1,2],[3,4]], "f":[1,3], "j":[1]}

or

I: hn:print {"t":"alle Stimmen", "v":[1,2,3,4], "s": [[1,2],[3,4]], "f":[1,3], "j":[1]}

but also inline
[i:hn:pitch E]

Such instructions should not be flagged as error but be reported in the parse tree such that a client application can properly handle it. Maybe the parser could take a list of instructions to be accepted.

e.g.

parser.application_instructions(["hn:pitch", "hn:print"])

refer to http://abcnotation.com/wiki/abc:standard:v2.1#application_specific_directives

Need support of transformation

ABCJS should follow the transformation attributes

Clef and transposition information may be provided in the K: key and V: voice fields. The general syntax is:

[clef=][][+8 | -8] [middle=] [transpose=] [octave=] [stafflines=]

There are many abc files flying around which make use of these attributes

abcjs blocks editor while rendering

I have a complex piece of music, it takes 2 seconds to draw the notes. The problem with this is, that during these 2 seconds the editor does not react on keystokes.

I could not find out if it is the genration of SVG or the rendition of SVG which takes this time.

Maybe we could do some of the following:

  1. allow to render each voice in a separate call
  2. apply a kind of caching of the symbols
  3. try to apply webworkers

...

Any help or support by abcjs is very welcome.

[feature request] ottava support

Hi,
First, thank you for your great work!
I would like to request a support for the ottava keyword in abcjs.
Section 4.6.6 in the ABC standard v2.1:
"An important item of notation concerns passages written in a different octave, to save ledger lines. Such a passage is marked by a dashed line starting with something like "8va". "

spurious "if (!window.ABCJS)"{window.ABCJS = {}}

I noticed that throughout abcjs_basic_2.3-min.js there are more than 30 occurrences of the block

if (!window.ABCJS) {
    window.ABCJS = {}
}

at the top level. Can't we get rid of all but the first one?

Piano Grand Staff

Hi,

First of all, I absolutely love this library. Thank you so much for the time you have put into it. I am currently trying to display a piano grand staff with staff groups. Here is the abc:

M: 4/4
L: 1/16
K: A
%%staves {V1 V2}
V: V1 clef=treble
V: V2 clef=bass
[V: V1]C16| D16| D16| D16|
[V: V2]B,,16| B,,16| D,16| D,16|

To the best of my knowledge, the curly braces in the staves directive should put a curly brace around the entire stave at the front, as in this example:

http://abcnotation.com/tunePage?a=richardrobinson.tunebook.org.uk/static/tunebook/00100

However, no element is present when I render my abc code:

image

Is it possible to display the brace for the staves? What would be necessary for me to implement in order to get the brace to display? Thanks!

abcjs does not deliver the correct position if a line starts with whitespace

if a line starts with whitespace the positions reported by abcjs are not correct. It seems that in this case the leading whitespace is ignored ...

It can be seen in abcjs editor demo using the following abc code

X: 1
T: Cooley's
M: 4/4
L: 1/8
R: reel
K: Emin
|:D2|EB{c}BA B2 EB|~B2 AB dBAG|FDAD BDAD|FDAD dAFD|
EBBA B2 EB|B2 AB defg|afe^c dBAF|DEFD E2:|

startAnimation won't work

I tried to implement startAnimation without success:

this is my code:
song = "X:1\nT: test\nM: 4/4\nL: 1/8\nR: reel\nK: Emin\n|abca|cccc|";

    $( document ).ready(function() {
        tuneObjectArray = window.ABCJS.renderAbc("score" , song);
        window.ABCJS.startAnimation($("#score")[0], tuneObjectArray[0], {hideFinishedMeasures: "true",
        showCursor: true, bpm: true})
    });

it crashes on line 153 of abc_animation.js
"cannot read property split of undefined"
it appears to crash on the bars but if I leave them out nothing happens.

abcjs crashes, if a part is denoted inline a the beginning of a line

The following testcases can be executed at http://abcjs.net/abcjs-editor.html

This part works:

X:1
T:abcjs test
C:Bw
M:4/4
L:1/16
K:G
%%score (T1 T2)
V:T1           clef=treble-8  name="v1"   snm="v1"
V:T2           clef=treble-8  name="v2"   snm="v2"
%            End of header, start of tune body:
% 1
[V:T1]  [G,,16g16] | [G,,16g16] |[g G,, G, G] C D E F G A B c d e f g a b c'|
[V:T2]  z16 | z16 | D            F F F =F F F D D D D D D D D D |
[V:T1]  EE F2 (G3G1) (A4A4)                  |(B6B2) c8                    |
[V:T2]  D D D D D D D D D D D D D D D D | D ^D D D D D D D =D D D D _D D D D |
[V:T1]  d12 d4                          | e16                             |
[V:T2]  D D D D D D D D D D D D D D D D | D D D D D D D D D D D D D D D D |

but if I add a new part voice T1 third line

X:1
T:abcjs test
C:Bw
M:4/4
L:1/16
K:G
%%score (T1 T2)
V:T1           clef=treble-8  name="v1"   snm="v1"
V:T2           clef=treble-8  name="v2"   snm="v2"
%            End of header, start of tune body:
% 1
[V:T1]  [G,,16g16] | [G,,16g16] |[g G,, G, G] C D E F G A B c d e f g a b c'|
[V:T2]  z16 | z16 | D            F F F =F F F D D D D D D D D D |
[V:T1]  EE F2 (G3G1) (A4A4)                  |(B6B2) c8                    |
[V:T2]  D D D D D D D D D D D D D D D D | D ^D D D D D D D =D D D D _D D D D |
[V:T1]  [P:part]d12 d4                          | e16                             |
[V:T2]  [P:part]D D D D D D D D D D D D D D D D | D D D D D D D D D D D D D D D D |

I get

Uncaught TypeError: Cannot read property 'staff' of undefined abcjs_editor_1.10-min.js:22
2
Error: Invalid value for <path> attribute d="Z" abcjs-editor.html:1
4
Uncaught TypeError: Cannot read property 'staff' of undefined abcjs_editor_1.10-min.js:22
6
Uncaught TypeError: Cannot read property 'push' of undefined abcjs_editor_1.10-min.js:22
2
Uncaught TypeError: Cannot read property 'staff' of undefined abcjs_editor_1.10-min.js:22
Uncaught TypeError: Cannot read property 'bagpipes' of undefined abcjs_editor_1.10-min.js:41
6
Uncaught TypeError: Cannot read property 'staff' of undefined abcjs_editor_1.10-min.js:22

If I add the part as an extra Information field, it works, but I think it is not right. In this case, the P: field is reported as part of the voice. But this should be only if the field is wrapped in []:

X:1
T:abcjs test
C:Bw
M:4/4
L:1/16
K:G
%%score (T1 T2)
V:T1           clef=treble-8  name="v1"   snm="v1"
V:T2           clef=treble-8  name="v2"   snm="v2"
%            End of header, start of tune body:
% 1
[V:T1]  [G,,16g16] | [G,,16g16] |[g G,, G, G] C D E F G A B c d e f g a b c'|
[V:T2]  z16 | z16 | D            F F F =F F F D D D D D D D D D |
[V:T1]  EE F2 (G3G1) (A4A4)                  |(B6B2) c8                    |
[V:T2]  D D D D D D D D D D D D D D D D | D ^D D D D D D D =D D D D _D D D D |
P:part
[V:T1]  d12 d4                          | e16                             |
[V:T2]  D D D D D D D D D D D D D D D D | D D D D D D D D D D D D D D D D |

It also works if the part is not at the beginning of a line:

X:1
T:abcjs test
C:Bw
M:4/4
L:1/16
K:G
%%score (T1 T2)
V:T1           clef=treble-8  name="v1"   snm="v1"
V:T2           clef=treble-8  name="v2"   snm="v2"
%            End of header, start of tune body:
% 1
[V:T1]  [G,,16g16] | [G,,16g16] |[g G,, G, G] C D E F G A B c d e f g a b c'|
[V:T2]  z16 | z16 | D            F F F =F F F D D D D D D D D D |
[V:T1]  EE F2 (G3G1) (A4A4)                  |(B6B2) c8                    |
[V:T2]  D D D D D D D D D D D D D D D D | D ^D D D D D D D =D D D D _D D D D |
[V:T1]  d12[P:part] d4                          | e16                             |
[V:T2]  D[P:part] D D D D D D D D D D D D D D D | D D D D D D D D D D D D D D D D |

It also works if the part at the beginning of the very first line:

X:1
T:abcjs test
C:Bw
M:4/4
L:1/16
K:G
%%score (T1 T2)
V:T1           clef=treble-8  name="v1"   snm="v1"
V:T2           clef=treble-8  name="v2"   snm="v2"
%            End of header, start of tune body:
% 1
[V:T1]  [P:part][G,,16g16] | [G,,16g16] |[g G,, G, G] C D E F G A B c d e f g a b c'|
[V:T2]  z16 | z16 | D            F F F =F F F D D D D D D D D D |
[V:T1]  EE F2 (G3G1) (A4A4)                  |(B6B2) c8                    |
[V:T2]  D D D D D D D D D D D D D D D D | D ^D D D D D D D =D D D D _D D D D |
[V:T1]  d12[P:part] d4                          | e16                             |
[V:T2]  D[P:part] D D D D D D D D D D D D D D D | D D D D D D D D D D D D D D D D |

But it does not work if the very first part is denoted as Information line

X:1
T:abcjs test
C:Bw
M:4/4
L:1/16
K:G
%%score (T1 T2)
V:T1           clef=treble-8  name="v1"   snm="v1"
V:T2           clef=treble-8  name="v2"   snm="v2"
%            End of header, start of tune body:
% 1
P:part
[V:T1]  [G,,16g16] | [G,,16g16] |[g G,, G, G] C D E F G A B c d e f g a b c'|
[V:T2]  z16 | z16 | D            F F F =F F F D D D D D D D D D |
[V:T1]  EE F2 (G3G1) (A4A4)                  |(B6B2) c8                    |
[V:T2]  D D D D D D D D D D D D D D D D | D ^D D D D D D D =D D D D _D D D D |
[V:T1]  d12[P:part] d4                          | e16                             |
[V:T2]  D[P:part] D D D D D D D D D D D D D D D | D D D D D D D D D D D D D D D D |

Note heads not attached to stem

The note heads in sixteenth-note chords in the following ABC code are not attached correctly to their stems:

X:1
L:1/16
M:2/4
V:1 treble  
V:2 bass
%%annotationfont   Helvetica  6
K:C
V:1
z CDE {def}[F D E C]2 [fdec][fdc] | G2c2 B2c2 | dGAB cABG 
V:2
z8 | z C,D,E, F,D,E,C, | G,2G,,2 A,2B,2

It looks like the right-most note heads are shifted right when they should be shifted left.

Thanks,
Dave

abcjs basic obscures obscures lower staves in Safari

I am making a call like this:

ABCJS_RENDERER_SETTINGS = {scale:0.6, paddingtop:10, paddingbottom:1};
ABCJS.renderAbc('notation0', abc_str, {}, ABCJS_RENDERER_SETTINGS);

to render an abc_str like this:

X:1
L:1/16
M:2/4
V:1 treble  
V:2 bass
%%annotationfont   Helvetica  6
K:C
V:1
z CDE {def}[F D E C]2 [fdec][fdc] | G2c2 B2c2 | dGAB cABG 
V:2
z8 | z C,D,E, F,D,E,C, | G,2G,,2 A,2B,2

This works fine in the Chrome browser. But most of the bass clef is cut off when I try it in Safari. It seems that abcjs is setting some incorrect style properties--making the height shorter than the SVG to be rendered and then asking the overflow to be hidden. I see this in the generated HTML:

<div id="notation0" style="width: 755px; overflow: hidden; height: 120.305068852353px;">
<svg height="200.5084480872555" version="1.1" width="1258.3333333333335"
xmlns="http://www.w3.org/2000/svg" style="overflow: hidden; 
....

It seems that Chrome is ignoring the style settings, but Safari is enforcing them. This is a bit of a show-stopper for me.

Irish roll rendering

According to this image from current ABC standard, the irish roll !roll! or ~ should be notated with an arc ("a roll mark (arc) as used in Irish music")
decorations 0000
ge

In abcjs, it's notated with a small trill symbol, similar to the uppermordent. Is that a bug? or is there a good reason for this behavior?

"transpose" in voice ignored

From the ABC v2.1 standard, we have this example. The transpose instructions in the bass clef voices are being ignored in ABCJS.

Also, the fermatas in the final measure should be combined and a beam seems to be detached in the second to last measure of the bass clef line.

I see these behaviors in the 2.0 version of ABCJS.

T:Zocharti Loch
C:Louis Lewandowski (1821-1894)
M:C
Q:1/4=76
%%score (T1 T2) (B1 B2)
V:T1           clef=treble-8  name="Tenore I"   snm="T.I"
V:T2           clef=treble-8  name="Tenore II"  snm="T.II"
V:B1  middle=d clef=bass      name="Basso I"    snm="B.I"  transpose=-24
V:B2  middle=d clef=bass      name="Basso II"   snm="B.II" transpose=-24
K:Gm
%            End of header, start of tune body:
% 1
[V:T1]  (B2c2 d2g2)  | f6e2      | (d2c2 d2)e2 | d4 c2z2 |
[V:T2]  (G2A2 B2e2)  | d6c2      | (B2A2 B2)c2 | B4 A2z2 |
[V:B1]       z8      | z2f2 g2a2 | b2z2 z2 e2  | f4 f2z2 |
[V:B2]       x8      |     x8    |      x8     |    x8   |
% 5
[V:T1]  (B2c2 d2g2)  | f8        | d3c (d2fe)  | H d6    ||
[V:T2]       z8      |     z8    | B3A (B2c2)  | H A6    ||
[V:B1]  (d2f2 b2e'2) | d'8       | g3g  g4     | H^f6    ||
[V:B2]       x8      | z2B2 c2d2 | e3e (d2c2)  | H d6    ||

Minimalize Staff Width

Hi,

I think we should add support to have the staff width minimize itself, so that only the sheet music is part of the rendered svg, such that no extraneous whitespace is included. The image attached is what I'm trying to avoid.

screen shot 2015-07-06 at 3 26 06 pm

Integration with MIDI.js

Update: Nevermind, I found the other branch.

~~Now that web 2.0 & HTML5 is here, we don't need download, quicktime, or Java applets to play MIDI (see http://galacticmilk.com/midi-js/).

https://github.com/mudcube/MIDI.js

But it looks like the MIDI support here can only write (a link and plugin) to the DOM. At the minimum, there should be a renderParm of 'raw' which returns the MIDI data rather than a DOM element in ABCJS.renderMidi API.

Ideally, there would be a ABCJS.playMidi(playParams) which integrated with MIDI.js. I can see what I can do to the midi/abc_midiwriter.js but honestly this code is a mess full of globals and I don't want to Break The Web. Maybe it should be a separate file all together. ~~

Annotations drawn over each other

The horizontal alignment of the notes seems to be fixed. So annotations wider than two characters on two consecutive notes are allowed to draw over each other. In my application, it is really important that all of the annotations be legible. It would be nice if there were a way to tell ABCJS to keep annotations aligned and visible (sliding the notes to the right as needed). I realize this may be a tall order. Perhaps an easier option would be to layer the annotations so they don't obscure each other. That would do the trick.

Many thanks for a great library.

Different classes for every note

I am trying to write a little extension that mark every note with a different Color according to my rainbow bells that have a specific color for different notes (8 bells for one octave going from C to C). Is there a nice way to add the tone pitch of a note as a CSS Class so that i can use Colors for different note.

I also plan the same mechanism when my boomwhrackers have been shipped as they also use Colors for different pitches.

Any plans for a Bower package?

Hello -

Quick question: I've just discovered the joy of Bower, and I'm currently working on a project that uses ABCJS. Any thought of releasing ABCJS as a Bower package? This would allow developers using ABCJS to keep their versions up to date more easily. I would also be willing to help if that would aid in the process! Seems pretty easy: http://bower.io/docs/creating-packages/

In any case, thanks for this great code and all your hard work!

Annotations drawn over note beams

Thanks for developing this incredibly useful library.

In the following ABC, annotations in the bass line are obscured by the beams.

X:1
T:Onnotations
L:1/16
M:2/4
K:C
V:1 treble
V:2 bass
V:1
z +4+CDE F2G"_4"F, | +5+G2c2 B2c2 | dGAB cABG | d2g2 f2g2 | eagf egfa | %5
V:2
z8 | z "_1"C,"_3"D,E, F,"_3"D,"_5"E,C, | +5+G,2G,,2 z4 | z G,A,B, CA,B,G, | C2B,2 C2D2 | %5

It seems that ABCJS is good at missing the note heads with annotations, but not always the stems and beams.

Parser reports wrong duration

The following abc code is not parsed properly. The whole rests (z4) in Voice T2 are reported as 8xL. The code did work in 1.10 but fails in commit ef31061. I played around with the issue and it appears that everything that boils down to (L x duration = 1) is reported as a full measure (in this case 4/2 = 2). IMHO duration of a note should not be depending on M: but only on L: as it was in 1.10.

X:2
M:4/2
L:1/4
Q:1/4=120
K:Ebmaj
%%score T1 T2
V:T1 clef=treble-8 octave=-1 name="v1" snm="v1"
V:T2 clef=treble-8 octave=-1 name="v2" snm="v2"
[V:T1] |: ">E" z E E2 E2 "^4x" E2 :|
%
[V:T2] |: z4 G4 :|

Would like to be able to highlight multiple notes in the tune preview separately

I want to highlight the notes while they are played. I am playing based on my own model using musical.js. There I have callbacks when a note is started, and when it ends. I can

My code looks like this: (self.printer is a ABCJS.write.Printer)

inst.on('noteon', function(e){
    self.printer.rangeHighlight(e.origin.start, e.origin.end);
  })

But in this case all previous notes are unhighlighted. But I need to highlight / unhighlight them individually.

Long story short: I need methods

rangeHighlightMore(startchar, endchar)
rangeUnHighlightMore(startchar, endchar)

such that I could use

inst.on('noteoff', function(e){
    self.printer.rangeUnHighlight(e.origin.start, e.origin.end);
  })

Tried to implement this on my own, but could not find a proper starting point (see issue #9).

I also wonder if it is really necessary to collect the highlighted notes just for global unhighlight. Unselecting every note could also be done by unselecting every existing object.

How can I reproduce abcjs_basic_1.10-min.js

I wanted to find a stable point to branch from. So I checked out the commit which brought abcjs_basic_1.10-min.js ([b61e44a]) and tried to regenerate the same. But I got a different result which also did not work in my application. It did not even draw the notes ...

I tried with the commit [be55fc7] but had no success either ...

Note heads overlapping

Hello, I guess there is an issue when multiple voices are a second apart. The two note heads should not overlap. The note head of the second voice should be displayed a bit more to the right, so that doesn't overlap. Is there a way to overcome this problem?

ex. abcjs
screen shot 2015-12-04 at 13 27 23

ex. sibelius 7
screen shot 2015-12-04 at 13 54 37

Render each line in a tune to a different div?

Dear Paul:

I am writing an editor for pianists to enter fingering annotations. They enter (mostly) digits in an input field, and my code updates the abc string with appropriate annotations and re-renders. To keep the input fields next to the rendered notes, I am currently preprocessing each line in an input tune into separate abc tunes and rendering them individually, with some strained logic to keep the header information correct. I attach a picture of what my interface currently looks like.

screen shot 2015-05-28 at 11 45 23 pm

As you can see, the tie continuation marks are not rendered using this approach, and in general my approach seems rather brittle. What I really need is to display each individual line as it appears in the context of the whole tune. Is there a way to do this in abcjs?

Thanks,
Dave

Best support for Bagpipe "gracenote"

Hello,

First of all, a big thank you to develop abcjs, this is really great !

I have request regarding the "gracenote" :

  1. it is missing the line when the "gracenote" is high above or below the staff.
  2. it would be great if the groups of "gracenote" were displayed diagonally (up or down) when it is necessary (like groups of note in fact).

Actual abcjs gracenote (K:HP) :
abcjs gracenote

Best gracenote support :
abcjs gracenote

Thank you very much

proto_noconflict.js creates conflicts

adding methods to objects messes with people who assume they can use for ... in without checking hasOwnProperty

Should check whether methods are already before redefining them.

should replace each by forEach (which is now part of the javascript spec)
should replace clone by slice() (creates a shallow copy)

Fix timing event sorting that causes buggy animation

In playing with startAnimation, I've noticed that occasionally some notes are skipped or are held too long. A cursory inspection seems to be a problem with the timing events that the animation is based off of.

Voice overlay

This is really a feature request. Section 7.4 in 2.1 ABC standard, which allows additional voices to be added to a measure on the fly, would really come in handy for what I am trying to do. But this "volatile" feature does not appear to be implementers in ABCJS. That is, the last measure in the following ABC code does not have three voices in it:

T:Zocharti Loch
C:Louis Lewandowski (1821-1894)
M:C
Q:1/4=76
K:Gm
(B2c2 d2g2)  | f6e2         | (d2c2 d2)e2 | d4 c2z2 &\
                                                              A8  &\
                                                              F2 E2 D2 CB, |

Thanks for all of your great work.

Midi program, midi instrument

Hello, im try to do like:

window.onload = function() {
        abc_editor = new ABCJS.Editor("abc", { paper_id: "paper0", midi_id:"midi", warnings_id:"warnings",midi_options:{instrument:64}, add_classes: true , gui:true });
    }

im try to select a program instrument for midi generated, but im see that always generate program 2, im try to modify also on library to make test but i cant see, what generate midi is always on program2.
can i do samething on params?,

thanks

Annotations overwrite tempo marking

See the following abc code:

X:5
M:C
L:1/16
Q:"Allegro moderato"
V:1 treble
V:2 bass
%%annotationfont   Helvetica  10
K:F
V:1
!p!z"_1"a"_2"^g'"_3"a' "_4"e'"_3"f'"_4"^c'"_3"d' "_2"^g"_1"a"_2"e"_3"f "_4"^c"_2"d"_1"^G"_2"A|]
V:2
."_1"D,2."^2""^3"[DF]2."_4"A,2."^3""^4"[DF]2 ."_3"D,2."^4""^3"[DF]2."_4"A,2."^3""^4"[DF]2|]

This example also shows the staccato markings being overwritten.

Support for midi download without midi player

It'd be great if the 'midi player' in ABCJS.renderMidi() could be disabled, so one could do something

In html:

<button id='midi-button'>Download MIDI</button>

And, in javascript:

$('#midi-button').click(ABCJS.renderMidi(...))

Is this already supported? Am I missing something? Many thanks for a great library!

Last line is not justified

Use a piece of music with a shorter last line than the rest of the lines.

The expected output is that the last line is justified to match the width of all the other lines. Instead the line is aligned to the left and squished.

This applies to all versions that I have tried (including the latest 2.1).

Example: http://theocarinanetwork.com/single/?p=8369853&t=7338254
abcjs_justify_bug2

(Issue 149 on Googlecode)

Stacked annotations render over notes

Notes and annotations draw over each other in the following abc:

X:7
M:3/4
L:1/16
Q:"Allegretto vivace"
V:1 treble
V:2 bass
%%annotationfont   Helvetica  10
K:D
V:1
!p!(3"_1"f'"_2"g'"_1"f'(3"_2"e'"_1"f'"_2"e' (3"_1"d'"_2"e'"_1"d'(3"_2"c'"_1"d'"_2"c' (3"_1"b"_2"c'"_1"b(3"_2"a"_1"b"_2"a|]
V:2
"^3""^1"[B,,B,]2 z2 "^3""^1""^2"[F,B,D]2 z2 "^1""^2""^3"[F,B,D]2 z2|]

Rendering problems with triplets

The following Testcase

X:1004
T:triplet abcjs bug 18
C:Zupfnoter Testcase
C:Bernhard Weichel
R:{rhythm}
M:4/4
L:1/4
Q:1/4=120
K:C
%%score T1 T2  B1 B2
V:T1 clef=treble-8 octave=-1 name="Sopran" snm="S"
V:T2 clef=treble-8 octave=-1 name="Alt" snm="A"
[V:T1] (3c/d/e/ fff | (3c/2c/2c/2 c c c|]
[V:T2] D D D D | C C C C|]

yields

screenshot_100

Problem does not occur if there is only the first measure.

Warnings should refer to startpos / endpos

As of now parser.getWarnings() yields an HTML fragment. This fragment refers to a line - which is not correct.

Would it be possible that getWarnings() yields an array of error object, such that embedders can for example implement a drilldown to the root position.

Display on a keyboard

Do you know if a tool / library exist that does this:

input : chord in abc language. ex : [C E G]

output : the chord displayed on a keyboard (the key to use highlighted)

screenshot

It would be helpful to help a friend who doesn't know music notation, and would like to learn chords ;)

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.