Simple game sounds
Michel L
Posts: 141
I have made a couple small projects with the propeller of which my last (and biggest one) was a clock with timer and alarm functions.
This weekend I have planned to create asteroids.
My plan is to make something structured like this (I have always problems structuring my projects. I'm a Java programmer so I'm used to pass objects through)
Main loop (game logic in non blocking loop)
|- VGA Vector driver (1 cog)
|- Human control (1 cog)
|- Sound (1 cog)
| |- Sound generator (1 cog)
I have found a couple objects SNEcog, AYcog, SIDcog, gm_synth with which I could generate my sound.
But the problem is that I'm not really playing music. It's mainly sound fx. (Asteroids players will know that the original version didn't include music)
Maybe I'll add them If I get done too early. (Probably not )
What I'm looking to do is make an object (running in its own cog) with some methods like: shot_fired, asteroid_hit,...
Each of these functions would then play a short piece of sound through one of the previously mentioned objects. (I haven't decided which one yet, any recommendations?)
But this gives a problem with overlapping sounds. Any ideas how I can fix this without using multiple sound objects?
Thanks in advance for any hints
This weekend I have planned to create asteroids.
My plan is to make something structured like this (I have always problems structuring my projects. I'm a Java programmer so I'm used to pass objects through)
Main loop (game logic in non blocking loop)
|- VGA Vector driver (1 cog)
|- Human control (1 cog)
|- Sound (1 cog)
| |- Sound generator (1 cog)
I have found a couple objects SNEcog, AYcog, SIDcog, gm_synth with which I could generate my sound.
But the problem is that I'm not really playing music. It's mainly sound fx. (Asteroids players will know that the original version didn't include music)
Maybe I'll add them If I get done too early. (Probably not )
What I'm looking to do is make an object (running in its own cog) with some methods like: shot_fired, asteroid_hit,...
Each of these functions would then play a short piece of sound through one of the previously mentioned objects. (I haven't decided which one yet, any recommendations?)
But this gives a problem with overlapping sounds. Any ideas how I can fix this without using multiple sound objects?
Thanks in advance for any hints
Comments
http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/hydra/List/0/SortField/4/ProductID/467/Default.aspx
Go toward the bottom of the page where there are links to the documentation and software. There is a whole section on sound effects that should help.
Robert
The AY-3-8910 (AYcog) was without a doubt the most used sound chip in arcade machines until about 1987 or so. So it will definitely give the most "authentic" retro sound effects.
The "trick" to make retro sound effects is simply: "Change PSG registers over time"; That's the way it was done in the 80s and that's the way you have to do it today if you want authentic retro sound effects.
Back then there was not any easy ways to do sound effects.
My unreleased Retronitus sound engine would probably fit like a glove for what you want to do. It just takes a single cog and can handle both music and sound effects at the same time.
And MOST importantly, you don't need to manually change registers over time to achieve sound effects (or music). Load a "pre defined register write file" (well, it actually is a program running in Retronitus) into memory and a simple call to a method will do everything for you.
IMHO the sound generators provided with the Hydra will not give you true retro sound effects because they do sound generation differently compared to PSGs from the 80s.
My idea now is to split sound fx and music.
I have found a version of your Retronitus with some fx files included. And I would like to use that to do my fx.
As your editor is not yet released I think it would be very hard to make a song. Short sound effects based on the ones included should be possible.
For my music I would then use gm_synth (http://forums.parallax.com/showthread.php?111867-Music-Synthesizer-object-with-General-MIDI-sound-set).
Is it possible to mix the output of Retronitus with the gm_synth using the stereo spatializer? (http://obex.parallax.com/objects/64/)
Or does Retronitus really need it 2 outputs as physical pins?
Is this setup feasible? I know the stereo spatializer can work with 4 vocaltrackts. But I would not know how to couple the gm_synth or Retronitus with it.
I can help you to do music and sound FX for Retronitus. Maybe that will help me to be motivated to finish the editor as well.
That would be nice, only, this project is something I will make this weekend together with a friend. I can't expect you to create my music this weekend.
I have opened the sound files using a hex editor an I also have been through your code. Although I've not yet fully understood the format you use I hope I will be able to this evening. So that I know what I'm doing if I change a soundfx file.
Maybe I can borrow your editor this weekend or; as I'm a software engineer myself I could maybe even help in the development. I'm always looking for nice projects to support.
I don't think you will be able to decode the "format" before the weekend. You can't directly write to Retronitus internal registers. Retronitus sound FX is actually code that runs in the cog and "tweeks" the internal register over time.
Maybe you can. The sound FX part of the editor actually works perfectly. I will get back with more info tomorrow.
Btw, I have included a zip-file with FX created in my editor.
RetronitusSoundFx.7z
You will have to try each FX in the different sound channels to find out which gives the best results.
Most FX should be played in one of the square channels, but some FX may sound best in a Saw, Tri or Noise channel.
I wanted to do my sound fx each time I bumped into a wall or brick. The weird thing was that only the first time I played the sound fx it played correctly. The second time it always went weird. Is this normal behavior, something that was changed in a more recent version or a bug?
I had it with multiple fx files (amongst them was "bump"). Both the sound files I used and the Retronitus source came from RetronitusTeaser.
I don't know of any bugs in the engine. (yet)
Breakout - Archive [Date 2012.12.22 Time 18.02].zip
Here you go. It's made using the demoboard with a vga screen, ps/2 mouse and some speakers/headphones.
The following if statement is true every frame.
So it's possible that the sound part doesn't work anymore.
Good luck!
/Johannes