|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
![]() |
Goto page Previous 1, 2, 3, 4, 5 |
Author | Message |
---|---|
|
![]() |
Then I guess the compression isn't helpful, except perhaps to avoid exceeding 16KB? I always compress my assets on principle, the 4MB limit doesn't come close... | |
![]() ![]() ![]() |
|
|
![]() |
The 16 KB limit is disturbing IMHO :|
Tunes that turn just over 16 KB when compressed have to be 'simplified' so that they would fit, tunes much bigger have to be split into separate tunes and somehow 'linked' at run time (that is, start part #2 when part #1 is over...) Compression on these assets also means to save some ROM for almost no drawbacks - PSGlib plays compressed tunes directly with tiny overhead. |
|
![]() ![]() ![]() |
|
|
![]() |
I suspect tunes going over 16KB are doing write intensive things like vibrato, tremolo and arpeggiation. A heavier music engine would generate these from very little data, at the cost of more CPU; these are exactly the sort of thing that it may be possible to tailor the compression for, for example some RLE for repeating sequences would do a lot better than repeated back references to a single copy of the repeated sequence. | |
![]() ![]() ![]() |
|
|
![]() |
yes, a nice alternative to a VGM-source driven approach would be a tracker-source driven approach, Mod2PSG2 style.
To do this BTW we should also (engine itself apart) create a format and converters from other tracker formats (DefleMask, MusicMaker, etc...) or revitalize Mod2PSG2 engine... |
|
![]() ![]() ![]() |
|
|
![]() |
OK, don't waste your time. Try Calindro's KiddEd built in PSG converter (export functions), it works much better. I'll let you all know when my own compressor would be finally worthy :( |
|
![]() ![]() ![]() |
|
|
![]() |
Ummmm....
This evening, testing the function PSGSetMusicVolumeAttenuation I see it only produces glitches. I explain: I want to use it to fade out the music, while its playing, doing this: // Fade music for(a=0;a<=60;a++) { SMS_waitForVBlank(); if(a%4==0) PSGSetMusicVolumeAttenuation (a>>2); } Have to say the music update routine is in a interrupt handler at 180: // Handler de interrupciones void InterruptHandler(void) { unsigned char oldbank=lastbank; // Update music if(musicbank) { changeBank(musicbank); PSGFrame(); } // Update sounds if(PSGSFXGetStatus()) { changeBank(soundbank); PSGSFXFrame(); } SMS_mapROMBank(oldbank); numinterrupts++; } Any insight? [/code] I am using z88dk, if this could be of utility... |
|
![]() ![]() |
|
|
![]() |
Tryed the following change:
SMS_waitForVBlank(); if(a%8==0) { PSGStop (); PSGSetMusicVolumeAttenuation(a>>2); PSGResume (); } But PSGResume() does not exit. Should not have been ported to z88dk. If this wont help, it doesnt matter, afterall. Thanks! |
|
![]() ![]() |
|
|
![]() |
you don't need to stop and resume to change music volume attenuation
tell me more about the glitches (I've never experienced them) |
|
![]() ![]() ![]() |
|
|
![]() |
Have been testing.
What it happens is every frame i use the function, there are a sound in channel 3 (a noise sound) at full volume. The music is 'lowering' the volume OK, but there are a 'click' (or other type or noise, from the noise type sounds you can ear in vgm2psg, by example). The video show a 120 frames fade (two seconds) with the above functions, lowering the sound each 20 frames (frame>>3). I think that if you have a music with other sound effect on chanel 3, it will play that last sound played at full volume each time you call the function. |
|
![]() ![]() |
|
|
![]() |
void PSGSetMusicVolumeAttenuation (unsigned char attenuation) {
/* ********************************************************************* sets the volume attenuation for the music (0-15) */ PSGMusicVolumeAttenuation=attenuation; if (PSGMusicStatus) { PSGPort=PSGLatch|PSGChannel0|PSGVolumeData|((PSGChan0Volume+PSGMusicVolumeAttenuation>15)?15:PSGChan0Volume+PSGMusicVolumeAttenuation); PSGPort=PSGLatch|PSGChannel1|PSGVolumeData|((PSGChan1Volume+PSGMusicVolumeAttenuation>15)?15:PSGChan1Volume+PSGMusicVolumeAttenuation); if (!PSGChannel2SFX) PSGPort=PSGLatch|PSGChannel2|PSGVolumeData|((PSGChan2Volume+PSGMusicVolumeAttenuation>15)?15:PSGChan2Volume+PSGMusicVolumeAttenuation); if (!PSGChannel3SFX) PSGPort=PSGLatch|PSGChannel3|PSGVolumeData|((PSGChan3Volume+PSGMusicVolumeAttenuation>15)?15:PSGChan3Volume+PSGMusicVolumeAttenuation); } } if channel 2 and/or channel 3 is/are busy with SFX(s) its/their volume(s) won't be updated. I don't get what's happening with your fade... are you playing an SFX there? |
|
![]() ![]() ![]() |
|
|
![]() |
Ummmm....
Have changed the function by this: PSGSFXStop(); if(lastplayedmusic!=0) { // Fade music for(a=0;a<=120;a++) { if(a%8==0) { PSGSetMusicVolumeAttenuation(a>>3); } SMS_waitForVBlank(); } } Does not work (glitches) After that fail, made a pg with a volume 0 sound and enough length. Change the function by this: PSGSFXPlaySound(nosound_psg); if(lastplayedmusic!=0) { // Fade music for(a=0;a<=120;a++) { if(a%8==0) { PSGSetMusicVolumeAttenuation(a>>3); } SMS_waitForVBlank(); } } As psglib see it is playing a sound, should not touch the volume (like you said), but does exactly the same. Doing slower fadeouts, what i can say is that it seems that ONLY in those frames in which you call psgsetmusicvolumeattenuation the music does not sound, and a glitch in channel 3 sounds instead. ... remember i am with z88dk implementation. |
|
![]() ![]() |
|
|
![]() |
try compiling a small separate program with SDCC and see if you experience the same problems. I'm my tests I don't get any problem changing volume while tune is playing. | |
![]() ![]() ![]() |
|
|
![]() |
The code in z88dk is not identical to psglib because everything has been rewritten in asm (where that applies). It should be functionally identical but it's not impossible that there are bugs.
z88dk's psglib is rooted here: https://github.com/z88dk/z88dk/tree/master/libsrc/_DEVELOPMENT/arch/sms/PSGlib/z... I'll take a look to see if I can spot anything. |
|
![]() ![]() ![]() |
|
|
![]() |
Yeah!
With kidded the psg size went from 93kb to 75kb! |
|
![]() ![]() |
|
|
![]() |
yeah, that's a nice compressor, unlike my own! :| |
|
![]() ![]() ![]() |
|
|
![]() |
just added the
PSGlib function reference that was missing... |
|
![]() ![]() ![]() |
![]() |
Goto page Previous 1, 2, 3, 4, 5 |