|
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... |
|
![]() ![]() ![]() |
|
|
![]() |
I have written music using channel A, B and D (NOISE-DRUMS), when I play SFX which only uses channel C it stops channel D (Noise-Drums) - where's the problem? (Channel D resumes after playing SFX).
LD HL,SFX0 LD C,SFX_CHANNEL3 CALL PSGSFXPlay |
|
![]() ![]() ![]() |
|
|
![]() |
since the noise channel can also use the 3rd wave channel frequency to generate white or periodic noise, when the SFX uses channel 3 at the same time the noise channel will be silenced.
to avoid it, the only way is not to use 3rd wave channel frequency for the noise channel, which might be quite limiting honestly, but that's how the chip works. |
|
![]() ![]() ![]() |
|
|
![]() |
I changed SFX to channel B, while C is free and channel D is NOISE-Drums. Unfortunately SFX from Channel B still interrupts Noise.
LD HL,SFX0 LD C,SFX_CHANNEL2 CALL PSGSFXPlay |
|
![]() ![]() ![]() |
|
|
![]() |
SFXs can only use channel 2 (3rd wave channel) and/or 3 (noise channel)
also the VGM files should be converted according to the channels they need to use, so possible command line switches for conversion are: -2 for SFXs using channel 2 only
-3 for SFXs using channel 3 only -23 for SFXs using both channels |
|
![]() ![]() ![]() |
|
|
![]() |
I converted VGM using PSGTool.jar but did not use the additional [2 | 3 | 23] command.
Now I checked and PSGTool.jar with [23] added the converted files are identical to without it. |
|
![]() ![]() ![]() |
|
|
![]() |
so I think the issue you're experiencing is that your tune is using the 3rd wave channel [PSG2] frequency register to drive the noise channel [PSG3] and this means that any SFXs using that very same channel will force the noise channel to silence for the whole SFX duration.
there's actually nothing you can do in this situation, as current PSGlib code doesn't support playing SFXs using the 2nd wave channel [PSG1] instead of using the 3rd, so that noise channel can continue undisturbed. of course if you could change the tunes so that the noise channel uses only those three presets frequency that don't need the 3rd wave channel to get into play you will be fine. how to do that, it depends on the tracker you're using. |
|
![]() ![]() ![]() |
|
|
![]() |
Thanks for the info. Channel D (3 / Noise) mutes for a while while SFX is running, so it's not a huge problem. I was just wondering why this was happening, now it's clear. | |
![]() ![]() ![]() |
|
|
![]() |
for best results anyway if your SFX uses only the 3rd wave channel [PSG2] then convert the VGM using the additional 2 on the command line switch (it means 'filter out everything that's not on PSG2') and in your code fire the effect using:
LD HL,SFX0
LD C,SFX_CHANNEL2 CALL PSGSFXPlay |
|
![]() ![]() ![]() |
|
|
![]() |
What do I need to pay attention to or make any changes to make PSGLib work with the ColecoVision code? At the moment, nothing works, there is silence - I probably don't know something. | |
![]() ![]() ![]() |
|
|
![]() |
I suspect the PSG is mapped onto a different port in the ColecoVision. Let me check that...
edit: it seems like the ColecoVision has the PSG mapped at I/O C0-DF thus I would try changing the PSGlib.inc souce from .define PSGDataPort $7f
to .define PSGDataPort $df
and see if it plays |
|
![]() ![]() ![]() |
|
|
![]() |
I changed it earlier, but unfortunately still silence. It may be required to additionally initialize the sound via the BIOS. | |
![]() ![]() ![]() |
|
|
![]() |
other sources say the PSG port is the $E0-$FF range, so you might want to try with this instead:
define PSGDataPort $ff
|
|
![]() ![]() ![]() |
![]() |
Goto page Previous 1, 2, 3, 4, 5 |