Java Powertab Parser

59 views
Skip to first unread message

joneric.w...@gmail.com

unread,
Jul 10, 2007, 11:40:15 AM7/10/07
to Power Tab Developers Support
I've been working on a java version of a power tab file (.ptb) reader
for the past two months.
I think I've gotten far enough along to post an alpha release.
I've done some preliminary testing and it parses the few power tab
files I've tried it on.
This does not mean that there aren't any bugs, or that the code is
totally finished.

I'll post the source code as well as a binary jar file on my website
this evening at http://www.beaglebuddy.com/ptb/.
Feel free to download it and try it out.
I'd appreciate any feedback you may have.
This includes bugs as well as suggestions for making the code better,
whether it be in design, naming conventions, methods you'd like added
\removed, etc. Just about anything as long as its constructive.

My e-mail address is listed on the website, so e-mail me your comments
and bug reports.

Thanks.
Hope you like it.

Hirak

unread,
Jul 11, 2007, 2:34:35 PM7/11/07
to Power Tab Developers Support
Hi,

I downloaded the ptb reader and I got followig stacktrace.
com.beaglebuddy.ptb.utility.PTBFileException: An error occurred while
reading a score from call_of_ktulu.ptb at file position 236.
An error occurred while reading a system from call_of_ktulu.ptb at
file position 15035.
An error occurred while reading a staff from call_of_ktulu.ptb at file
position 15471.
An error occurred while reading a position from call_of_ktulu.ptb at
file position 15856.
An error occurred while reading a note from call_of_ktulu.ptb at file
position 15868.
Invalid fret number 27. It must be between 0 and 24.
at com.beaglebuddy.ptb.PTBScore.load(PTBScore.java:242)
at com.beaglebuddy.ptb.PTBFile.load(PTBFile.java:127)
at com.beaglebuddy.ptb.PTBFile.<init>(PTBFile.java:64)
at com.beaglebuddy.ptb.PTBFile.main(PTBFile.java:150)

It seems that the somehow PTB allowed 27 frets ??

It would be great if we can set up a version control like subversion
and issue tracker like bugzilla or something.
Then it would be easier for us.

Thanks
Herak

p.s i will attach the the file which I tested

joneric.w...@gmail.com

unread,
Jul 12, 2007, 3:14:18 PM7/12/07
to Power Tab Developers Support
I fixed the bug you are referring to today, and two others, and will
post the code this evening.

You're right, about the bug tracking and subversion repository, but I
just haven't sat down and done it.
I've been too busy working on the code :-)

Hopefully with these fixes, you should be able to read 80-90% of all
1.70 ptb files.

Hirak

unread,
Jul 13, 2007, 9:49:04 AM7/13/07
to Power Tab Developers Support
Okie...
I will download the code and continue testing.
so will u set up subversion??
please do it , it will be most helpful for the community.

thx
H

On Jul 12, 3:14 pm, "joneric_wennerst...@yahoo.com"

joneric.w...@gmail.com

unread,
Jul 18, 2007, 1:17:35 PM7/18/07
to Power Tab Developers Support
I've successfully tested the current version of the java power tab
reader on about 600 exisiting .ptb files.
It was able to read them all in.
So go ahead and download it at http://www.beaglebuddy.com/ptb.

Hirak

unread,
Jul 22, 2007, 10:11:59 AM7/22/07
to Power Tab Developers Support
Hi,

I will go ahead and download it.
I have been away for a while so could not test much..
Can you provide a basic documentation about the format of the file,
especially the relationships of score,notes,attributes etc with an
simple example
It would be helpful for testing and contributing.

Thanks and great work
Hirak

On Jul 18, 1:17 pm, "joneric_wennerst...@yahoo.com"


<joneric.wennerst...@gmail.com> wrote:
> I've successfully tested the current version of the java power tab
> reader on about 600 exisiting .ptb files.
> It was able to read them all in.

> So go ahead and download it athttp://www.beaglebuddy.com/ptb.

Hirak

unread,
Jul 22, 2007, 10:11:59 AM7/22/07
to Power Tab Developers Support
Hi,

I will go ahead and download it.
I have been away for a while so could not test much..
Can you provide a basic documentation about the format of the file,
especially the relationships of score,notes,attributes etc with an
simple example
It would be helpful for testing and contributing.

Thanks and great work
Hirak

On Jul 18, 1:17 pm, "joneric_wennerst...@yahoo.com"


<joneric.wennerst...@gmail.com> wrote:
> I've successfully tested the current version of the java power tab
> reader on about 600 exisiting .ptb files.
> It was able to read them all in.

> So go ahead and download it athttp://www.beaglebuddy.com/ptb.

joneric.w...@gmail.com

unread,
Jul 24, 2007, 11:01:42 AM7/24/07
to Power Tab Developers Support
The format of a .ptb file is not composed of fixed fields like the
header is.
The best way to see the format is to start with the PTBFile class, and
look at the load(PTPFileInputStream file) method.
It makes repeated calls to other ptb classes load() methods, which in
turn make calls to other classes load() methods.
Basically, each ptb class calls the load() method on the classes it
contains, and so on.
The file format that brad came up with is actually quite clever and
very difficult to understand once you spend a few minutes with it, and
it results in very small files.

joneric.w...@gmail.com

unread,
Jul 26, 2007, 11:30:49 AM7/26/07
to Power Tab Developers Support
I had sent in another post, but its been a few days and I don't see it
in the forums so I'll submit this posting in hopes that it makes it
in.

I've pretty much finished the java ptb file reader, and am now at a
crossroads.
I can continue on and do the writer part of it next, or stop here.

The deciding factor is whether brad is working on the now infamous 2.0
version.
If so, then I won't spend any more time on this, and will wait for its
release, whenever that happens to be.
Otherwise, I'll continue on with the java version.

Brad seems very reluctant to discuss anything about the 2.0 version.
Whether he's working on it, whether he's abandoned it, whether he'd
like or accept help from others, etc.
I don't understand his reasons for not wanting to talk about it, so
all anyone can do is respect his decision and accept the situation.

I would very much like to see the next version of power tab happen, as
I'm sure so would thousands of other users.

I hope this post makes it into the forums, and that Brad will resolve
the questions surrounding the 2.0 version.


On Jul 24, 8:01 am, "joneric_wennerst...@yahoo.com"

Dummy

unread,
Jul 29, 2007, 9:08:01 AM7/29/07
to Power Tab Developers Support
The reason I don't talk about is simple - I've already answered it
100,000 times.

There are a couple of places on the Web site that describe the status,
including a KB article:
http://www.power-tab.net/getarticle.php?id=18

"In the event that production on this software ceases, a message will
be posted to the main page of the Web site so that users will be 100%
certain of the software's demise."

Product Info:
"In the event that the project dies, a message will be posted so that
users aren't left in limbo. Currently the project status is active."

As far as your dilemma - perhaps a better approach is to design your
own tab format/editor. That way you'll never get tied down to worrying
about the status of PT. It's much easier to write PT import/conversion
code than write an entire PT reader/player/writer.

Brad

On Jul 26, 11:30 am, "joneric_wennerst...@yahoo.com"

joneric.w...@gmail.com

unread,
Jul 30, 2007, 1:48:07 PM7/30/07
to Power Tab Developers Support
Thanks for answering.
I wasn't trying to be a jerk or anything.

>From other postings I've seen on the web over the past few years and
others that I've talked to,
I know that I'm not the only one who was wondering what was going on
with power tab.
I had poked around on the website looking for information on this, and
didn't find it.
I have to admit I didn't see the postings you mentioned, which is
indeed my fault.

And you're absolutely right.
Writing a power tab file importer\converter is very easy compared with
writing an editor.
Its an enormous effort to write a tab editor and get all the millions
of details right, which is
why I've never done it and also because you had done such a great job
of it already.
I'd be hard pressed to match the quality and all the features of the
power tab editor.

I can imagine it must get quite tiring to answer the same question
about the next version of power tab over and over again.
One suggestion I have, is that if you have gotten this question 100,00
times, it might be beneficial to put that statement
on the main page of the website where everyone can see it. It is true
that the information is there in the knowlege base article
and the product info as you pointed out, if you've gotten the question
so many times, then it the reality is that people aren't finding it.
Putting it on the main page somewhere would both save you from the
headache of having to answer it yet again as well as letting people
know .
Just a suggestion. Again, just trying to be helpful.

Anyway, sorry if you were offended by my post.
Like I said, I wasn't trying to be a jerk or anything. Just wanted to
find out what was going on with power tab.

allpow...@gmail.com

unread,
Jul 30, 2007, 5:21:29 PM7/30/07
to Power Tab Developers Support
Joneric, I had the same question about a year ago when I finished my
parser. I think you should finish it with write support. PTE will
probably have support for previous versions. Rumor has it that the new
v2.0 format will not be bit-based. (rather XML - like) So while we
have the massive amount of support for the v1.x versions why not
finish the task?

I also understand your questions about v2.0. The long and short of it
is you can't rush an artist. (It's done when it's done) Still, I
wouldn't mind getting my hands on some beta code. (The screenshots
that appeared online 4 years ago were a tease, and left us all in
perplexity.)

Dummy

unread,
Jul 30, 2007, 11:54:40 PM7/30/07
to Power Tab Developers Support
I didn't take it as you being a jerk, and I wasn't offended by your
post.

I've tried to make as visible as possible to get people to the KB for
all questions, not just about 2.0. There is a link in the top left of
the home page (supposedly a "hot spot" according to Google) to get to
the KB search engine. The search engine itself has been custom written
so that I can track what people are searching for and adjust the
weight of the keywords based on those results. It has actually worked
quite well as the repeat questions have declined greatly over the last
few years, while traffic to the Web site has actually increased.
Adding the "Most Popular Help Articles" links has also boosted the
traffic to the KB. I have a whole new plan involving the KB that I'm
hoping to launch that I think is going to be cool.

As far as people in forums and on the Web posting the project is dead
- the same thing happened in the comments of the 2.0 KB article when
I had comment enabled articles. So the reality is, short of the actual
release itself, nothing is going to stop people from writing that type
of stuff.

Brad

On Jul 30, 1:48 pm, "joneric_wennerst...@yahoo.com"

joneric.w...@gmail.com

unread,
Sep 20, 2007, 12:15:02 PM9/20/07
to Power Tab Developers Support
Since I've got the reading of ptb files completed, I've been thinking
lately about doing the writing part.
But, I've also been thinking about maybe doing a web based viewer as
well.
The web based viewer is certainly the more exciting project to work
on :-)
Anyway, I started looking at the code to get an idea of how hard it
would be.
To say the least, it is a non trivial task.

The first question I have is about positions.
Although each staff has an array of high and low voice positions,
these are the musical positions (which can be a rest, a single note,
or a chord).
Each musical Position, has a "position" data member, which is the
drawing position on the screen.
My questions about drawing positions are:
1. Are drawing positions based on the system (section), and hence are
the same for every staff in the system (section)?
Or are drawing positions particular to each individual staff
within the section?
2. Can you give some insight in to how to determine how many drawing
positions there are for a given measure and\or staff?
The total number of drawing positions for a staff does not seem to
be saved with the file, but rather is calculated somehow at runtime.

Thanks.

allpow...@gmail.com

unread,
Sep 24, 2007, 12:14:48 PM9/24/07
to Power Tab Developers Support
You may want to check out http://sourceforge.net/projects/niffty/ for
some examples. It's a music viewer written in Java.

On Sep 20, 12:15 pm, "joneric_wennerst...@yahoo.com"

> ...
>
> read more »

joneric.w...@gmail.com

unread,
Oct 2, 2007, 9:28:26 AM10/2/07
to Power Tab Developers Support
Its quite a difficult problem to do what the score polisher does.
So I'm not surprised that brad does not want to release the code for
it.
It must have taken a lot of effort and time to write the algorithm for
laying out the drawing of the music.

That being the case, I think I might do the file writing part and
forget about the drawing for now at least.


On Sep 24, 9:14 am, "allpowert...@gmail.com" <allpowert...@gmail.com>
wrote:

> ...
>
> read more »

allpow...@gmail.com

unread,
Oct 3, 2007, 12:27:10 PM10/3/07
to Power Tab Developers Support
FYI most of the coordinates for the power tab elements are stored in
the power tab file. (MFC Rect) So you don't have to figure out a lot
of the drawing. (Except for the musical notation. Which could be
optional.)


On Oct 2, 9:28 am, "joneric_wennerst...@yahoo.com"

> ...
>
> read more »

Reply all
Reply to author
Forward
0 new messages