Skip to content

About

Lightweight music player & stem extractor for Sega Model 2 arcade titles - on a bit-exact 68000 & SCSP core (Model 3 + MultiPCM + Saturn support coming eventually)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M2jukebox 1.2

Plays the music of Sega Model 2 games with the games' own sound programs: the original 68000 sound driver runs on Mednafen's 68000 and SCSP (sound chip) emulation, exactly as in the test harness used to make the "real-driver dry stems" for SCSP Synth. Lists every song, plays it, mutes / solos MIDI channels live, switches the SCSP DSP effects off (dry) or plays them alone, and exports songs and per-channel stems to WAV (16 / 24-bit), FLAC (16 / 24-bit) or MP3 (320 kbps).

Supported: every Model 2 game whose sound ROMs are in MAME's list (79 sets), drivers v1, v2 and v3: checked with Dead or Alive, Sonic Championship, The House of the Dead (+ prototype), Zero Gunner, Sega Water Ski, Virtua Fighter 2, Sega Rally Championship, Rail Chase 2, Virtua Striker and Indy 500.

1.2: every Model 2 set now has a game title (Wave Runner and 18 more were shown by their set names); the title also goes into the album tag of FLAC / MP3 exports. Audio is unchanged.

Build (Windows, MSYS2 "MINGW64" shell)

Once:

pacman -S --needed mingw-w64-x86_64-clang mingw-w64-x86_64-pkgconf mingw-w64-x86_64-SDL2 mingw-w64-x86_64-flac mingw-w64-x86_64-lame make

Then, in the M2jukebox folder:

make CXX=clang++
make dist CXX=clang++        (optional: dist/ = m2jukebox.exe + the DLLs it needs, to run it outside MSYS2)

make prints whether FLAC and MP3 export were found. Compiling third_party/mednafen/hw_cpu/m68k/m68k.cpp (the 68000 core) takes a long time with clang - several minutes, much longer than everything else; that is normal and only happens once. Dear ImGui (the user interface) is included in third_party/imgui, nothing to install. Linux: install SDL2, libFLAC and LAME development packages and run make.

Use

  • Open game... (or drop a file on the window): the game's MAME romset .zip (untrimmed is fine: only the sound ROMs are read, found by CRC), a folder, or any one ROM file of the game. A MAME split clone zip takes the missing sound ROMs from the parent's zip in the same folder. When a zip holds several versions (Indy 500), a box next to the title switches between them. The last game is opened again at the next start.
  • Songs: the driver's music list, numbered like M2MidiDec's MIDI files (doa_0A.mid = Song 0A). "loops" / "ends" says whether the song has a loop point. Double-click, Enter or Space plays; Space stops; Up / Down select.
  • Channels: the MIDI channels of M2MidiDec's files (1-16; v1 games: drums on 10). M mutes, S solos (several solos = those together). Grey channels have not played yet. A muted voice is silenced at the sound chip's output only: the driver and FM modulation keep running exactly as before, so nothing else changes.
  • DSP effects: Normal, Dry (no SCSP DSP effect return), DSP only (only the effect return). Also used by the export.
  • Export: format, number of loops (default 2) and fade (default 10 s). A song that loops is played to its N-th loop point (the moment the driver reads the song's loop entry), then the fade starts; a song that ends is played until its sound has died away. Full mix uses the current mutes / solos (the file name then ends in _custom); Stems writes one file per channel that plays (doa_00_ch05.wav); stems are rendered in parallel. All files of one song have exactly the same length. Files go to <folder>/<set>/, e.g. doa_00_mix.wav, doa_00_ch05_dry.flac. "Export all songs" does every song.
  • Normalize (-1 dBFS) (new in 1.1): one gain per song. M2jukebox first renders the song's full mix (no mutes / solos) without writing it, at a low level so nothing can clip, and finds its peak (after the fade). Every file of that song - the mix and each stem - is then rendered with the same gain, so the full mix peaks at -1 dBFS and the stems keep their exact proportions (dry stems still add up to the dry mix). The gain is applied in the engine's output stage (no extra rounding step) and is never above the -1 dBFS point. Lengths are the same as without Normalize. The extra measuring pass makes an export about one mix-render slower. File names end in _norm (doa_00_ch05_norm.flac), so they never replace the driver-level files; the message line shows the gain used (single-song export). A custom mix (mutes / solos) gets the full mix's gain too, so it is quieter than -1 dBFS.
  • Level (without Normalize): the same as the dry stems made for SCSP Synth (the harness's VMUL 1100); a channel stem from M2jukebox is sample-for- sample identical to such a stem. The Volume slider only changes playback.

Settings are kept in %APPDATA%\M2jukebox\settings.txt.

Command line

m2jukebox [game.zip] [--play <song>]        e.g.  m2jukebox doa.zip --play 0A

tools/ holds the headless test programs used to check M2jukebox against the harness (not built by make).

Licences

M2jukebox is GPL-2.0-or-later. It contains: Mednafen 1.32.1's 68000 core and SCSP emulation (GPL-2.0-or-later, third_party/mednafen, SCSP file modified as marked), Dear ImGui 1.92.9 (MIT, third_party/imgui), puff.c by Mark Adler (zlib licence, third_party/puff.c). It links SDL2 (zlib), libFLAC (BSD) and LAME (LGPL). No ROM data is included; the ROM list (src/romtable.hpp) holds file names, sizes, offsets and CRCs only.

About

Lightweight music player & stem extractor for Sega Model 2 arcade titles - on a bit-exact 68000 & SCSP core (Model 3 + MultiPCM + Saturn support coming eventually)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages