bostick / tbt-parser

A C++ parser and MIDI converter for .tbt TabIt files
MIT License
4 stars 0 forks source link

What should the tech be for playing / editing .tbt files? #1

Open bostick opened 3 months ago

bostick commented 3 months ago

I would like to have a full-fledged player and editor for TabIt files, since TabIt itself has been abandoned.

This would be a great opportunity to provide TabIt for other desktops (Mac and Linux), web, and mobile.

The parser and converter are currently written in C++, but any of the UI tech does not necessarily have to be C++.

There are pros and cons for everything and maybe we can have a discussion here about ideas.

bostick commented 3 months ago

@colinwilliams91

colinwilliams91 commented 3 months ago

So, my knowledge and expertise are somewhat narrow/limited but one good tool I am familiar with that is pretty robust/flexible would be Unity.

We can design (still might want to prototype with a different tool) and develop the UI with it and it leverages C#. It is a full game engine so it extends a lot of build capabilities (basically automatically):

I would imagine it should have no problem with C++ too. The typical workflow is to use their tool in parallel with Visual Studio.

Is the goal for editing to be like Tabit where users can create songs/files in a similar way? Or are you envisioning more for editing existing files? (more so focused around the post-song writing/exporting stage)

colinwilliams91 commented 3 months ago

@bostick Let me know if any of this sounds helpful. I'd have a quicker jump off point with these techs but I'd be down for anything. The only tradeoff on my end would be time and perhaps asking you more questions if we use something a little lower down, closer to C++ 😅.

I don't wanna write anything off based on my exp. since I have so little. There could very well be easier ways to make executables with simple UI.

Did you have anything in mind yet?

colinwilliams91 commented 3 months ago

I tagged you in a reddit thread where there is some buzz from a couple of devs as well as mention of financial support, just in case any of that is of interest 😊

bostick commented 3 months ago

I am envisioning editing existing files and also creating new ones. No reason not to do both!

Unity sounds just fine. I have developed Unity in the past, though it has been a while: https://bostick.github.io/blog/2021/11/force-pinvoke/

I'm sure integrating with the existing C++ would be no problem.

My number one concern with any new UI is smooth editing and playback. Looking at TabIt, people might think that it is simply a grid of text characters, but the subtle spacing needed for Alternate Time Regions and other features means that it is more of a canvas for 2D graphics. And playback scrolling should be close to pixel-perfect.

Editing should be first-class on desktop and web (where there are keyboards), but still possible on mobile.

And then playback would be done by converting to MIDI and using FluidSynth (https://www.fluidsynth.org/) or something like TiMidity++ (https://sourceforge.net/projects/timidity/).

colinwilliams91 commented 3 months ago

@bostick very cool!

Thanks for the rundown. I will look into these tonight. (At VueConf.us next couple days)

colinwilliams91 commented 3 months ago

@bostick I read your blog and yeah the current Unity is super convenient for multiple OS/mobile/etc.

Also, admittedly, read more about FluidSynth since it was on GitHub than TiMidity++ but I think either one sounds solid. Good finds!

I hadn't thought about that ctrl + w alternate time region feature and the spacing on the canvas. That probably is a bit on the sophisticated side. Fortunately, there are a lot of tools for UI Elements/Canvas in Unity as well.

Todo:

Options:

bostick commented 3 months ago

I have a working MIDI converter, so I have been relying on software synth like FluidSynth for then doing MIDI -> actual sound. It is straightforward to give FluidSynth a .mid file and it does a great job at tempo changes, handling multiple tracks, pitch bending, etc. And with FluidSynth, it becomes possible to use different SoundFonts (the gm.sf2 SoundFont that came installed on Windows machines is good for nostalgia, but maybe not for making good sounds).

A good first step would be wiring up FluidSynth to play a .mid file (say, https://github.com/bostick/tabit-file-format/blob/main/description/twinkle.mid).

bostick commented 3 months ago

I have been thinking about how to have a UI that is similar to TabIt, where it appears to be a grid of characters that you can navigate.

A pure grid of single-digit 16th notes that you can navigate with keyboard arrow keys would be a good first step.

Then, allowing notes on the 10th fret and above, they need to be printed nicely.

Then, bringing in features like effects (e.g. you add a harmonic that changes a 12 to <12>) and Alternate Time Regions (where 3 notes fit in the space of 2).

I have been thinking about how to add a basic tablature export feature and have been thinking about these things as well.

bostick commented 3 months ago

After playing a .mid file is working, a next step would be to use tbt-converter to convert a .mid from a .tbt file, then play that.

Lots of things probably need to be made nicer in all of my code for this to work and to be easy, but I'm here and want to get something working.

peteroupc commented 3 months ago

As for MIDI file playback, I think the feature should support:

I note that getting even FluidSynth to support all these things might not be trivial (see also FluidSynth/fluidsynth#1275).

Just as an aside, a public-domain music synthesis library and instrument banks would greatly help improve MIDI playback support across the open-source ecosystem; however, I don't insist on that.