lsdj

Crates.iolsdj
lib.rslsdj
version0.1.0
sourcesrc
created_at2022-04-29 14:18:55.079266
updated_at2022-04-29 14:18:55.079266
descriptionLibrary for interfacing with LSDJ files and memory
homepagehttps://github.com/stijnfrishert/lsdj-rs
repositoryhttps://github.com/stijnfrishert/lsdj-rs
max_upload_size
id577384
size103,132
Stijn Frishert (stijnfrishert)

documentation

README

LSDJ

LittleSoundDj, or LSDJ for short, is popular music tracker software for the original Nintendo Game Boy. While the handheld console originally was released in 1989, (chiptune) musicians still use its hardware to create and perform electronic music nowadays.

While LSDJ has a built-in filesystem for managing tracks, you need tools to get out the individual files for back-ups or constructing new save files from exported tracks. This crate provides a library for manipulating LSDJ save files/SRAM, in combination with a command-line utility crate for managing your songs. It was inspired by my work on liblsdj, an equivalent library in C.

The developer behind LSDJ has also made LSDPatcher, a GUI package for managing your songs.

Example

use lsdj::{
    sram::SRam,
    fs::{Index, File}
};

// Load a save file from disk
let sram = SRam::from_path("bangers.sav").expect("Could not load SRAM");

// Access one of the files
if let Some(file) = sram.filesystem.file(Index::new(0)) {
    // Convert the file to an .lsdsng (common song format)
    let lsdsng = file.lsdsng().expect("Could not convert file to LsdSng");

    // Store the song on disk
    lsdsng.to_path("put_yo_hands_up.lsdsng").expect("Could not save LsdSng");
}

Features

The crate currently supports the following functionality:

  • SRAM serialization and deserialization
  • Filesystem manipulation (querying, inserting and removing files)
  • LsdSng serialization and deserialization
  • Full implementation of the compression algorithm (verified with tests)

Wishlist

These are features I'm interested in exploring/adding at a certain point:

  • SongMemory parsing into song structures per format version. (This would allow manipulating songs.)
  • .lsdprj support
  • ROM handling, mainly for sample manipulation

Support

If you like this crate and want to support me somehow, consider buying some of my music.

Commit count: 101

cargo fmt