Coder Social home page Coder Social logo

Comments (5)

paulrosen avatar paulrosen commented on July 20, 2024

I know what you mean, but could you include an example ABC string anyway so
I can see the extent of what you are trying to do? If it is just a little
bit too large then sliding notes around might be reasonable, if it is way
too large, then I need to layer it.

On Fri, Apr 24, 2015 at 12:12 PM, David Randolph [email protected]
wrote:

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.


Reply to this email directly or view it on GitHub
#32.

Paul Rosen
Performant Software Solutions, LLC

from abcjs.

dvdrndlph avatar dvdrndlph commented on July 20, 2024

Sure thing. Here is some ABC that should illustrate the problem:

X: 1
T: Cooley Snippet
M: 4/4
L: 1/8
R: reel
K: Emin
|:"^1/2"D2|"^2/3"E"^4/1"B"<2"{c}+1+B+3+A+5+ B2 +1+E+3+B|"^232323"~B2 "^121212"~B2 +5+d+3+B+2+A+1+G|+3+F+1+D+4+A+1+D BDAD|FDAD dAFD|
EBBA B2 EB|B2 AB defg|afe^c dBAF|DEFD E2:|

I am writing a little a collection tool for piano fingering data. (It lives at https://github.com/dvdrndlph/didactyl/tree/master/mdc.) Basically, pianists enter fingering values in a text box, and these are rendered in real time by your fine library. The problem is that some note heads (those marked with trill or grupetto marks and notes with different fingerings within different repeated sections, for example) require more than one character to annotate completely. The +1+ fingering annotations are not usable for this task, since they expect a single value 1-5. So I am using double-quote annotations.

A related problem appears with annotations for multiple grace notes, which cannot be placed with their specific note heads at all. As seen in the ABC above, I am annotating grace notes to the left of the main note. This can also lead to bits writing over each other.

I realize this may be a hard thing to get right, but it seems that each elements need to know how not to draw over other elements on the page. But anything you can do in your library (or any workarounds you could suggest) to mitigate these problems would be appreciated.

Thanks,
Dave

from abcjs.

paulrosen avatar paulrosen commented on July 20, 2024

Would you try this version and let me know if it works for you? https://github.com/paulrosen/abcjs/blob/master/bin/abcjs_basic_2.1b1-min.js

from abcjs.

dvdrndlph avatar dvdrndlph commented on July 20, 2024

Thanks for the quick turnaround. For my immediate purposes, this new version works great. The notes slide over nicely.

But I am thinking now that for most use cases, people might prefer a layered approach with some clever way to make sure no annotations overwrite any others.

Also, for general consumption, we would need some way to make these behaviors configurable.

Cheers,
Dave

from abcjs.

paulrosen avatar paulrosen commented on July 20, 2024

There can definitely be improvement here, but I'd like to get all reasonable examples to not touch first. I'll try to have the above code in an official version in the next couple weeks.

from abcjs.

Related Issues (20)

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.