How to create a new altsound project

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #220060
    apophis
    Participant
      @massie

      Overview

      This is an overview on how to create an altsound package for many (but not all) ROMs. Altsound is a feature provided by VPinMAME that enables customization of the game sounds. When configured correctly, a compatible ROM’s sound effects and music are completely superseded by the altsound files.

      For altsound to work, the following must be true:

      • The specific ROM must be supported within VPinMAME’s altsound functionality.
      • The altsound package must be located in \Visual Pinball\VPinMAME\altsound\<ROM NAME>\
      • The altsound package must include sound files in the .OGG format, and a .CSV file called “altsound.csv”
      • The CSV file must follow a specific format
      • Using the F1 settings dialog box from within the game, the “Alt. Sound Mode” setting must be set to 1

      Whenever a sound is played during a game, the ROM issues either an 16-bit or 32-bit command to the sound board. When altsound is enabled, this sound command is used to select which sound file is played from the ROM’s altsound directory. The CSV file associates sound commands to sound files.

      To create an original altsound package, you can approach the problem in several ways:

      • Modify an existing altsound package. Sometimes altsound packages are created with just the original un-modified ROM sounds. These are a great starting point for original altsound projects.
      • Modify and convert an existing Pinsound package. Pinsound uses a very similar format to altsound, so converting one to the other can be easier than building a new altsound from scratch.
      • Build a new altsound from scratch using the PinMAME32 Sound Command Mode F6 dump feature. This is a tool provided in PinMAME32.exe (as described below) that automatically goes through 256 sound command addresses and saves the sound tracks as .WAV files and creates the .CSV file. However, this tool is new and does not always work well.
      • Build a new altsound from scratch using PinMAME32 Sound Command Mode and the F5 record feature. This is a more manual process where each sound must be played and recorded one-by-one. The .CSV file is not automatically created.

      Once all the altsounds for a ROM are captured, and the CSV file is created, then new/original sounds can be swapped out for the old ones.

      Altsound CSV File

      The content in this section comes almost straight from VPinMAME documentation, reproduced here for convenience.

      PinMAME uses a CSV file to define the alternative soundtracks for a game when using the extended built-in alternate sound file support (Sound Mode 1). Currently specified 8 fields/columns should have a standard order. But to be extensible, the first row must always contain all column names:

      “ID”,”CHANNEL”,”DUCK”,”GAIN”,”LOOP”,”STOP”,”NAME”,”FNAME”

      Then for each sound/line:

      • ID: hexadecimal integer (as string) representing the soundboard command (format e.g. “0x10e”), technical ID as it comes from the MPU.
      • CHANNEL: use specified channel for the sample. If something is already playing on that channel it will be stopped. Typical channel assignment should be 0: background music, 1: short music snippets, that interrupt or end the background music, everything else (2..15): arbitrary channels. If field is empty, any free channel (2..15) is used.
      • DUCK: reduce volume of the background music when playing the sample. Range 0-100 (i.e. percentage).
      • GAIN: increase or reduce volume of the sample. Range 0-100. 50 leaves the sample volume as-is (it’s recommended to not go over 50 to avoid sample clamping/distortion).
      • LOOP: loop the sample this many times. Range 0-100, where 100 represents endless looping of the sample.
      • STOP: stop playback of background music. Can be 0 or 1.
      • NAME: string, descriptive/internal name of the sample.
      • FNAME: string, actual filepath/filename of the sample. Can contain any path prefixes if one likes to organize sound files in directories.

      The only fields that need to be specified are id, name and fname, the rest can optionally be left empty and will be filled in with defaults. If the table contains more than one record for a certain ID, the sound engine will pick one of these randomly. These same IDs must be grouped together one after another in a sequence. Note that the old folder-based structure is still fully supported for backwards compatibility.

      Supported Hardware Generations

      VPinMAME emulates a bunch of different pinball machine types, i.e. different “hardware generations”. The way sound commands are generated in each hardware generation is not necessarily universal. Therefore, each sound command must be reformatted such that it can be recognized by the altsound functionality. Not all hardware generations have been programmed into VPinMAME altsound yet (maybe we can change that). The following link is a list of hardware generations emulated by VPinMAME, and the green highlighted generations are currently supported by altsound:

      Hardware Generation Altsound Support – Google Sheets

      F6 Altsound Dump Tool

      Below is a step-by-step description of how to use the F6 altsound dump tool within PinMAME32.exe:

      1. Make sure the ROM you are working on is in the \VPinMAME\roms\ folder
      2. Run PinMAME32.exe
      3. Scroll down to the ROM in the game list
      4. Set up the ROM to play in a Window by going to the “Options” menu and down to “Default Game Options…” Then check the “Run in a window” checkbox.
      5. Double click on it to run the ROM to run the emulation
      6. Click any key to start the ROM emulation
      7. Press F4 to get to the Sound Command Mode
      8. Press the DEL key to get into Manual Mode
      9. Now set all of the “-“ characters to zeros by pressing the zero button on the keyboard
      10. Press the DEL button again to go back to Command mode
      11. To start the Altsound dump, press F6. This will begin to automatically cycle through all of the sound files starting from address x0000 and ending on address x00FF (a total of 256 tracks). You will hear the sound files play. A WAV file will be generated for each track and be placed in \VPinMAME\wave\.
        a) Not all addresses will have an associated sound file, so those will automatically get skipped. However a small empty wav file will be generated (size 4kB or less). We will delete these later.
        b) If the sound file loops, the dump process may not notice it has completed as it listens for a pause in the track to move to next address. In this case, you will have to manually go to the next sound track by pressing the SPACE bar.
        c) If you have the \VPinMAME\wave\ folder open, you can see WAV files being created and therefore monitor the progress
      12. Once the dump has completed (gone through all x00FF tracks) you can exit PinMAME32.
      13. Go to the \VPinMAME\wave\ folder and you will see a bunch of WAV files and a CSV file. Move these files into a new working directory of your choice. Then delete all WAV files that are 4kB or less in size… these are empty files.

      Note: Some hardware generations have sounds at command locations that start with offsets greater than 0x0000. For example, the offset could be 0x0100 all the way up to offset 0xFF00. Understanding which hardware generation offsets requires some research.

      Check out the new Altsound catagory here on vpinball.com.

      • This topic was modified 3 years, 3 months ago by apophis.
      9 users thanked author for this post.
      #225530
      Joe
      Participant
        @skeebomax

        Good info, thanks.  I have a question about sharing.  I’ve converted two pinsound packages to altsounds (Tommy and GnR) and will do more since I do not want pinsound studio running. This is considered derivative work, it is not mine. I believe there were old altsounds packages that are no longer shared but that was before my time.  Can I share the conversions?

        #226134
        h0pp4z
        Participant
          @h0pp4z

          What about just uploading the altsound.csv you’ve created according with the information to which rom it’s related and which pinsound sound sources are required.

          It’s not required to restructure the directories as far as I understood. The only thing I recognized yesterday was that you’ve to use slashes (/) instead of backslashes (\) in path names.

          Wrote a little converter in python which converts unique entries and asks user to resolve the conflicting entries (with more possibilities) to choose by listening to the samples (using mplayer). It’s written for linux and in early “still open in editor” – phase. I’ll make it a little bit more usable if someones interested in… / added command line parser .

          • This reply was modified 3 years, 1 month ago by h0pp4z. Reason: replaced the file
          #226163
          h0pp4z
          Participant
            @h0pp4z

            If I try this on rs_l6 it got stuck. Only one file and the first lines of the CSV got created. Space key does not skip. Same on rs_lx5 works.

            I’m using latest 33b from https://sourceforge.net/projects/pinmame/

            Any clue?

            • This reply was modified 3 years, 1 month ago by h0pp4z. Reason: More details
            #226169
            xenonph
            Participant
              @xenonph
              MemberContributor

              I think the only roms this method worked on, are on this site…

              http://altsound.vpin24.com/

              So I am guessing if you don’t see the roms altsound file on that site, this method will probably not work on that particular rom.

              I am also guessing the owner of that site, has tried this method on all the roms, and just added all the ones the method above worked on.

              I could be mistaken though.

              #226173
              h0pp4z
              Participant
                @h0pp4z

                I was wondering that my “conversion” for rs_lx5 loops in some sounds. Then I replayed the “original” one from http://altsound.vpin24.com/  and it also loops one sound constantly after a while. I’ll give it a try to dump it again… Should I open another thread for my thing… because I don’t wan’t to missuse this thread…

                The python script is useless for the dumped wave files. I used the source from altousound.vpin24.com…

                Dump of rs_l6 works … but not constantly. Don’t know the cause but I guess that it is a local problem.

                 

                • This reply was modified 3 years, 1 month ago by h0pp4z.
                #228659
                Felsir
                Participant
                  @felsir

                  I think the only roms this method worked on, are on this site…

                  http://altsound.vpin24.com/

                  So I am guessing if you don’t see the roms altsound file on that site, this method will probably not work on that particular rom.

                  I am also guessing the owner of that site, has tried this method on all the roms, and just added all the ones the method above worked on.

                  I could be mistaken though.

                  I think you’re right. I tried ripping the altsound from “F-14 Tomcat”- though I’m not sure, pinmame tells me it is a system11a pin- in de Google sheet, that refers back to GEN_S11X. I don’t know how to interpret that.

                  Anyway- it poduces one WAV file and one CSV. I was able to switch between sounds and play them with pressing the spacebar.

                  It is not present on that altsound webpage- so I assume it is not possible for now. Too bad because that pin just screams for a decent altsound treatment if it was just for the voice samples.

                Viewing 7 posts - 1 through 7 (of 7 total)

                Forums are currently locked.

                ©2024 VPinBall.com

                Log in with your credentials

                Forgot your details?