Shop OBEX P1 Docs P2 Docs Learn Events
Donkey Kong Sound — Parallax Forums

Donkey Kong Sound

CardboardGuruCardboardGuru Posts: 443
edited 2007-05-30 12:21 in Propeller 1
The recent posts about sound drivers have made me start thinking about sound for Donkey Kong and...

Sound isn't really my thing you know. I could do with some help.

So here's where we are. I'd love to use Eric's new midi player, but I have allocated just one cog for sound. I can't spare any more. I'm also very short on memory. Right now I don't even have enough to include a sound driver object. But I'll compress the tile maps and create more room at some point.

I do have a game loop that operates reliably at 60 loops per second though, so it should be possible to schedule notes/sound effect events from that.

So what are the choices of sound driver which use 1 cog? Nick Sabalausky's driver sounds like an option. But with the negative that distribution within the package isn't allowed. Andrew's HSS appears to need 2 cogs, so I guess I can't use that.

Then there's the actual tunes/sound effects themselves. I do have a keyboard and I suppose I could try and match the notes I hear from MAME. But I'm no musician so it might be all wrong. Or maybe it's possible to extract the note values from these MIDI versions. http://www.classicgaming.com/dkdb/audio_midi01.htm But I'm not sure how close they are. But then I'd be lost with how to produce the right voices.

So can anyone with some musical/audio ability give a helping hand on this one? Anything from suggestions through to producing a little demo app with one or more of the tunes/sound effects from DK in.

Comments

  • epmoyerepmoyer Posts: 314
    edited 2007-05-15 23:38
    I bet you could get a slightly modified version of the HDMF player to run in yor main task loop. Today the HDMF player extracts the next note to be played, figures out what system counter tick to play it on, sits and spins until the coutner reaches the proper time, makes a play call to Nick's driver, and then goes around again. you should easily be able to modify it to extract the next note, figure out what tick to play it on, and if the note's play time is still in the future then just go around the loop again and check next time, etc. Your temporal granularity in when you start notes will be as fine as the granularity of your main loop. I bet 60 times a second still gives you good playback quality.

    As for extracting note values from MIDI files, the HDMF converter will do that for you and dump them to it's text console. Even if you choose not to use HDMF as a playback engine, you can use the converter to figure out MIDI values.

    I had a lot of success last night is using H.A.M. to place data in upper EEPROM (above 32K), and Nick has written a EEPROM driver which makes it easy to get data back out again. You may be able to place some of your game's assets in upper EEPROM to save you space, as long as the code to retrieve them is smaller than the assets you need to store there [noparse]:)[/noparse]. Putting music there probably doesn't work for you because you wouldn't be able to do the EEPROM reads on the fly in your main loop and keep up, and you won't have another cog free to do them for you.

    Post Edited (epmoyer) : 5/15/2007 11:49:21 PM GMT
  • epmoyerepmoyer Posts: 314
    edited 2007-05-15 23:49
    One thing that will be just a little weird is that chords will be arpeggiated, in that each note will start on a different pass through the game loop. Again, at 60 loops per second I bet it sounds fine for DK music.
  • BaggersBaggers Posts: 3,019
    edited 2007-05-16 09:32
    CardboardGuru said...
    The recent posts about sound drivers have made me start thinking about sound for Donkey Kong and...

    Sound isn't really my thing you know. I could do with some help.

    So here's where we are. I'd love to use Eric's new midi player, but I have allocated just one cog for sound. I can't spare any more. I'm also very short on memory. Right now I don't even have enough to include a sound driver object. But I'll compress the tile maps and create more room at some point.

    I do have a game loop that operates reliably at 60 loops per second though, so it should be possible to schedule notes/sound effect events from that.

    So what are the choices of sound driver which use 1 cog? Nick Sabalausky's driver sounds like an option. But with the negative that distribution within the package isn't allowed. Andrew's HSS appears to need 2 cogs, so I guess I can't use that.

    Then there's the actual tunes/sound effects themselves. I do have a keyboard and I suppose I could try and match the notes I hear from MAME. But I'm no musician so it might be all wrong. Or maybe it's possible to extract the note values from these MIDI versions. http://www.classicgaming.com/dkdb/audio_midi01.htm But I'm not sure how close they are. But then I'd be lost with how to produce the right voices.

    So can anyone with some musical/audio ability give a helping hand on this one? Anything from suggestions through to producing a little demo app with one or more of the tunes/sound effects from DK in.
    You seem to be having the same trouble I had, running out of memory, but since Hydra and Protoboard have >32Kb eeproms...
    You can use Ham like epmoyer said, But I seem to be having trouble with that [noparse]:([/noparse] seems to be doubling 1K buffers.
    Why don't you do what I'm doing now, and use >32KB to store the levels graphics, and load them in when needed.
    I just have a first download app that copies the stuff to eeprom above the first 32KB, which I download and run, then it's there for good [noparse]:)[/noparse]
    then download the game as normal [noparse]:)[/noparse]
    that way, you'll have room for sound etc.

    Just my 2p's worth.

    Post Edited (Baggers) : 5/16/2007 11:25:04 AM GMT
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-05-16 10:46
    Hi Baggers,

    I'll save using the EEPROM for a project when I actually need it. It's nice to be able to load the whole thing on to the Hydra in one step from the Prop Tool.

    At the moment I have 4 levels and the intermission screen stored as maps. 5*32*28*2 = 8Kb. But I don't really need all that space. The original didn't do this. It drew the screens - (whether in code or from a data table I'm not sure). I can do the same in far less than 8Kb.
  • BaggersBaggers Posts: 3,019
    edited 2007-05-16 11:29
    Hi CardboardGuru,

    No Probs, I didn't really want to use upper memory, but I have the title screen in also now, and it keeps going over memory.
    I think I'll try compress the levels down, as I'd like to load it in one go too [noparse]:)[/noparse]
  • Ym2413aYm2413a Posts: 630
    edited 2007-05-21 05:54
    You know... If all you need is simple music and sounds we could always just control the (HSS) sound engine from your main game cog.
    That's if you got a few clock cycles to kill. [noparse]:)[/noparse]

    --Andrew Arsenault.
  • BaggersBaggers Posts: 3,019
    edited 2007-05-21 08:23
    Andrew,
    How's the docs and editor coming?

    Cheers,
    Jim.
  • Ym2413aYm2413a Posts: 630
    edited 2007-05-21 10:06
    Jim! : )

    I've made a block diagram of the FX synth engine along with a table of all values and ranges.
    Also I'm going to soon add .WAV support to the .hwav tool!

    HSS version 1.5 is done and just needs some final debugging. [noparse]:)[/noparse]

    I'm excited!
    Because I'm working out a music tracker for the .hmus format. Also I want it to support my next "propeller" music file format. Which is like SUPER hmus! [noparse]:)[/noparse]

    16 channel tracker music with playback support for 4 channels of ADPCM samples in the score!. *Think singing vocal tracks and samples* [noparse]:)[/noparse]

    I already started writing new songs to support and demo this new engine!

    London's Imogen Heap will be the first voice heard in a propeller sang song. [noparse]:)[/noparse]

    All this with only 32k.

    --Andrew Arsenault.
  • BaggersBaggers Posts: 3,019
    edited 2007-05-21 10:35
    Sounds fantastic mate, can't wait to hear it.

    As for 16channels with 4xADPCM excellent going [noparse]:)[/noparse]

    I'm going to have to do two versions of ManicMiner, as I've tried to immitate the spectrum sound too for the title screen [noparse]:D[/noparse] it's so bad it sounds close to the speccy, which isn't bad considering timing is different for Prop and Z80 and 60Hz VSync Prop and 50Hz Spectrum

    Like you, MM is almost there, just some final additions, ( like Eugene, and ProtoBoard / Hydra settings etc. ) and it'll be ready for a release.

    Baggers.
  • epmoyerepmoyer Posts: 314
    edited 2007-05-21 15:54
    Andrew,

    Nice going; I'm looking forward to hearing your new demos.

    Have you given any thought to playing audio samples from EEPROM? I haven't done the math on the effective EEPROM read rate via propeller ASM to figure out if it’s possible.

    My focus with the HDMF project was to support complex music composition/playback for Hydra games. What I see happening today is that the first generation of games (i.e. the demos which shipped with the Hydra) was struggling to even have enough room in 32K to include any kind of sound at all. The upcoming generation of games (like CardboardGuru's Donkey Kong port) will squeeze the limits of the 32K ceiling to its knees. Within the next 2 months I see the use of HAM becoming widespread, and the practice of storing assets in upper EEPROM to become commonplace. HDMF's ability to playback song assets stored in upper EEPROM will mean that programmers can add complex music to their games with only a small player/sound engine footprint in their precious 32K. If sampled sound assets could be stored in EEPROM and played back "on the fly" (without caching them into a large local buffer; I mean byte-by byte on the fly) then man oh man there could be awesome music in Hydra games! If we're limited to sticking them in RAM then most Hydra games won't be able to afford the storage space for them.

    Within the week HDMF will be released. The current version uses Nick's sound driver. Once the first release is complete I will start crank a version of HDMF that bolts up to your sound driver. That means that you'll be able to click a button, pick a MIDI file, then click another button and immediately hear it played back on an HSS version of the "Live Player" running on the Hydra hardware (the HDMF converter sends data to the Live Player over the serial connection for immediate preview). Then, when you're happy with the playback, you’ll be able to click another button and generate SPIN data for playback using the HDMF engine. That effectively means that any existing MIDI sequencer software will be able to be used as a front end for HSS, which (I think) saves you the bother of writing your own tracker software. In my mind the front-end sequencer / composition / import problem is solved. You’ve done an incredible job on the sound engine side so far; I'd love to see you focus on the HSS documentation and the sound engine so that when the two pieces meet we have a real powerhouse on our hands; not just from a great sounding chip-music standpoint, but also from that standpoint of creating a system that meets the constraints of Hydra game development.

    Keep up the outstanding work!
  • Ym2413aYm2413a Posts: 630
    edited 2007-05-21 19:43
    You too Epmoyer [noparse]:)[/noparse]
    I like the simplistic nature of your format and system.

    Midi is easy for anyone to work with and is available everywhere!
    My tracker formats allows for great things! Drum Kits, Vocal Tracks, Transforming Leads, Sampled Instruments...
    But isn't easy to compose for unless you know about "tracking". *lol* [noparse]:)[/noparse]

    I too am thinking of doing some more EEPROM related things.
    At least with the Hydra.

    Interesting enough most of the interest in (HSS) doesn't even come from the Hydra, but from the propeller users.
    (HSS) is also focusing on two other propeller based platforms that aren't the Hydra.

    So yeah there is a lot more that needs to get down. [noparse]:)[/noparse]
  • BaggersBaggers Posts: 3,019
    edited 2007-05-25 08:33
    Hi Ym2413a,
    How are your HSS tools coming? I'd like to play with that too.

    Baggers.
  • Ym2413aYm2413a Posts: 630
    edited 2007-05-28 04:53
    They're good. [noparse]:)[/noparse]
    I think most of them will work with (Hss) ver 1.5 so you'll have to upgrade to that. [noparse]:)[/noparse]
  • BaggersBaggers Posts: 3,019
    edited 2007-05-28 08:22
    Have they been released yet? did I miss it?

    Jim
  • Ym2413aYm2413a Posts: 630
    edited 2007-05-30 12:20
    They're releasing shortly after (Hss) 1.5.
    smilewinkgrin.gif
  • BaggersBaggers Posts: 3,019
    edited 2007-05-30 12:21
    cheers.
Sign In or Register to comment.