Skip to content

♬ Mod audio Java Sound SPI powered by javamod (mod, opl, sid, vgm)

License

Notifications You must be signed in to change notification settings

umjammer/javamod

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Release Java CI CodeQL Java Parent

JavaMod

Java MOD Player

  • mavenized
  • made libraries outsourced as much as possible
  • javax.sound.spi compliant
player subtype status spi library comment
mod STK, NST, MOD, WOW, XM, FAR, MTM, STM, STS, STX, S3M, IT, MPTM, PowerPacker this
opl ROL, LAA, CMF, DRO, SCI this opl3 class is duplicated
sid SID JSIDPlay2
vgm VGM, GBC, NSF, SPC [1] vavi-sound-emu

[1] implemented in vavi-sound-emu

opl chips

name common name status comment
Y8950 MSX-AUDIO (OPL2 + ADPCM-B) n/a oldmame:burczynski
YM3526 OPL ✅️ oldmame:burczynski
YM3812 OPL2 ✅️ oldmame:burczynski
YmF262 OPL3 ✅️ cozendey

Install

Usage

  AudioInputStream modAis = AudioSystem.getAudioInputStream(new BufferedInputStream(Files.newInputStream(mod), MAX_BUFFER_SIZE));
  AudioFormat inFormat = sourceAis.getFormat();
  AudioFormat outFormat = new AudioFormat(inFormat.getSampleRate(), 16, inFormat.getChannels(), true, inFormat.isBigEndian());
  AudioInputStream pcmAis = AudioSystem.getAudioInputStream(outFormat, modAis);
  SourceDataLine line = (SourceDataLine) AudioSystem.getLine(new DataLine.Info(SourceDataLine.class, pcmAis.getFormat()));
  line.open(pcmAis.getFormat());
  line.start();
  byte[] buffer = new byte[line.getBufferSize()];
  int bytesRead;
  while ((bytesRead = pcmAis.read(buffer)) != -1) {
    line.write(buffer, 0, bytesRead);
  }
  line.drain();

References

TODO

  • sid mixer details
  • extract graphic equalizer ui
  • extract led scroll ui
  • java sound spi sid, opl
  • i made input stream wrapper, so methods for input stream (mainly for type detection) are no more needed? ... troublesome
  • rename to vavi-sound-mod

JavaMod - a java based multimedia player for Protracker, Fast Tracker, Impulse Tracker, Scream Tracker and other mod files plus SID, MP3, WAV, OGG, APE, FLAC, MIDI, AdLib ROL-Files (OPL), ... See the supported file types for a complete list.

This is the original JavaMod project from Daniel "Quippy" Becker.

Download the JAR or the source code and compile for yourself. A double click on the jar-file should start it. If not, to manually start the player in GUI mode open a command line (CMD or Shell) and enter: java -jar ./javamod.jar To start the command line version enter: java -cp ./javamod.jar de.quippy.javamod.main.CommandLine MODFILE Without any parameters you will receive a help screen.

On Linux consider starting with OpenGL render pipeline activated: java -Dsun.java2d.opengl=true -jar ./javamod.jar

Remarks to 3.9.x version updates

With JavaMod versions 4.0 to 5.0 I want to integrate Midi and AdLib support. However, before starting that I want to have all test mods of Schism and Open ModPlug Tracker to work. We finished MOD, XM, STM and S3M with this version and a whole lot of other stuff as well. So I decided to release new versions with minor version number updates to have you participate in these changes!

Download of compiled version and source code

Supported file types:

  • Mods (STK, NST, MOD, WOW, XM, FAR, MTM, STM, STS, STX, S3M, IT, MPTM, PowerPacker)
  • OPL2/3 (ROL, LAA, CMF, DRO, SCI)
  • WAV, AU, AIFF
  • MIDI (MID, RMF, RMI) with SF2 soundfont files
  • MP3 (Files and Streams)
  • FLAC
  • APE (ape, apl, mac)
  • OGG/Vorbis (ogg, oga)
  • SID (very basic support. Use JSidPlay2 or Vice SID Player)
  • Playlists PLS, M3U, M3U8, ZIP, CUE

Technical info:

Code Compliance Level: JDK 17 Build with openJDK 17.0.11

Third-party libraries

JavaMod incorporates modified versions of the following libraries:

Known issues:

  • With PulseAudio:
    • gapless audio streams do not work if SourceLine Buffers drain out
    • scrambled sound (especially with PipeWire)
  • With KDE:
    • JDialogs, when set visible, will not come to front
  • Tray Icon: mouse wheel (volume control) & keyboard shortcuts do not work

Planned:

  • finish loading of OMPT extended instrument / song data / mixer data
  • reading at least Midi Config with XMs / ITs
  • VSTiVolume, SamplePreAmp, MixLevels - look, what OMPT has to say
  • check for further missing MPTM Effects like Reverb and Surround commands
  • optimize recognition of different trackers - for whatever that is worth it
  • Quad Speaker mixing (rear speakers)
    • LongList:
    • Midi and AdLib/OPL with Mods
    • WavPack and MusePack support
    • MO3 support
    • read from 7z archives