Author Topic: HuSound  (Read 3753 times)

TailChao

  • Full Member
  • ***
  • Posts: 156
HuSound
« on: November 08, 2014, 01:51:35 AM »
Hi all,

I've decided to release the sound tools I've been working on for the PCE. They're based upon the environment I created for the Lynx which uses the SASS language to write music and sound effect scripts.
This has been written for the WLA-DX assembler, and uses the MCGenjin memory mapper (so Mednafen and hardware only). Sorry, no HuC or cc65 environment support. All of the source is included with each version of the driver if you'd like to add your own cool features or port it to something else.

Here's some of the neato things you get with HuSound:
-Included audition/test ROM with waveform and mode watcher
-Included demo instrument set
-Minimal bank alignment restrictions for music/sfx data
-Instruments and sound effects can switch among waveform, noise, and PCM mode on a single channel.
-Stereo Panning for music, sound effects, and samples
-6.992KHz PCM Playback on any channel
-Multichannel sound effects
-Dispatch of multiple sound effects per frame
-Configurable priority system among music, sound effects, and samples
-Attenuation support for music (can be used for fade-ins, fade-outs, etc)

You can download the newest version (v1.3cz) here.
I've also uploaded some test footage + covers to give a better idea of what the driver can do.
The ROM and SASS Scripts used for these covers are available here.

Have fun!
« Last Edit: February 11, 2016, 09:58:00 AM by TailChao »

esteban

  • Hero Member
  • *****
  • Posts: 24063
Re: HuSound
« Reply #1 on: November 08, 2014, 03:10:23 AM »


I have no skills, but I know this is a good thing.
  |    | 

ultrageranium

  • Jr. Member
  • **
  • Posts: 94
Re: HuSound
« Reply #2 on: November 08, 2014, 08:19:13 AM »
Great documentation too, Thanks!

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: HuSound
« Reply #3 on: November 08, 2014, 09:57:22 AM »
Well, the Phantasy Star II tune made me piss myself.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

fragmare

  • Hero Member
  • *****
  • Posts: 676
Re: HuSound
« Reply #4 on: November 08, 2014, 03:38:23 PM »
Well, the Phantasy Star II tune made me piss myself.

Yes!  PSII city music!  I too am in need of a diaper change after hearing this on the PCE sound hardware!  :)

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: HuSound
« Reply #5 on: November 08, 2014, 06:27:33 PM »
Bitch, it's the save-data screen music, not the city music.

[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: HuSound
« Reply #6 on: November 09, 2014, 03:16:15 AM »
So, is this engine compatible with channels being dynamically pulled out for sound effect duty?
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

fragmare

  • Hero Member
  • *****
  • Posts: 676
Re: HuSound
« Reply #7 on: November 09, 2014, 07:26:21 AM »
Bitch, it's the save-data screen music, not the city music.



Oh yea, you're right, you whore!  It's been years since I've fired up PSII.  Either way, it sounds awesome on the PCE  :)

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: HuSound
« Reply #8 on: November 09, 2014, 11:56:59 AM »
This looks great.  So, what's the memory / raster time usage?

TailChao

  • Full Member
  • ***
  • Posts: 156
Re: HuSound
« Reply #9 on: November 09, 2014, 03:53:00 PM »
Thanks for the feedback.

So, is this engine compatible with channels being dynamically pulled out for sound effect duty?
Yes, each channel of a music track (if playing) has an assigned priority. All sound effects also have priorities which are used during their dispatch to see if they can "borrow" a channel from the music track if it is in use.

This looks great.  So, what's the memory / raster time usage?
40 Bytes ZeroPage and 894 Bytes of RAM. Kind of fat, but I added so much RAM on the cartridge that this is a bit moot. The depth of the loop / call stacks used in the driver can be adjusted from their default of depth four as well which could easily get you a hundred or so bytes off. Same goes for the sound effect dispatch queue (default depth is eight).

Performance is (really really) variable because of the macro instrument setup. The first two attachments show driver time in "average" and "bad" states. RED indicates audio register writes, BLUE is VRAM transfers (ignore), and PINK is the driver update tick. This is something I'd like to improve in the future. CALLs and BREAKs are super expensive since there are no alignment restrictions on music, instruments, or sound effects.

The next two attachments show PCM IRQ time (in pink) for one and two PCM channels in use respectively. While six is supported, playing that many samples at once will definitely mess up any HBL rasters you may be using.

ParanoiaDragon

  • Hero Member
  • *****
  • Posts: 4619
Re: HuSound
« Reply #10 on: November 09, 2014, 07:01:33 PM »
These sound great!  How practical is this for use ingame, would you say it's still CPU intensive enough so that it couldn't be used for full fledged games?  I assume the overall goal is to make this practical for full homebrew game projects?  That would, ofcoarse be sweet, & it'll be nice to have different options for dev's in the future for music making.

TailChao

  • Full Member
  • ***
  • Posts: 156
Re: HuSound
« Reply #11 on: November 10, 2014, 12:17:54 AM »
These sound great!  How practical is this for use ingame, would you say it's still CPU intensive enough so that it couldn't be used for full fledged games?  I assume the overall goal is to make this practical for full homebrew game projects?  That would, ofcoarse be sweet, & it'll be nice to have different options for dev's in the future for music making.

The driver was written for use in a game, so it should be fine. The big performance hit comes from having no alignment restrictions, so the driver has to do two levels of banking math (both 8KB/MPR and 256KB/MCGenjin). But the convenience you get out of this is huge, so I'm willing to dump the cycles.

Of course, if you're doing heavy effects (more SASS instructions per frame = more data to fetch), you'll be using more of the HuC6280's time. Running 3+ PCM streams and decoding complex music / sound effects might be doable in something mellow like Bonk, but you'd have to scale things back for a game which needs more cycles to do its own calculations.

Since the source is available, you are free to chop off parts you don't want or add things that you'd like. For example the standard version of my Lynx sound tools doesn't support music fade outs, but the modified one which I'm using in a new game does.

I think the only challenge here is that everything was written for MCGenjin, which has a bit of a learning curve if you're unfamiliar with it. This can obviously be removed, but it is quite cool to use the same card in a PCE and TG16 with no mods or switches.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: HuSound
« Reply #12 on: November 10, 2014, 04:03:30 AM »
What do you think would be the most difficult aspect of altering this engine for use without the MCGenjin mapper? I ask because Arkhan already has a homebrew board he's shipping with Atlantean, and there is now a Turbo EverDrive that makes playing homebrew and hack titles much easier.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

TailChao

  • Full Member
  • ***
  • Posts: 156
Re: HuSound
« Reply #13 on: November 10, 2014, 08:14:04 AM »
What do you think would be the most difficult aspect of altering this engine for use without the MCGenjin mapper? I ask because Arkhan already has a homebrew board he's shipping with Atlantean, and there is now a Turbo EverDrive that makes playing homebrew and hack titles much easier.
It is really not that difficult to remove the MCGenjin stuff. What is difficult is adapting the driver to HuC, which I believe Arkhan and friends are using.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: HuSound
« Reply #14 on: November 10, 2014, 03:27:34 PM »
What do you think would be the most difficult aspect of altering this engine for use without the MCGenjin mapper? I ask because Arkhan already has a homebrew board he's shipping with Atlantean, and there is now a Turbo EverDrive that makes playing homebrew and hack titles much easier.
It is really not that difficult to remove the MCGenjin stuff. What is difficult is adapting the driver to HuC, which I believe Arkhan and friends are using.

Most of Atlantean is inline assembly, and most of Squirrel is wrapper code to call into the asm stuff.  :)

[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.