(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-18-24 04:54 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Sappy - exporting to .MID files New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Kyoufu Kawa
Intends to keep Rom Hacking in one piece until the end








Since: 11-18-05
From: Catgirl Central Station

Last post: 6298 days
Last view: 6298 days
Posted on 07-01-06 11:43 AM Link | Quote
I have downloaded several docs on the MIDI file format, and have tried this before, but there's one thing that prevents me from adding MIDI export functionality to Sappy 1.2.

Variable Length Values.

All the code I've seen is in C and too complex for me to convert to VB Classic. Any assistance would be cool.

Note: I intend to keep sequential buffers for each used track, two values per element. One value would be the raw, non-VLV delta time, the other would be the actual MIDI code. When saving, plonk down the header and iterate through each track buffer, converting the delta to VLV format, save that, and save the command.

My major concern is how to convert to VLV format in VB.
labmaster

Red Paragoomba


 





Since: 11-18-05
From: Away for exams, back mid-December.

Last post: 6374 days
Last view: 6304 days
Posted on 07-02-06 12:00 AM Link | Quote

void putvar(val)
unsigned long val;
{
char subs[6];
int i;

i = 0;
while( val > 127 ) {
subs[i++] = 0x80 | ( val & 127 );
val >>= 7;
}
subs[i++] = 0x80 | ( val & 127 );
subs[0] &= 0x7f;
}


I haven't used a BASIC language for years, but surely you could magick that into VB? Which bit is causing you problems? (pun fully intentional :p). Instead of >> 7 you can always just divide by 2^7.


(edited by labmaster on 07-01-06 11:01 PM)
Kyoufu Kawa
Intends to keep Rom Hacking in one piece until the end








Since: 11-18-05
From: Catgirl Central Station

Last post: 6298 days
Last view: 6298 days
Posted on 07-02-06 04:32 AM Link | Quote
Too late

I found some VB code for this. Now I have other problems.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - Programming - Sappy - exporting to .MID files |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.005 seconds; used 357.68 kB (max 423.30 kB)