AGD - How to play AY sound effects WITH music?
- Lee Bee
- Dynamite Dan
- Posts: 1350
- Joined: Sat Nov 16, 2019 11:01 pm
- Location: Devon, England
- Contact:
AGD - How to play AY sound effects WITH music?
Is there any way to play an AY sound effect in 1 channel while background music continues playing in the other 2 channels?
Alternatively, is there a way to begin playing a tune from a specific point? So you can resume background music when a sound effect has ended?
Alternatively, is there a way to begin playing a tune from a specific point? So you can resume background music when a sound effect has ended?
Re: AGD - How to play AY sound effects WITH music?
I think so, I have been playing Hakkenkast lately and it does have AY music and sounds at the same time
Some of the tech gurus will probably know better and how!
Some of the tech gurus will probably know better and how!
Re: AGD - How to play AY sound effects WITH music?
Absolutely you can. You can do whatever you want as the channels are mostly separate (I say mostly as there's only one noise frequency although you can have a noise on each channel!).
My AY driver usually plays a 3 channel tune but for my latest endeavour, I wanted in-game music and AY effects so I did exactly that. 2 doing the music and one for FX. The driver is always processing the 3 under interrupt so I just trigger an FX in the game and the FX is just output naturally as part of the 3 channel driver. The FX are just short bursts of tune, arpeggio chords or noise. I did consider stealing a channel temporarily for FX but found that I could get a half decent tune with just 2 channels anyway - especially if one is also adding some noise in for 'percussion' (such as it is!)
The only slight complication was modding it so the 2 channel tunes would restart seamlessly if required.
My AY driver usually plays a 3 channel tune but for my latest endeavour, I wanted in-game music and AY effects so I did exactly that. 2 doing the music and one for FX. The driver is always processing the 3 under interrupt so I just trigger an FX in the game and the FX is just output naturally as part of the 3 channel driver. The FX are just short bursts of tune, arpeggio chords or noise. I did consider stealing a channel temporarily for FX but found that I could get a half decent tune with just 2 channels anyway - especially if one is also adding some noise in for 'percussion' (such as it is!)
The only slight complication was modding it so the 2 channel tunes would restart seamlessly if required.
-
- Microbot
- Posts: 134
- Joined: Tue Jun 09, 2020 6:14 am
- Contact:
Re: AGD - How to play AY sound effects WITH music?
It's also possible to use all 3 channels for music and add the FX in a 'safe' way (e.g.play noise-based fx frames in parallel with tone-based music frames etc), because lol why not and 3>2 anyway. I've made an FX player like that some time back (ayfx compatible), that works with most AY music players with a slight modification
But he is specifically saying 'AGD' here, which in this context normally means 'don't bother, any of that is probably useless here' ~
But he is specifically saying 'AGD' here, which in this context normally means 'don't bother, any of that is probably useless here' ~
Re: AGD - How to play AY sound effects WITH music?
Ah! My mistake. I missed the obvious 'AGD' bit. In that case, I'm useless as I've never seen AGD - kindly disregard all my ramblings...
- Lee Bee
- Dynamite Dan
- Posts: 1350
- Joined: Sat Nov 16, 2019 11:01 pm
- Location: Devon, England
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Thanks, anyway, chaps.
Sorry, I should probably have made the "AGD" bit more prominent. I'm currently working on some audio for a developer who's using AGD and simply wants to use a few AY sound effects (because they sound good) without the music resetting every time a sound effect plays! You'd think that wouldn't be too much to ask
Sorry, I should probably have made the "AGD" bit more prominent. I'm currently working on some audio for a developer who's using AGD and simply wants to use a few AY sound effects (because they sound good) without the music resetting every time a sound effect plays! You'd think that wouldn't be too much to ask
As clever as that sounds, I'd find it unthinkable to make either music or sound effects that weren't allowed both noise and tones!Nienn Heskil wrote: ↑Sat Apr 08, 2023 4:40 pm It's also possible to use all 3 channels for music and add the FX in a 'safe' way (e.g.play noise-based fx frames in parallel with tone-based music frames etc), because lol why not and 3>2 anyway. I've made an FX player like that some time back (ayfx compatible), that works with most AY music players with a slight modification
-
- Microbot
- Posts: 134
- Joined: Tue Jun 09, 2020 6:14 am
- Contact:
Re: AGD - How to play AY sound effects WITH music?
What I mean is, to play only the stuff that the currently-playing effect uses at the current moment (whether tone, noise or both), and leave other things in the channel 'mostly' untouched, rather than switch them off completely.
In any case, if you guys can work with ASM code, feel free to check it out:
mFX - source code
mFX - test package (run .SNA and press keys 1-5)
I've never got to make a proper package with docs and whatnot, but the source code should be fully commented and usable.
In any case, if you guys can work with ASM code, feel free to check it out:
mFX - source code
mFX - test package (run .SNA and press keys 1-5)
I've never got to make a proper package with docs and whatnot, but the source code should be fully commented and usable.
- Lee Bee
- Dynamite Dan
- Posts: 1350
- Joined: Sat Nov 16, 2019 11:01 pm
- Location: Devon, England
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Ooooh, I see. That would probably be helpful, especially if you had a game with mostly noise-based sound effects that could share with a music channel containing no noise.Nienn Heskil wrote: ↑Tue Apr 11, 2023 3:09 pm What I mean is, to play only the stuff that the currently-playing effect uses at the current moment (whether tone, noise or both), and leave other things in the channel 'mostly' untouched, rather than switch them off completely.
But there's always the problem of envelope priority - what happens when both your sound effects and music use an envelope (which for me is typical). Even Arkos Tracker, with its powerful SFX support, doesn't allow management of this issue.
-
- Microbot
- Posts: 134
- Joined: Tue Jun 09, 2020 6:14 am
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Yes, that's one of the limitations that can't be helped much regardless of the player. Using the hardware envelope of the AY in a channel excludes the usage of (regular) channel volume settings, which is what sfx normally use.Lee Bee wrote: ↑Tue Apr 11, 2023 8:53 pm But there's always the problem of envelope priority - what happens when both your sound effects and music use an envelope (which for me is typical). Even Arkos Tracker, with its powerful SFX support, doesn't allow management of this issue.
If you think about possible solutions to this problem, it more or less comes down to this: either play the fx OR the (hw envelope parts) cleanly, or somehow play both but likely very distorted, or not in a way that makes a lot of sense anyway. In other words, it's just one type of clashing vs another type of clashing. Which is why it's reasonable to go for the easier option.
Re: AGD - How to play AY sound effects WITH music?
I vaguely remember a player that looked for the least busy channel and played the fx on that. Sorry for not remembering the exact name.
-
- Microbot
- Posts: 134
- Joined: Tue Jun 09, 2020 6:14 am
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Just got around to testing it and it works greatNienn Heskil wrote: ↑Tue Apr 11, 2023 3:09 pm What I mean is, to play only the stuff that the currently-playing effect uses at the current moment (whether tone, noise or both), and leave other things in the channel 'mostly' untouched, rather than switch them off completely.
In any case, if you guys can work with ASM code, feel free to check it out:
mFX - source code
mFX - test package (run .SNA and press keys 1-5)
I've never got to make a proper package with docs and whatnot, but the source code should be fully commented and usable.
Thank you for sharing.
-
- Microbot
- Posts: 134
- Joined: Tue Jun 09, 2020 6:14 am
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Glad it helped!
Re: AGD - How to play AY sound effects WITH music?
@Nienn Heskil
I just read about a fixed AYFX player by Haplo: https://www.zxuno.com/forum/viewtopic.php?f=39&t=643
In your mFX code, is this fix incorporated?
I just read about a fixed AYFX player by Haplo: https://www.zxuno.com/forum/viewtopic.php?f=39&t=643
In your mFX code, is this fix incorporated?
Re: AGD - How to play AY sound effects WITH music?
What happens if you enable noise on more that one channel? Is it any louder? Or is it just the same as when it's on one channel?
I can see how maybe you could temporarily override the setting of noise pitch for your sound effect, but continue to use noise on your music channel for percussion. Would you even be able to hear that it was still being used for percussion while an explosion is sounding?
I assume the best solution is to design the tune with one channel deliberately under-used, e.g. a quieter accompaniment to the main melody and bass / percussion on the other two channels. Something that won't particularly be missed if it drops out to make sound effects. (Although I gather you couldn't do this in AGD). Simplest is to write a 2-channel tune with no noise-based percussion, then do your effects on one channel with noise and envelopes (unless your tune uses bass envelopes, in which case your effects have to go without).
I think it's also important to keep your effects in notably different frequency / octave regions, and louder than, your tune. That 128K music update to R-Type, where the melody drops out to allow the main gun firing pew-pew noise (which is in the same tonal range and volume as the melody) sounds absolutely terrible.
I can see how maybe you could temporarily override the setting of noise pitch for your sound effect, but continue to use noise on your music channel for percussion. Would you even be able to hear that it was still being used for percussion while an explosion is sounding?
I assume the best solution is to design the tune with one channel deliberately under-used, e.g. a quieter accompaniment to the main melody and bass / percussion on the other two channels. Something that won't particularly be missed if it drops out to make sound effects. (Although I gather you couldn't do this in AGD). Simplest is to write a 2-channel tune with no noise-based percussion, then do your effects on one channel with noise and envelopes (unless your tune uses bass envelopes, in which case your effects have to go without).
I think it's also important to keep your effects in notably different frequency / octave regions, and louder than, your tune. That 128K music update to R-Type, where the melody drops out to allow the main gun firing pew-pew noise (which is in the same tonal range and volume as the melody) sounds absolutely terrible.
- Lee Bee
- Dynamite Dan
- Posts: 1350
- Joined: Sat Nov 16, 2019 11:01 pm
- Location: Devon, England
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Noise on two channels at once doesn't sound any louder, only distorted and unpleasant, so I avoid it as best as I can. Saying that, brief noise clashes aren't too noticeable and it's no big deal for SFX noise to briefly clash with drum noise.
However, envelopes on two channels at once is the opposite. For music, it can add harmonics and a "thicker texture" to the sound, great for a "rock" sound. On the other hand, it is truly dangerous mixing enveloped SFX and music together, since the pitches will be different, and you'll either ruin the SFX or the music.
In summary, my rules are:
Yes this technique should be essential for games where SFX can interrupt music tracks. I've always called it "2.5 channel" music. You bring all the least important sounds together into the ".5 channel" to be ducked while SFX plays. Which sounds you "duck" depends on the type and frequency of the game's sound effects and what sounds best.
Games which don't use this principle can be extremely irritating on the ears, as you note:
Agreed! You mean this. I started making my own version of the R-Type level 1 tune. It makes full use of all 3 channels, but in reality if I were making music for a game like R-type with near-constant SFX, the tune would basically be 2 channels with a few subtle embellishments in the third channel.
I suppose a "dream" Spectrum audio engine would let you supply both a 3-channel and 2-chanell version of in-game music, with the engine switching to the 2-channel version during SFX play.
Agreed. As a musician, I try to keep ALL parts as tonally separate as possible to avoid a "muddy" mix. Being a lover of clarity, I also personally limit myself to a maximum of 3 simultaneous melodic parts in any piece of music. It's one of the reasons I think Speccy music sounds good as it has fewer parts.
-
- Microbot
- Posts: 134
- Joined: Tue Jun 09, 2020 6:14 am
- Contact:
Re: AGD - How to play AY sound effects WITH music?
It doesn't say exactly what was the bug and/or where is the fix, so it's hard to say. Iirc I rewrote the player from scratch for mFX, and may (or may not) have noticed/fixed some bugs from the original player at the time, but I'm not aware of any in my version.XoRRoX wrote: ↑Sun Mar 31, 2024 9:00 pm @Nienn Heskil
I just read about a fixed AYFX player by Haplo: https://www.zxuno.com/forum/viewtopic.php?f=39&t=643
In your mFX code, is this fix incorporated?
Re: AGD - How to play AY sound effects WITH music?
just to add, one alternative would be to use something like Shiru's AYFX player, and to create simple tunes which are sound effects, and play them using some kind of a timer.
- Cheez26
- Dizzy
- Posts: 71
- Joined: Sat May 04, 2024 2:36 am
- Location: Midwestern United States
- Contact:
Re: AGD - How to play AY sound effects WITH music?
One of my proposed methods is using the beeper as a dedicated card for sound effects so I can use AY for music, but I'm not sure if that'll work since I've realized that not every model has a beeper and would only have AY.
Chelsea E., a Speccy fan from the U.S.
Also a musician and a beginning games developer.
Also a musician and a beginning games developer.
Re: AGD - How to play AY sound effects WITH music?
Every Spectrum has a beeper. And it wasn't uncommon back in the day to do sound effects via the beeper and music via AY, that way you didn't need to change things between the 48 and 128 machines.
Re: AGD - How to play AY sound effects WITH music?
We use that method in Cesare and It works very well.
- Cheez26
- Dizzy
- Posts: 71
- Joined: Sat May 04, 2024 2:36 am
- Location: Midwestern United States
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Well, this is all good to know. Thanks.
Chelsea E., a Speccy fan from the U.S.
Also a musician and a beginning games developer.
Also a musician and a beginning games developer.
- Lee Bee
- Dynamite Dan
- Posts: 1350
- Joined: Sat Nov 16, 2019 11:01 pm
- Location: Devon, England
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Beeper SFX with AY music is fairly standard and seems to be the only system you can use in AGD.
- Cheez26
- Dizzy
- Posts: 71
- Joined: Sat May 04, 2024 2:36 am
- Location: Midwestern United States
- Contact:
Re: AGD - How to play AY sound effects WITH music?
There's also AGDX+ which is a mod/upgrade of AGD. and has an AYFX option/command somewhere. Otherwise, yeah, I would guess so.
Chelsea E., a Speccy fan from the U.S.
Also a musician and a beginning games developer.
Also a musician and a beginning games developer.
- Lee Bee
- Dynamite Dan
- Posts: 1350
- Joined: Sat Nov 16, 2019 11:01 pm
- Location: Devon, England
- Contact:
Re: AGD - How to play AY sound effects WITH music?
Oh if that's true then you've solved this question for me, thanks!