humster

Crates.iohumster
lib.rshumster
version0.0.2
created_at2019-07-24 08:34:15.705119+00
updated_at2025-11-02 16:17:13.387292+00
descriptionModern music toolkit for Rust
homepage
repository
max_upload_size
id151315
size15,855
Mykhailo Krainik (mykhailokrainik)

documentation

README

Humster Music Library

Humster is the starting point for a Rust library that explores building a modern music toolkit capable of working with both MIDI files and raw audio signals. The long-term goal is to make it easy to prototype ideas such as algorithmic composition, live performance tools, and audio analysis within the same crate.

Vision

  • Unified pipeline – Parse MIDI sequences and stream audio buffers through a consistent set of traits so creative tools can mix symbolic and audio data.
  • Extensible – Encourage experimentation with pluggable processors (effects, transformations, analyzers) that can be chained together.

Installation

Add humster to your Cargo.toml:

[dependencies]
humster = "0.0.2"

Or use cargo add:

cargo add humster

Example

use humster::{Track, MidiTrack, AudioTrack, Processor};

struct VelocityBoost(f32);

impl Processor for VelocityBoost {
    fn process_midi(&self, track: &mut MidiTrack) {
        track.events.iter_mut().for_each(|event| {
            event.velocity = (event.velocity as f32 * self.0).min(127.0) as u8;
        });
    }

    fn process_audio(&self, _track: &mut AudioTrack) {
        // No-op for audio in this processor; other processors could handle audio buffers.
    }
}

fn main() -> humster::Result<()> {
    let mut track = Track::from_midi("assets/example.mid")?;
    let velocity_boost = VelocityBoost(1.2);
    track.apply(&velocity_boost);
    track.export("out.mid")?;
    Ok(())
}

This sketch keeps the API surface small while proving out key ideas:

  • One crate manages both MIDI and signal data.
  • Processors can be reused between offline rendering and realtime contexts.
  • Users can chain processors to build complex pipelines.

Current Status

The repository is currently under development.

Roadmap Ideas

  • Integrate a MIDI parser (e.g., midly) and wrap it in ergonomic types.
  • Add basic DSP utilities for resampling, filtering, and FFT analysis.
  • Provide bidirectional conversions between MIDI tracks and synthesized audio.
  • Expose bindings for live control (e.g., MIDI controller input, OSC).
  • Ship a command-line tool that uses the library to batch process files.

Contributions, feature ideas, and experiments are welcome—this README will evolve as the implementation takes shape.

Commit count: 0

cargo fmt