If I were to want to enhance some games of my choice with WAVs, NES SMB1 for example...
I have IrrKlang (the Free edition, Not Commercial) and I want to use FCEUX as a base... Problem is I cannot program a Binary Decoder that well so If I were to do so, I have to find a example based on compatible code...
Here is what I have:
Currently it is not tested or set up proper yet (WIP), It is supposed to be at $4018[MUSIC] and $4019[SOUND] (It's invalid, but can be used in my NES Remake in the future).
but I have values taken instead at $4020-403F (FDS SOUNDRAM, Makes this void for real use) because of Mappings that must use #$01, then chosen RAM value currently, Which is not what I want...
If anyone has a solution or some other, Please Post Here... Thanks
Remember: IrrKlang says it should not need a licence UNLESS it is a commercial version, I do not use the commercial version, so my stuff remains free
FCEUX is GPL. Any library combined with it must be compatible with the terms of the GPL. "Non-commercial" limitations as seen
here are
not compatible.
Are you trying to implement something like the
MP3 mapper?
tepples wrote:
FCEUX is GPL. Any library combined with it must be compatible with the terms of the GPL. "Non-commercial" limitations as seen
here are
not compatible.
Are you trying to implement something like the
MP3 mapper?
Yes, but with WAVs under emulation...
I may not have to do it, and will throw the progress away, since any music library selection for .NET is not compatible with both VS2010 and GPL, I tried Google, but there is no easy sound solution...
I ultimately want this expansion implemented, and I'm willing to help you through it to the best of my ability.
Hamtaro126 wrote:
any music library selection for .NET is not compatible with both VS2010 and GPL
You could always use a music library not for .NET. It's not like you need a solution in 100% verifiable CLR (such as something that would run on Xbox 360 or Windows Phone 7) because FCEUX itself is not for .NET.
Is the mapper used by
Japanese Bases Loaded (
JF-13, iNES #86) supported?
I don't really understand, what is it all about - but if it is about adding a MP3/OGG/WAV player into FCEUX that would be triggered by writes into a non-existant register(s), this should be easy to do, and won't require a game audio library (only decoding ones, like libogg). A multichannel mixer without pitch, volume, and pan control is really easy to write.
tepples wrote:
I ultimately want this expansion implemented, and I'm willing to help you through it to the best of my ability.
Hamtaro126 wrote:
any music library selection for .NET is not compatible with both VS2010 and GPL
You could always use a music library not for .NET. It's not like you need a solution in 100% verifiable CLR (such as something that would run on Xbox 360 or Windows Phone 7) because FCEUX itself is not for .NET.
Is the mapper used by
Japanese Bases Loaded (
JF-13, iNES #86) supported?
Partially, Sound is not implented...
I may actually use LibOGG/LibVorbis instead of IrrKlang, so I am making it a new project.
Actually, There is no example code for LibOGG, so this is still far from decided...
(Sigh, If only WinMM works...)
Hamtaro126 wrote:
Actually, There is no example code for LibOGG
Ordinarily, you'd use the "vorbisfile" library. I made an Allegro wrapper for vorbisfile a long time ago (part of Lockjaw Tetromino Game), and I made another vorbisfile wrapper in the SDL_mixer replacement that I was working on before I got back into NESdev.
tepples wrote:
Hamtaro126 wrote:
Actually, There is no example code for LibOGG
Ordinarily, you'd use the "vorbisfile" library. I made an Allegro wrapper for vorbisfile a long time ago (part of Lockjaw Tetromino Game), and I made another vorbisfile wrapper in the SDL_mixer replacement that I was working on before I got back into NESdev.
Nice thing to hear about your attempts
Mine has been replaced, using SDL, But it is complaining about Internal Object errors, and there may be more code errors with my lack of knowlage in C/CPP
In Response, from The Critic:
Wait, This is terrible, I Quit...
If anyone has a good solution (with working examples) for sound and music using WAV/OGG, Please try to bear with me, It must be GPLv2 or something though!
I paused my other planned emulator project for now until a solution is made for this...
I also need some way to implent the sound engine to use these Binary Values, In FCEU, Does it use V&0xnn for Binary Values? (Interpreted in Hex)
Code:
- = unused - future expansion,
s = if 1, it stops the music reg,
l = if 1, loop mode is enabled,
dddddd,dddddd = 12 bits = 6 sound bits + 6 music bits
WvMusReg ($4018): sldddddd
WvSndReg ($4019): --dddddd
There's a single file vorbis decoder that is public domain (you can use with GPL). I only know about it because apparently SFML uses it:
http://nothings.org/stb_vorbis/
Note that all it does is the decoding. You're still responsible for streaming the audio.
Note that FCEUX is already streaming audio, so if you want to add your own audio output, all you have to do is mix it with the data already streaming.
Disch wrote:
There's a single file vorbis decoder that is public domain (you can use with GPL). I only know about it because apparently SFML uses it:
http://nothings.org/stb_vorbis/Note that all it does is the decoding. You're still responsible for streaming the audio.
Note that FCEUX is already streaming audio, so if you want to add your own audio output, all you have to do is mix it with the data already streaming.
Thanks, May try it out...
EDIT: it doesn't seem to have a Loop function of course...
I may look somewhere else tomorrow night!
Edit: Can LGPL source code work with plain GPL in some form? If so, Audiere is the way to try at least...
Quote:
EDIT: it doesn't seem to have a Loop function of course...
Err... well yeah of course it doesn't. It's just a decoder.
Since you'd be streaming the audio, so you could make it loop. When it runs out of audio data, you'd just restart the file and decode from the beginning.
How much do you know about audio streaming? Maybe this would be too low-level for you?
Quote:
Can LGPL source code work with plain GPL in some form? If so, Audiere is the way to try at least...
Looks like it, but it depends on which version of GPL and LGPL you're dealing with.
For your reference:
http://www.gnu.org/licenses/gpl-faq.htm ... patibility
Looping often involves seeking to a point other than the beginning. A lot of video game BGMs have introductions that are not repeated. The Vorbisfile library has rudimentary support for seeking with a slight crossfade to eliminate pops.
Looping to a point other than the beginning of the song is not possible with Hamtaro's current register descriptions.
One way around that (which I've done in the past) is rather than looping to a specific time in a file, you break the file up into "intro" and "loop" portions. Play the intro file once, then loop the loop file afterwards. Works very well.
[s]EDIT: but that also is not possible with his register descriptions.[/s]
EDIT2: actually it is... since he doesn't specify the file names. Maybe playing music track 1 could actually load 2 separate files.
I don't think that NES side needs any control on the looping. It is a property of a song, which is looped or not, and game only starts and stops it when needed. A non-looped song is actually could be thought of as a looped song which loop point matches its end.
Most (all?) popular pcm encoded audio formats (mp3, ogg, wav, etc) have no concept of looping.
If he wants his new feature to support those types, the NES side will have to have some concept of looping.
No, NES side does not have anything to do with looping. It is way easier to do it on the emulator side, keeping looping transparent to the NES side, as it requires to skip a part of decoded block after loop point, and there are internal buffering problems to deal with. I honestly can't see a single reason why NES code should bother with handling it.
WAV has loop support, it is used in music software to store loop parameters for one-shot samples.
WAV is extendable; it can contain any data you want, just a matter of having a player that will pay attention to your extra data. Some other formats are similar in this respect, but really you can get this extra data in there any way you want; you could even have a filename convention which contains the loop point.
@ Shiru, I misunderstood. I thought you meant the NES side was the Emulator side.
I agree that the ROM shouldn't know any details about looping. I also agree it should be done in the emulator.
I don't think it should be solely determined by the audio file.
Disch wrote:
Most (all?) popular pcm encoded audio formats (mp3, ogg, wav, etc) have no concept of looping.
An ogg file plus a cue file (or even a cue tag in the ogg stream) has a concept of looping. A while ago I was working on a project to pack multiple sound effects into a single ogg file for use in SDL, and the builder produced an external cue file.
Shiru wrote:
I honestly can't see a single reason why NES code should bother with handling it.
If you want to be able to synchronize game action to the music's tempo, you need to know what part of the stream is playing now. For example, in levels that aren't underground, underwater, coin heaven, or castle, after having played the "final lap" jingle at TIME 099, Super Mario Bros. restarts the music at roughly the same spot.
Sorry for the OT, but I just can't seem to convince the board to stop marking this topic as unread, no matter what I do. Is that happening to anyone else?
EDIT: Yeah, not even replying to it did anything, it has a permanent orange icon! It's kinda annoying.
EDIT: Logging out and back in fixed it. Not that anyone cares.
The reason Seeking isn't supported is because I do not want to do the extra code to take up another unnessicary register...
Audiere crashes always when attempts to write a value in binary, Can anyone give me a hand?:
(May be big code, But needs assistance)
Sound.cpp, write-only:
Code:
static DECLFW(Write_ExMusic)
{
AudioDevicePtr device(OpenDevice());
OutputStreamPtr stream(OpenSound(device, V+".wav", true));
stream->setRepeat(true);
if (!(V&80))
stream->setRepeat(false);
else
stream->play();
}
static DECLFW(Write_ExSound)
{
AudioDevicePtr device(OpenDevice());
OutputStreamPtr sound(OpenSound(device, V+".wav", false));
sound->play();
}
Changed to handle only 6 bits for now, borrowed from Audiere Tutorial code.
PM me for complete C++ file