| Crates.io | humster |
| lib.rs | humster |
| version | 0.0.2 |
| created_at | 2019-07-24 08:34:15.705119+00 |
| updated_at | 2025-11-02 16:17:13.387292+00 |
| description | Modern music toolkit for Rust |
| homepage | |
| repository | |
| max_upload_size | |
| id | 151315 |
| size | 15,855 |
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.
Add humster to your Cargo.toml:
[dependencies]
humster = "0.0.2"
Or use cargo add:
cargo add humster
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:
The repository is currently under development.
midly) and wrap it in ergonomic types.Contributions, feature ideas, and experiments are welcome—this README will evolve as the implementation takes shape.