3 unstable releases
0.2.1 | Jan 2, 2021 |
---|---|
0.2.0 | Dec 27, 2020 |
0.1.0 | Oct 13, 2020 |
#791 in Audio
108 downloads per month
Used in vsrs
36KB
790 lines
korg-syro-rs
Rust API for the KORG SYRO library for the Volca Sample.
lib.rs
:
Rust bindings for the KORG SYRO library for the Volca Sample.
Files for use with the reset method can be found here:
https://github.com/korginc/volcasample/tree/master/alldata
Examples
Add/erase samples
use std::fs::File;
use std::io::BufWriter;
use korg_syro::SyroStream;
use wav;
let mut syro_stream = SyroStream::default();
syro_stream
.add_sample(0, vec![], 44100, None)?
.erase_sample(1)?;
let data = syro_stream.generate()?;
// PCM data, 2 channels, 44.1kHz sample rate, 16 bit per sample
let header = wav::Header::new(1, 2, 44100, 16);
let output = File::create("output.wav").unwrap();
wav::write(header, &wav::BitDepth::Sixteen(data), &mut BufWriter::new(output));
Reset from .alldata file
use std::fs::File;
use std::io::BufWriter;
use korg_syro::SyroStream;
use wav;
let input_data = std::fs::read("all_sample_preset.alldata").unwrap();
let data = SyroStream::reset(input_data, Some(16))?;
// PCM data, 2 channels, 44.1kHz sample rate, 16 bit per sample
let header = wav::Header::new(1, 2, 44100, 16);
let output = File::create("output.wav").unwrap();
wav::write(header, &wav::BitDepth::Sixteen(data), &mut BufWriter::new(output));
Dependencies
~1.3–3.5MB
~76K SLoC