ScoreHero
Home | Forum | Wiki
Inbox [ Login ]Inbox [ Login ]
SearchSearch MemberlistMemberlist
ProfileProfile Log inLog in
Chart<-->Mid Converter
Goto page Previous  1, 2, 3, ... 19, 20, 21  Next
 
Post new topic   Reply to topic    ScoreHero Forum Index -> Software
View previous topic :: View next topic  
Author Message
Leff  





Joined: 04 Dec 2006
Posts: 1315

PostPosted: Fri Dec 28, 2007 6:00 am    Post subject: Reply with quote

Wow I can't believe I didn't re-read those. Thanks for the heads up Robin!

I'm back to campus now so I'm gunna see if those sustains are fixed and try to come up with the calculation for that bpm used for the offset (help is welcome, I tend to get confused when working with seconds/ticks/bpm/mpq).

EDIT: Success! No infinite sustains! I also updated the Offset handling, here's the basic calculation so someone can check it and confirm that it's right, though it worked with bodom's A7X chart and I got the same GHex results and it looks perfect (I don't have the mp3, so I can't 100% check).

If Offset is not 0, multiply by 1million to convert to microseconds;
divide by 4 to get ms per quarter note;
store in bytes;
add tempo event (0x51) to tempo track with offset bytes at tick 0;
set Offset to 1920 to move all other events ahead by one measure.

If Offset is 0, take no action.

That seems to be correct, and I've converted a few charts and they all look perfect in GHex, so woo hoo! OP link updated, this baby's basically done.
_________________



Last edited by Leff on Fri Dec 28, 2007 7:09 am; edited 1 time in total
Back to top
View user's profile Send private message XBL Gamertag: LeffelMania
GameZelda  





Joined: 30 Mar 2007
Posts: 1705

PostPosted: Fri Dec 28, 2007 7:08 am    Post subject: Reply with quote

Well, I hope that I've helped to solve this

Not related to your tool but related to GH Midi, anyone knows because the GH2 songs have only note-ons? It's a problem with my midi parser?

Here's the start of FoP:

Code:
Valid MTrk chunk! (42257 bytes)
0 (+0): Track name > PART GUITAR
0 (+0): Text > [idle]
1905 (+1905): Note-on > Note 105, Speed 100
1905 (+0): Note-on > Note 93, Speed 100
1905 (+0): Note-on > Note 81, Speed 100
1905 (+0): Note-on > Note 69, Speed 100
1920 (+15): Note-on > Note 96, Speed 100
1920 (+0): Note-on > Note 72, Speed 100
1920 (+0): Note-on > Note 60, Speed 100
1920 (+0): Note-on > Note 46, Speed 100
1920 (+0): Text > [play]
1920 (+0): Note-on > Note 84, Speed 100
2035 (+115): Note-on > Note 96, Speed 0
2035 (+0): Note-on > Note 72, Speed 0
2035 (+0): Note-on > Note 60, Speed 0
2035 (+0): Note-on > Note 84, Speed 0
2239 (+0): Note-on > Note 86, Speed 100
2355 (+116): Note-on > Note 98, Speed 0
2355 (+0): Note-on > Note 86, Speed 0
2395 (+40): Note-on > Note 46, Speed 0


As you can see, all are note-ons and with speeds "0" for note-off and "100" for note-on
_________________
(Ok, I failed to do it in 24 hours... ).

GH:WT-PS2 Customization Progress
[100%] Make it work (w/songs loading) in a DVD5 (thanks psychospacefish!)
[100%] Modify audio (Finally done 25/11/2008)
[100%] Modify charts (Done 26/11/2008! Customs finally )
Back to top
View user's profile Send private message
Leff  





Joined: 04 Dec 2006
Posts: 1315

PostPosted: Fri Dec 28, 2007 7:52 am    Post subject: Reply with quote

OK, so I'm losing precision on my bpm calculations. I think this is pretty obviously because I was just using integers when I was storing the ms per quarter note in bytes. I did that because, I'll admit, I... don't know how to store Double values into bytes...

I noticed this when testing xSergeantMinorx's "Holiday" chart. The first bpm event has a value of 14,370 (14.370 bpm). Converting this to mpq gets (60,000,000 / 14.370) = 4175365.34447... mpq. And I have no idea how to turn that into a byte array to send as a parameter when creating a tempo event. Thoughts? (at this point I should barely take credit at all for this program, with all the help I've needed...)

It amazes me the kind of practical, useful things you're not in a university Computer Science program... </complaint>
_________________

Back to top
View user's profile Send private message XBL Gamertag: LeffelMania
bodom0015  





Joined: 17 Mar 2007
Posts: 768

PostPosted: Fri Dec 28, 2007 12:18 pm    Post subject: Reply with quote

Leff wrote:
OK, so I'm losing precision on my bpm calculations. I think this is pretty obviously because I was just using integers when I was storing the ms per quarter note in bytes. I did that because, I'll admit, I... don't know how to store Double values into bytes...

I noticed this when testing xSergeantMinorx's "Holiday" chart. The first bpm event has a value of 14,370 (14.370 bpm). Converting this to mpq gets (60,000,000 / 14.370) = 4175365.34447... mpq. And I have no idea how to turn that into a byte array to send as a parameter when creating a tempo event. Thoughts? (at this point I should barely take credit at all for this program, with all the help I've needed...)

It amazes me the kind of practical, useful things you're not in a university Computer Science program... </complaint>


Hmmm, I'm currently taking a programming class myself and have yet to learn Java (we're using VB.NET). What's the difference between a Byte Value and a Byte Array if there is one? Is an Array just multiple values for that Byte or something? (Would THIS match your problem at all? I don't really know because, again, I don't speak Java... D: )

That bolded part is nonsense. You think when kata made GHex it went smoothly? I doubt it. Do you think when malictus made GWiz it was perfect first try? Bullshit. Every program has obstacles. Once you get past them, you achieve greatness! Beta testers are required for every program as each one will have its own unique kinks to unravel. Too many metaphors? Deal with it.

And as for the last line YOU'VE BEEN EXPOSED! Lol.
_________________
[quote:e0e72f52e0="J.T."]One week, only 7 people had Awesomeness Detection on, and they were all young and did not play well. Thus, Naked Brothers became DLC.
Back to top
View user's profile Wiki User Page Send private message Send e-mail XBL Gamertag: bodom0015
SixStringedBass  





Joined: 14 Jul 2007
Posts: 181

PostPosted: Fri Dec 28, 2007 4:34 pm    Post subject: Reply with quote

This is from a chart to mid that I had started (and actually almost finished, but would've been command line) but you got it up and working before me so I will help you instead. Just import java.io.* or those collections directly.
Code:
   public static byte[] toBytes(int num) throws IOException
   {
      ByteArrayOutputStream byte_out = new ByteArrayOutputStream ();
      DataOutputStream data_out = new DataOutputStream (byte_out);
      data_out.writeInt(num<<8);
      return byte_out.toByteArray();
   }


Also, I believe that chart files use a resolution of 192, so when calculating the offset, you need to take that into consideration, unless you resample the whole chart into 480.
Back to top
View user's profile Send private message XBL Gamertag: SixStringedBass
Leff  





Joined: 04 Dec 2006
Posts: 1315

PostPosted: Fri Dec 28, 2007 8:07 pm    Post subject: Reply with quote

God I can't seem to get this! I thought I had it working with a suggestion from bodom's link, and I got really excited, but I was wrong. I've been looking into ByteArray/DataOutputStreams, but the thing is that it needs to be a Double value (I was using ints, lost too much precision), so I can't quite use your code, SixStringedBass, and it also has to be a byte array of size 3, since you can only pass 3 bytes to create a tempo event, and the toByteArray() method just returns as many bytes as it needs. Maybe I'm just missing a simple adjustment to your code, SSB, but I'm still stumped.

Oh, and the resolution thing is fine, just had to multiply the .chart time-stamps by 2.5 actually. I was surprised that actually worked so simply, but hey, jackpot.
_________________

Back to top
View user's profile Send private message XBL Gamertag: LeffelMania
GameZelda  





Joined: 30 Mar 2007
Posts: 1705

PostPosted: Fri Dec 28, 2007 8:21 pm    Post subject: Reply with quote

Leff wrote:
God I can't seem to get this! I thought I had it working with a suggestion from bodom's link, and I got really excited, but I was wrong. I've been looking into ByteArray/DataOutputStreams, but the thing is that it needs to be a Double value (I was using ints, lost too much precision), so I can't quite use your code, SixStringedBass, and it also has to be a byte array of size 3, since you can only pass 3 bytes to create a tempo event, and the toByteArray() method just returns as many bytes as it needs. Maybe I'm just missing a simple adjustment to your code, SSB, but I'm still stumped.

Oh, and the resolution thing is fine, just had to multiply the .chart time-stamps by 2.5 actually. I was surprised that actually worked so simply, but hey, jackpot.


I don't recommend you to multiply ALWAYS by 2.5. Multiply it to (480 / resolution)
_________________
(Ok, I failed to do it in 24 hours... ).

GH:WT-PS2 Customization Progress
[100%] Make it work (w/songs loading) in a DVD5 (thanks psychospacefish!)
[100%] Modify audio (Finally done 25/11/2008)
[100%] Modify charts (Done 26/11/2008! Customs finally )
Back to top
View user's profile Send private message
Leff  





Joined: 04 Dec 2006
Posts: 1315

PostPosted: Fri Dec 28, 2007 9:54 pm    Post subject: Reply with quote

Good call. Done. I just sorta figure all charts were a 192 resolution.

Once again I was way over-thinking that whole Double thing. I looked at what GHex generates when it imports a chart, and it turns out that it just floors the mpq into an int. Apparently this is plenty of precision because that Holiday chart syncs up just like the original chart now. So now I'm just gunna clean a few things up and then I'll update the OP and we should be good-to-go.

EDIT: All done! Changed the GUI so you don't have to select Bass/Rhythm Coop anymore, since I realized that info is already in the chart header. Syncing should be precise, sustains are correct, Star Power and Player Sections are correct, dB Offsets are created, if anything else is buggy, let me know.
_________________

Back to top
View user's profile Send private message XBL Gamertag: LeffelMania
bodom0015  





Joined: 17 Mar 2007
Posts: 768

PostPosted: Fri Dec 28, 2007 9:58 pm    Post subject: Reply with quote

Congratz! I'll test it out for you some more when I get home tomorrow.

The only thing I'd recommend if it isn't already there is a line that makes sure the file is a .chart. I figure you put it in already, but just thought I'd say in case you forgot.
_________________
[quote:e0e72f52e0="J.T."]One week, only 7 people had Awesomeness Detection on, and they were all young and did not play well. Thus, Naked Brothers became DLC.
Back to top
View user's profile Wiki User Page Send private message Send e-mail XBL Gamertag: bodom0015
Revo75  





Joined: 07 Dec 2007
Posts: 22

PostPosted: Fri Dec 28, 2007 10:00 pm    Post subject: Reply with quote

Leff wrote:
Good call. Done. I just sorta figure all charts were a 192 resolution.

Once again I was way over-thinking that whole Double thing. I looked at what GHex generates when it imports a chart, and it turns out that it just floors the mpq into an int. Apparently this is plenty of precision because that Holiday chart syncs up just like the original chart now. So now I'm just gunna clean a few things up and then I'll update the OP and we should be good-to-go.

EDIT: All done! Changed the GUI so you don't have to select Bass/Rhythm Coop anymore, since I realized that info is already in the chart header. Syncing should be precise, sustains are correct, Star Power and Player Sections are correct, dB Offsets are created, if anything else is buggy, let me know.
Great work! This opens up a slew of more customs to try out for GH3 :P Thanks
Did you update the download link in the OP?
Back to top
View user's profile Send private message
Sirko  





Joined: 18 Dec 2007
Posts: 4

PostPosted: Fri Dec 28, 2007 10:41 pm    Post subject: Reply with quote

Thank you for the hard work leff. Been waiting a while for a .chart to .mid
Back to top
View user's profile Send private message
TheOmniSuave  





Joined: 26 Nov 2007
Posts: 46

PostPosted: Fri Dec 28, 2007 11:27 pm    Post subject: Reply with quote

Thank you very much for your hard work.
I'm going to test this out now. I'll let you know if anything is screwy.
Back to top
View user's profile Send private message
Robin  





Joined: 28 Jun 2007
Posts: 120

PostPosted: Sat Dec 29, 2007 12:42 am    Post subject: Reply with quote

Works great with all my tests! And it looks like since the only user-controlled thing is which file to look at, it will be hard for anybody to do it wrong.

I assume that this program will eventually implement the fixes that GHEx performs on chart files, like adding missing end events?

Awesome job, Leff!

Leff wrote:
It amazes me the kind of practical, useful things you're not in a university Computer Science program... </complaint>

Seriously..... All I learned from the classes I took was basic Java syntax and where to find the docs. Grrrrr...........
_________________
DO NOT READ BELOW THIS POINT

You just lost the game. Sucker!
Back to top
View user's profile Send private message
buggiedude91  





Joined: 27 Dec 2007
Posts: 170
Location: in front of the "you failed jordan" screen

PostPosted: Sat Dec 29, 2007 12:54 am    Post subject: Reply with quote

Thanks a bunch!!! i can't wait to put some SH customs into frets on fire!
Back to top
View user's profile Send private message
Leff  





Joined: 04 Dec 2006
Posts: 1315

PostPosted: Sat Dec 29, 2007 4:12 am    Post subject: Reply with quote

Robin wrote:
Works great with all my tests! And it looks like since the only user-controlled thing is which file to look at, it will be hard for anybody to do it wrong.

I assume that this program will eventually implement the fixes that GHEx performs on chart files, like adding missing end events?

Awesome job, Leff!

Leff wrote:
It amazes me the kind of practical, useful things you're not in a university Computer Science program... </complaint>

Seriously..... All I learned from the classes I took was basic Java syntax and where to find the docs. Grrrrr...........


As long as it's an actual .chart text file with the correct extension, there's no way they can mess it up. It'll catch it if it's not and tell them to pick a different file, at least.

I really didn't think of implementing the fixes, might be a good idea though. The most common thing I see in GHex is "Empty Triggers Track Added," which the program does. I could implement an end event fix pretty easily I think. I guess I just don't know what else could really be wrong with them, FeedBack is pretty fool-proof in generating valid events and everything it seems. If there are other fixes you can think of, by all means post them and I'll see what I can do. Thanks again for your help, I eventually realized the only way I was really gunna learn to use Java practically was to do it myself, yeesh. $14k a year on tuition so I can teach myself shit, hey? Great.
_________________

Back to top
View user's profile Send private message XBL Gamertag: LeffelMania
Display posts from previous:   
Post new topic   Reply to topic    ScoreHero Forum Index -> Software All times are GMT
Goto page Previous  1, 2, 3, ... 19, 20, 21  Next
Page 2 of 21

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Copyright © 2006-2024 ScoreHero, LLC
Terms of Use | Privacy Policy


Powered by phpBB