Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - PSGLib - sfx silencing channels for too long

Reply to topic
Author Message
  • Joined: 10 Aug 2023
  • Posts: 33
Reply with quote
PSGLib - sfx silencing channels for too long
Post Posted: Mon Sep 04, 2023 4:59 pm
Hi there,

I'm using PSGLib .h/.c from devkitSMS to play music and sound effects. When I play the sound effects, the affected channel of the song seems to be silenced a lot longer than the duration of the sound effect.

I've got two sound effects, created in Deflemask.
- one that plays on SN3
- one that plays on SN4

The end of the SN channels are marked with an "OFF" note.

I use PSGTool to convert the first effect using the 2 flag, and the second using the 3 flag. I understood that 2 maps to SN3 while 3 maps to SN4.

Then I use assets2banks to export to bank2.c and bank2.h.

I'm just starting out so I wonder what step I'm missing. Any idea?

Thanks!
pw
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Mon Sep 04, 2023 5:06 pm
Maybe the exported VGM has silence at the end? You could try trimming it.
  View user's profile Send private message Visit poster's website
  • Joined: 12 Aug 2021
  • Posts: 74
Reply with quote
Post Posted: Mon Sep 04, 2023 5:25 pm
I can confirm, trim the sound effect VGM and you'll have the desired effect.

If you're using Deflemask (like me), you could also just shorten the pattern size to stop right after the end of the sound, then re-export the file into VGM. Otherwise, any silence after your sound effect will also be exported. It makes more sense for music so that's why it does not trim silence.
  View user's profile Send private message
  • Joined: 10 Aug 2023
  • Posts: 33
Reply with quote
Post Posted: Mon Sep 04, 2023 5:28 pm
That's likely the case. Although from what I understand, I only needed to add the OFF marker to the track.

I'm using the classic Deflemask. A "section" of music is 64 beats/notes/whatever and the sound effect uses the first 4. I haven't found a method in the app to trim everything past the sound effect notes.

EDIT: I replied too fast! :) I see the method to reduce the number of rows and I'll try again.
  View user's profile Send private message
  • Joined: 12 Aug 2021
  • Posts: 74
Reply with quote
Post Posted: Mon Sep 04, 2023 5:31 pm
I believe the option is called "Rows", it is 64 by default
  View user's profile Send private message
  • Joined: 10 Aug 2023
  • Posts: 33
Reply with quote
Post Posted: Mon Sep 04, 2023 5:34 pm
That was it! I reduced the number of rows. Sound effects work great now.

Thanks everybody!
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Mon Sep 04, 2023 9:39 pm
You can also try the "Stop song" command.

I don't know the command in Deflemask, but in Furnace it is FF00, and in SnevenTracker C00.
  View user's profile Send private message Visit poster's website
  • Joined: 10 Aug 2023
  • Posts: 33
Reply with quote
Post Posted: Fri Sep 15, 2023 11:43 pm
I've gotten back to working on sounds for a bit and I noticed that the sound I'm playing on the noise channel doesn't sound at all like what I did in Deflemask. I had a high-ish pitched impact sound but in game it sounds like a low pitched burp. It's exported and played on channel three.

I've tried changing the feedback and frequency bits but that didn't seem to do anything. I was attempting to change it this way:


__sfr __at 0x7F PSGPort2;

void main(void)
{
   PSGPort2 = 0xE5; // 11100101  and other variations...
}



I have a second bloop sound effect on channel 2 that I play right before it. It sounds perfectly fine. If I play the bloop sound, I get the low burp sound from the impact sound effect. But if I don't play it, the impact effect is higher pitched. I don't know enough to say what the difference might be.

Any ideas?
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 378
Reply with quote
Post Posted: Sat Sep 16, 2023 2:56 am
The 3rd square channel will affect the noise channel, depending what type of noise you use.
Normal noise where C is low pitch, C# medium pitch and D high pitch noise will NOT be affected by the 3rd square channel.
But any other type of noise will be affected by the 3rd square channel.

So try silencing the 3rd square channel, while you play the problematic sound effect.
  View user's profile Send private message Visit poster's website
  • Joined: 10 Aug 2023
  • Posts: 33
Reply with quote
Post Posted: Sat Sep 16, 2023 4:35 am
Ok! I’ll try it out.

Are there any docs/references available about channel 3 affecting the noise channel?
  View user's profile Send private message
  • Joined: 01 Feb 2014
  • Posts: 878
Reply with quote
Post Posted: Sat Sep 16, 2023 7:04 am
If the noise channel is in white noise mode, it will play the noise at the pitch in channel two. If it’s in periodic noise mode, you’ll get a deep humming buzz that’s four octaves lower than the frequency laid down in channel two.

I don’t really know Deflemask, but assuming it works the same as Furnace, you have to note that those trackers handle the noise channel quite confusingly. In fact they let you enter both mode and pitch in channel 3. The "duty" part of your instrument determines the mode the noise channel is in. It works the same as the 20xy effect. Which you can also use.

If you use the noise channel in a mode where the pitch is controlled by channel 2, Furnace (and I assume Deflemask) expects you to leave channel 2 empty.

Frankly, I’d stay away from using either tracker for creating sound effects. They are great for music, but for sfx, I use Mod2Psg2 instead. You can easily try out how the channels affect each other there and see which one(s) you need to export for PSGlib to play them exactly the way you want. If you want any kind of pitched noise, you always need to tell the converter to convert both channel 2 and 3.
  View user's profile Send private message
  • Joined: 10 Aug 2023
  • Posts: 33
Reply with quote
Post Posted: Sun Sep 17, 2023 1:13 am
I've converted the sound effects to use channels 2 and 3 and things seem to sound like they should, which is good. I'm a little disappointed that a noise-based sound effect takes two channels instead of one, but I can live with it.
  View user's profile Send private message
  • Joined: 01 Feb 2014
  • Posts: 878
Reply with quote
Post Posted: Sun Sep 17, 2023 5:50 am
You can try to create sound effects that only use the three pre-set frequencies of the noise channel, as those will work on channel 3 alone. Of course you’re very limited in what you can do with them, but for short popping, clicking crackling or hissing noises, those ways of expression should be sufficient.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3828
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Sep 21, 2023 9:51 am
pw wrote
I've converted the sound effects to use channels 2 and 3 and things seem to sound like they should, which is good. I'm a little disappointed that a noise-based sound effect takes two channels instead of one, but I can live with it.


yeah, that's how the PSG chip works, and it's a common pitfall :/
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!