vgmrips

The forum about vgm files
It is currently 2018-12-17, 7:48:11

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: 2015-06-27, 16:40:22 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 634
I think I found a possible bug. Sometimes p.getPlaybackPosition() is bigger than p.getMaxPlaybackPosition(), especially during fade-outs. So maybe getMaxPlaybackPosition() isn't adding the fade-out seconds? I noticed this when i was making the progress slider, it went out of the page until I made it hide overflow. If you look at the project2612 pages, you'll see that songs that loop stay on 100% while they're fading out. Try http://project2612.org/details.php?id=61 track 02.

Also, regarding the Tag functions above, are these already implemented? Can I already access them from JS? I don't want to compile it myself, I fear it would take a while to get it to work.

Is there a way to avoid getting a message box if WebAudio is not supported? In the case of project2612, I just want the player buttons and progress bars to appear if playback is possible. Otherwise I want it to pretend there is no player. Maybe I can just call the verification function myself before initializing the player, and use the player ready callback to show the player controls (I do the latter part anyway).

_________________
Follow me on twitter.

If you like this post, give it a big thumbs up and hit that subscribe button down below! And as always, thanks for reading, and see you next post.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-06-28, 21:49:46 

Programmers Programmers
Offline

Joined: 2015-05-19, 22:03:39
Posts: 28
I am currently using neither FadeTime nor PauseTime (whatever that might be..) so I should probably add those..

The above mentioned tags are implemented and you'd access them on the JavaScript side using the keys: title, author, desc, player, program. (any additional tags would first need to be implemented)


Top
 Profile  
 
 Post subject:
PostPosted: 2015-06-30, 12:09:18 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 634
Thanks, I'll implement those once I figure out how to integrate them with the player design without cluttering the page.

I have another idea now, which would add a lot of visual value to the pages using the VGM player. If you look here you'll see my AS3 VGM player. It supports a few chips, and out of those, YM2612, SN76489 and YM2413 can output note information, so if you play for example, Green Hill Zone, you will be able to see all the notes. To do this, I implemented a callback for each chip, which gets called whenever there's a Note On or Note Off event, which the chip decides when that happens, depending on its input commands. I implemented this only in the AS3 version, but it can be implemented in the C version as well, so I'm thinking of doing that, at least for the YM2612 and SN76489, and somehow displaying them in the page. To display them, I can write a separate JS library that can display keyboards and piano rolls, but the note events have to get to it somehow. Sometimes it can be tens of events per second, so do you think this would be an issue with bridging the emscripten app with JS? Would there be a lot of overhead to this? Maybe there's a way to lower the overhead somehow, what do you think?

If we can manage to implement something like this, it would make the player so awesome and it would increase the site popularity gosh wow!

I can try to just implement the note events in one of the chips, like ym2612, and figure out a way to call a JS callback for every event. All the chips would call the exact same callback btw, which can look like this: void noteFunc(uint8_t chipId, uint8_t channelId, uint8_t noteNum, bool onOff); As you can see, the parameters can be condensed into a 32-bit unsigned int. The onOff parameter can even be the sign of the int. This might help optimize the bridge between the emscripten code and normal JS, so we can use that if it helps.

What do you think?

Another idea I have is to name the instruments. For example, in Green Hill Zone, there is a bass, some drums, a sort of flute, some pad keys, and other instruments, which we can list in some sort of metadata that can be an associative array of the instrument CRC32 values and the instrument names. That way we can quickly find the instrument when the chip registers correspond. It would require extra work to input the instrument names, but it would be a cool feature. We can also autodetect the instrument names from their timbres. Maybe there is a tool for that, or we could write some heuristic that does that.

_________________
Follow me on twitter.

If you like this post, give it a big thumbs up and hit that subscribe button down below! And as always, thanks for reading, and see you next post.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-06-30, 18:08:16 

Contributors Contributors
Offline

Joined: 2015-05-11, 20:23:18
Posts: 11
I only have some familiarly with the VGM format, not the playback source, so sorry if this sound stupid. But, is there any reason why you'd have a callback for each note command instead of one callback for all the commands between wait periods? Is it just too difficult to utilize Javascript objects in emscripten?


Top
 Profile  
 
 Post subject:
PostPosted: 2015-06-30, 22:37:06 

Programmers Programmers
Offline

Joined: 2015-05-19, 22:03:39
Posts: 28
@vampirefrog: "tens of events per second" does not seem to be much.. I'd suggest you just try it. Here is what you need to do:

1) In the C code where you want to call the JavaScript code you just declare the function:

void noteFunc(int a, int b, int c);

2) to the Emscripten built command you add: --js-library callback.js

3) and you create a callback.js with the following content:

mergeInto(LibraryManager.library, {
noteFunc: function(a, b, c) {
return window['someGlobalNoteFunc'](a, b, c);
}
});

This will ensure that the Emscripten build will setup the necessary wiring without it needing to know about your specific logic. You can later just define you "someGlobalNoteFunc" JavaScript function and do with the params whatever you want ..

Have fun :-)


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-01, 11:18:53 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 634
Lupinzar, the only time note events can happen IS between wait periods, since that's when the chip commands are issued. So there you go. However, I can also queue the note commands and make a callback when the buffer is filled, and that would be an optimization. I could also send the note events along with the buffer data, I'm not sure how the code works right now. And then just use the queued notes in JS.

tinyrsid, thanks, I guess this means I'll have to attempt to compile it.

_________________
Follow me on twitter.

If you like this post, give it a big thumbs up and hit that subscribe button down below! And as always, thanks for reading, and see you next post.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-01, 16:06:47 

Programmers Programmers
Offline

Joined: 2015-05-19, 22:03:39
Posts: 28
@vampirefrog: I recommend you install one of the all-included sdk https://kripken.github.io/emscripten-si ... loads.html Compiling should then be no problem.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-01, 16:11:43 

Contributors Contributors
Offline

Joined: 2015-05-11, 20:23:18
Posts: 11
vampirefrog wrote:
However, I can also queue the note commands and make a callback when the buffer is filled, and that would be an optimization. I could also send the note events along with the buffer data, I'm not sure how the code works right now. And then just use the queued notes in JS.


Ok, that's kind of what I had in mind.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-04, 1:54:06 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 634
Ok, I managed to compile it, though you should create the directory 'built' from the makeEmscripten.bat, I had to create it manually

_________________
Follow me on twitter.

If you like this post, give it a big thumbs up and hit that subscribe button down below! And as always, thanks for reading, and see you next post.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-04, 2:13:20 

Programmers Programmers
Offline

Joined: 2015-05-19, 22:03:39
Posts: 28
seems git does not check in empty folders...


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-04, 7:40:55 

Musicians Musicians
Contributors Contributors
Offline

Joined: 2012-09-29, 11:45:48
Posts: 216
Location: Australia
Indeed. That's why many open source projects have a "delete.me" file of sorts to address that. :P

_________________
-dj.tuBIG/MaliceX


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-05, 11:29:03 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 634
MaliceX wrote:
Indeed. That's why many open source projects have a "delete.me" file of sorts to address that. :P


Sorry, let me translate what MaliceX said, since I know it's hard to understand through his thick aussie accent. He said that's why many open source projects have a "delete.me" file which addresses the empty folder problem. Good day, Bruce!

_________________
Follow me on twitter.

If you like this post, give it a big thumbs up and hit that subscribe button down below! And as always, thanks for reading, and see you next post.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-06, 14:45:37 

Programmers Programmers
Offline

Joined: 2015-05-19, 22:03:39
Posts: 28
g'day mate, 'ow yer goin? no worries, look at it as an intentional entry test for those trying to use the lib :-)


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-06, 14:48:47 

Contributors Contributors
Staff Staff
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2013-07-17, 23:32:39
Posts: 342
Are you going to update the web player to the latest VGMPlay version? Would be nice to see it support the newly implemented chips.


Top
 Profile  
 
 Post subject:
PostPosted: 2015-07-06, 15:09:10 

Programmers Programmers
Offline

Joined: 2015-05-19, 22:03:39
Posts: 28
if somebody tells me where to find the latest stable version...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.193s | 18 Queries | GZIP : On ]