GBS/LSDj visualizer based on SameBoy and FFmpeg

Overview

GBPresenter

GBPresenter is a tool I wrote to generate visualizations of GameBoy chiptunes, based on SameBoy, FFmpeg, and Slint. The visualization design is essentially a port of the piano roll from RusticNES. It supports playing music from GBS files and from save files for most versions of Little Sound Dj.

Functionality

GBPresenter runs your GBS or LSDj ROM in SameBoy and captures the state of the APU channels every frame. It then generates a visualization and feeds it to FFmpeg to be encoded as a video.

Features

  • Supports GBS files and LSDj ROM+SAV.
    • Support for additional formats (LSDSNG, VGM, GBTPlayer) is planned.
  • Built on SameBoy for extremely accurate sound emulation.
    • It usually sounds just as good as a recording of a DMG with a ProSound mod.
  • Outputs a video file:
    • Customizable resolution (default 1080p) at 59.97 FPS (the GameBoy's true framerate).
    • MPEG-4 container with fast-start (moov atom at beginning of file).
    • Matroska (MKV) containers are also supported.
    • yuv420p H.264 video stream encoded with libx264, crf: 16.
    • Stereo AAC LC audio stream encoded with FFmpeg's aac encoder, bitrate: 384k.
  • Video files are suitable for direct upload to most websites:
    • Outputs the recommended format for YouTube, Twitter, and Discord (w/ Nitro).
    • Typical exports (1080p, up to 5 minutes) are usually below 100MB.
  • Loop detection for LSDj songs.
    • Supported on LSDj 5.x and up.
    • Support for HFF detection is planned.
    • Support for loop detection for tracker-exported GBS files is planned.

Installation

Windows: head to the Releases page and grab the latest binary release. Simply unzip and run the executable, and you're all set.

Linux: no binaries yet, but you can compile from source. You'll need:

Clone the repo with submodules (git clone --recursive), cd in, and run cargo build --release to build.

Usage

GUI

  1. Click Browse... to select a GBS or an LSDj ROM file.
  2. If you selected an LSDj ROM file, select Browse... next to the LSDj SAV field to select your LSDj save file.
  3. Select a track to be rendered from the dropdown.
  4. Select the duration of the output video. Available duration types are:
    • Seconds: explicit duration in seconds.
    • Frames: explicit duration in frames (1/59.97 of a second).
    • Loops: if loop detection is supported, number of loops to be played.
  5. Select the duration of the fadeout in frames. This is not included in the video duration above, rather it's added on to the end.
  6. Select the output video resolution. You can enter a custom resolution or use the 1080p/4K presets.
  7. Click Render! to select the output video filename and begin rendering the visualization.
  8. Once the render is complete, you can select another track or even change modules to render another tune.

CLI

If GBPresenter is started with command line arguments, it runs in CLI mode. This allows for the automation of rendering visualizations which in turn allows for batch rendering and even automated uploads.

The most basic invocation is this:

gb-presenter-rs --lsdj lsdj.gb songs.sav path/to/output.mp4

or

gb-presenter-rs --gbs songs.gbs path/to/output.mkv

Additional options:

  • -R [rate]: set the sample rate of the audio (default: 44100)
  • -T [track]: select the GBS/LSDj track index (default: 0)
  • -s [condition]: select the output duration (default: time:300):
    • time:[seconds]
    • frames:[frames]
    • loops:[loops] (if supported)
  • -S [fadeout]: select the fadeout duration in frames (default: 180).
  • --ow [width]: select the output resolution width (default: 1920)
  • --oh [height]: select the output resolution height (default: 1080)
  • -h: Additional help + options
    • Note: options not listed here are unstable and may cause crashes or other errors.
You might also like...
 Serenade: Low-Latency Session-Based Recommendations
Serenade: Low-Latency Session-Based Recommendations

Serenade: Low-Latency Session-Based Recommendations This repository contains the official code for session-based recommender system Serenade, which em

A high level, easy to use gpgpu crate based on wgpu

A high level, easy to use gpgpu crate based on wgpu. It is made for very large computations on powerful gpus

Small program which groups images based on the GPS position.

gps-cluster This small program will take some pictures in input, and based on the metadata on every image, it will group them by their GPS position, i

MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone

MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone MesaTEE GBDT-RS is a gradient boost decision tre

Ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in Rust.

Ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in Rust.

Ecosystem of libraries and tools for writing and executing fast GPU code fully in Rust.

The Rust CUDA Project An ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in Rust Guide | Getting Started | Fe

[WIP] An experimental Java-like language and it's virtual machine, for learning Java and JVM.

Sky VM An experimental Java-like language and it's virtual machine, for learning Java and JVM. Dependencies Rust (rust-lang/rust) 2021 Edition, dual-l

Robust and Fast tokenizations alignment library for Rust and Python
Robust and Fast tokenizations alignment library for Rust and Python

Robust and Fast tokenizations alignment library for Rust and Python

Some hacks and failed experiments surrounding nvidia's gamestream protocol and sunshine/moonlight implementations

Sunrise This repository contains a bunch of experiments surrounding the nvidia gamestream protocol and reimplementations in the form of sunshine and m

Comments
  • [Bug] [GBS] GBS Support doesn't seem to work with the GUI

    [Bug] [GBS] GBS Support doesn't seem to work with the GUI

    Found a couple bugs when it comes to trying to play GBS files over the GUI:

    1. GBS files with Japanese characters in its metadata (see attached for examples) break the program when loaded. A bit of an issue here because those GBSes are also likely from GBGBS which can automatically rip GBS files from GB rom images, which always appends Japanese metadata to the file. In a program like foobar2000 (very good GBS player) or nezplug++ (bad outdated program), which parse it correctly, it would look like this: image Example GBS: JPMetadata.zip

    2. If the above GBS does load, I can't select any song. I also have to manually specify the file opener to select GBS files, and once it accepts those, the song selector is broken. Even worse, I can't even render a file since it says it's not a valid file. image (And yes, that is a custom windows theme. I'm just using Windows 10.)

    I'm not sure if using it from command line fares better, but I can try using that instead.

    opened by N-SPC700 5
  • [Bug] FFmpeg acting weird?

    [Bug] FFmpeg acting weird?

    Because the GUI exhibited odd behavior in a previous post I decided to go the command line route. After some fiddling with command line arguments I managed to get it to render: image

    That should be the end of it, right? Except I put in the wrong GBS song in the track specifier on accident. Trying to run the command again but with the different (correct) track number produced this: image To ensure the track command itself wasn't buggy I did the original set of commands again (The ones that did render a file) but I unfortunately was met with the same error again: image I'm not sure what is wrong but it seems FFmpeg doesn't like something.

    (Side note: The command arguments specified in the repo's readme don't actually match up with the arguments needing to be passed into the program)

    I also want to apologize by slamming you with a bunch of issues all of a sudden.

    opened by N-SPC700 4
  • Song selection not working on latest LSDJ stable version (9.3.9)

    Song selection not working on latest LSDJ stable version (9.3.9)

    (Platform: Linux/Fedora 38)

    It seems that the application is unable to select the correct song when using the latest stable version 9.3.9 of LSDJ and plays just whatever is there when LSDJ starts.

    Previous 9.2.L works fine.

    I checked that the input combos for selecting the song should be the same, no idea what could've changed between the versions...

    opened by laamaa 2
Releases(v0.2.0)
  • v0.2.0(Jun 22, 2023)

    A more substantial release that fixes some stuff under the hood to make the visualizer more reliable and adds a bit of customization to the emulation.

    Changes:

    • Switch back to upstream SameBoy since my APU monitor API PR was merged.
    • Internal improvements to the sameboy crate.
    • Fix sameboy-sys builds on GNU toolchains.
    • Allow for the selection of the emulated Game Boy model/revision.

    Fixes:

    • Revamped LSDj macro system to be much more reliable and work on the latest stable LSDj (#3).
    Source code(tar.gz)
    Source code(zip)
    gb-presenter-rs-v0.2.0.zip(27.62 MB)
  • v0.1.1(Jun 18, 2023)

    This is just a quick hotfix release to squash some easy bugs while I work on new features. Summary of changes:

    • LSDj ROMs and GBSes are no longer misidentified if the extension is not lowercase (#1)
    • LSDj version is now validated to ensure support
    • GBS metadata encoded with Shift-JIS is now properly supported (#1)
    • File dialogs now filter by all supported extensions by default
    • Various documentation fixes
    Source code(tar.gz)
    Source code(zip)
    gb-presenter-rs-v0.1.1-win64.zip(27.59 MB)
  • v0.1.0(Jun 17, 2023)

Owner
Noah Sweilem
Noah Sweilem
Narwhal and Tusk A DAG-based Mempool and Efficient BFT Consensus.

This repo contains a prototype of Narwhal and Tusk. It supplements the paper Narwhal and Tusk: A DAG-based Mempool and Efficient BFT Consensus.

Facebook Research 134 Dec 8, 2022
Label Propagation Algorithm by Rust. Label propagation (LP) is graph-based semi-supervised learning (SSL). LGC and CAMLP have been implemented.

label-propagation-rs Label Propagation Algorithm by Rust. Label propagation (LP) is graph-based semi-supervised learning (SSL). A simple LGC and a mor

vaaaaanquish 4 Sep 15, 2021
Rust based Cross-GPU Machine Learning

HAL : Hyper Adaptive Learning Rust based Cross-GPU Machine Learning. Why Rust? This project is for those that miss strongly typed compiled languages.

Jason Ramapuram 83 Dec 20, 2022
Rust crate to create Anki decks. Based on the python library genanki

genanki-rs: A Rust Crate for Generating Anki Decks With genanki-rs you can easily generate decks for the popular open source flashcard platform Anki.

Yannick Funk 63 Dec 23, 2022
Graph-based Approximate Nearest Neighbor Search

granne* granne (graph-based retrieval of approximate nearest neighbors) is a Rust library for approximate nearest neighbor search based on Hierarchica

null 283 Dec 21, 2022
A Rust🦀 implementation of CRAFTML, an Efficient Clustering-based Random Forest for Extreme Multi-label Learning

craftml-rs A Rust implementation of CRAFTML, an Efficient Clustering-based Random Forest for Extreme Multi-label Learning (Siblini et al., 2018). Perf

Tom Dong 15 Nov 6, 2022
zenoh-flow aims at providing a zenoh-based data-flow programming framework for computations that span from the cloud to the device.

Eclipse Zenoh-Flow Zenoh-Flow provides a zenoh-based dataflow programming framework for computations that span from the cloud to the device. ⚠️ This s

null 35 Dec 12, 2022
High performance distributed framework for training deep learning recommendation models based on PyTorch.

PERSIA (Parallel rEcommendation tRaining System with hybrId Acceleration) is developed by AI platform@Kuaishou Technology, collaborating with ETH. It

null 340 Dec 30, 2022
A naive density-based clustering algorithm written in Rust

Density-based clustering This a pure Rust implementation of a naive density-based clustering algorithm similar to DBSCAN. Here, 50 points are located

chris m 0 Mar 19, 2020
Rust implementation of user-based collaborative filtering

Rucommender Recommendation system written in Rust Overview An implementation in Rust of a collaborative filtering recommendations algorithm with a use

null 0 Sep 15, 2018