This Rust project is a MIDI sampler that allows you to play samples based on MIDI notes. It takes a JSON configuration file "samples.json" as input, which specifies the relative path to the sample file and the MIDI note to play that sample.
- Loads a JSON configuration file to specify sample files and their corresponding MIDI notes
- Uses Jack to handle audio connections and routing
{
"samples": [
{
"path": "samples/kick.wav",
"note": 36
},
{
"path": "samples/snare.flac",
"note": 38
},
{
"path": "samples/hihat.wav",
"note": 42
}
]
}
In the above example, we have three samples specified in the "samples" array. Each sample has a "path" attribute which specifies the relative path to the sample file, and a "note" attribute which indicates the MIDI note to play that sample.
To build and run the project, make sure you have Rust installed on your machine and then follow these steps:
- Clone the repository:
git clone https://github.com/your-username/midi_sampler.git
- Change into the project directory:
cd midi_sampler
- Build the project:
cargo build
- Run the project:
cargo run
Make sure to place your sample files in the appropriate location specified in the JSON configuration file.