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

Feature Request: add/edit percussion tracks #5

Open
leocaseiro opened this issue Apr 5, 2023 · 6 comments
Open

Feature Request: add/edit percussion tracks #5

leocaseiro opened this issue Apr 5, 2023 · 6 comments

Comments

@leocaseiro
Copy link

leocaseiro commented Apr 5, 2023

Hi there, this editor looks awesome.

I am not able to add a new drumkit instrument. Are you planning to support that?
It is supported by alphatab (https://alphatab.net/docs/showcase/special-tracks/), but they hide the tabs, so I believe this is the problem, as your editor relies on the tabs.

Are you planning to support a way to edit notes via music notation, besides tab numbers?

I can see the drums when I open a .gp file that has drums (even though the sound is not playing the drums), but I can't create a new file that has drums on it, or either edit a file with drums.
I attached a .gp file with drums, in case you want to test it. Or you can find some files from guitarprotabs.org

Eg: https://guitarprotabs.orghttps://guitarprotabs.org/a/acdc/big_balls_v1_92/

drums.gp.zip

@leocaseiro leocaseiro changed the title Feature Request: add/edit drums Feature Request: add/edit drums without tabs Apr 5, 2023
@gallegretti
Copy link
Owner

Hi @leocaseiro,

Thank you for your interest in my pet project!

You're right, the editor relies on the tab notation to edit the track. I suppose something similar to TuxGuitar would be best. It displays both music and tab notations for percussion, and you can edit the tab:

image

It seems like it would be possible to modify the stave profile selector for percussion on AlphaTab and use the ScoreTab to render both the music and tab notation:
https://github.com/CoderLine/alphaTab/blob/b91b28f46bf7ce0424e58944a948417ee975ac31/src/rendering/layout/ScoreLayout.ts#L230-L245
And also changing this function to allow the creation of the renderer for percussion:
https://github.com/CoderLine/alphaTab/blob/7dcf2bdb79b1edee015b176f30d775bde2049a5a/src/rendering/BarRendererFactory.ts#L19
But doing that causes some errors in the TabBarRenderer class. I didn't look further than this, but it might not be so simple.

As you suggested, the other approach is to edit the notes directly via music notation, but this is not something that I'm planning to do.

Another problem is adding new tracks. Right now it's not possible to add a new track at all, even for a guitar. I ran into some issues when trying to do that. Modifying the AlphaTab data structures at runtime is not very easy. Definitely at the top of my TODO list, alongside adding support for partial re-rendering.

Also, I did open your drums file and the playback worked fine. Can you check if it works for you on the AlphaTab player?

@leocaseiro
Copy link
Author

Hi, thank you so much for your investigation, and POC to solve the issue.

Yeap, tuxguitar solution might be the way to go.

I was planning to create an editor for alphatab myself, my idea was to use alphatext which seemed simpler than guitarpro, so I found your project, and it was very excited.

The player in alphatab works great for drums. Thank you.

@gallegretti
Copy link
Owner

Alright, I'm leaving this issue open to track the feature of supporting creating/editing percussion tracks, and opening another to track the issue of creating a new track. Thank you for your feedback. Also, you mentioned the idea to use alphaTex. Just be aware that it doesn't seem to support percussion right now

@gallegretti gallegretti changed the title Feature Request: add/edit drums without tabs Feature Request: add/edit percussion tracks Apr 10, 2023
@leocaseiro
Copy link
Author

Thank you for letting me know. Yeap, alphaTex don't support drums yet.

Maybe the best approach is using the JSON import, do you know how to use it? Actually, I need to look into your code, I would like to know how you do the editor.

This is the JSONConverter API: https://alphatab.net/docs/guides/lowlevel-apis/#serialize-data-model-fromto-json

@gallegretti
Copy link
Owner

This editor modifies the AlphaTab model directly and then calls the render and the loadMidiForScore functions. I'm not using this jsonConverter API, but it might work for your use case.

@leocaseiro
Copy link
Author

Thank you!

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