Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some questions #34

Closed
remcohh opened this issue Jul 16, 2016 · 1 comment
Closed

Some questions #34

remcohh opened this issue Jul 16, 2016 · 1 comment

Comments

@remcohh
Copy link

remcohh commented Jul 16, 2016

Hi, I am very impressed with your work on zupfnoter.
I understand that you use abc2svg for rendering your tunes.
What i don't understand completely is how you get the musical structure in your app, pitches times and positions in the score. I looked at abc2svg myself but I couldn find a way to get tune data, for example for playing it and animating notes. I would be very thankfull if you could give me some pointers!

@bwl21
Copy link
Owner

bwl21 commented Jul 16, 2016

HI,

what exactly do you want to achieve? What kind of project do you have in mind?

To answer your question so far. There is a core-API for abc2svg. See http://moinejf.free.fr/js/interface-1.xhtml

In addition to this there is an API to get a JSON representation. Zupfnoter is implemented in opal/Ruby. You can see the connection to this API in https://github.com/bwl21/zupfnoter/blob/master/30_sources/SRC_Zupfnoter/src/opal-abc2svg.rb

There are callbacks whcih allow to inject IDs based on the the ABC-Model to the generated SVG. By this you can connect and highlight particular notes.

Furtheron you can get a JSON representation of the abc2svg model enhanced by the midi pitch.

    def _callback_get_abcmodel(tsfirst, voice_tb, music_types, info)

      json_model = ""
      %x{
          abcmidi = new AbcMIDI();
          abcmidi.add(#{tsfirst}, #{voice_tb}[0].key);
          to_json = new AbcJSON();
          #{json_model} =  to_json.gen_json(#{tsfirst}, #{voice_tb}, #{music_types}, #{info});
      }

      @abc_model = JSON.parse(json_model)

      if $log.loglevel == "debug"
        $log.debug(@abc_model.to_json)
      end
      @abc_model
    end

Hope that helps. I close this issue. Please send a personal email if you have questions. I will be glad to help.

B.

@bwl21 bwl21 closed this as completed Jul 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants