| Crates.io | ot_utils |
| lib.rs | ot_utils |
| version | 0.1.5 |
| created_at | 2020-07-20 15:20:09.989963+00 |
| updated_at | 2025-08-21 19:46:43.963954+00 |
| description | Library designed for concatenating audio samples and generating .ot (slice) files for the Elektron Octatrack sampler. |
| homepage | https://github.com/icaroferre/ot_utils |
| repository | https://github.com/icaroferre/ot_utils |
| max_upload_size | |
| id | 267276 |
| size | 51,337 |
ot_utils is a Rust library that is designed to concatenate and generate .ot (slice) files for the Elektron Octatrack sampler.
This library was designed so it's easier to group samples into a single .wav file so they can be accessed on the Octatrack via different slices. The goal is to ultimately save slots in the Static and Flex machines (so, for example, multiple kick samples can be grouped into a single slot rather than using a slot per sample).
Each audio file added via the add_file function is appended to a temporary .wav file and a new slice is created for that audio file.
The generate_ot_file function generates the .ot file and renames the temporary .wav file to it's final name (same as the .ot file).
This library was inspired and based on the incredible OctaChainer tool created by Kai Drange.
use std::fs;
use std::path::Path;
use ot_utils::Slicer;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let folder_path = "path/to/sample/folder";
let folder = Path::new(folder_path);
// Validate directory
if folder.is_dir() {
// Create slicer instance
let mut slicer = Slicer::default();
slicer.output_folder = folder_path.to_string();
slicer.output_filename = folder.file_name()
.and_then(|n| n.to_str())
.unwrap_or("output")
.to_string();
// Add .wav files in folder
for entry in fs::read_dir(folder)? {
let path = entry?.path();
if path.extension().and_then(|e| e.to_str()) == Some("wav") {
slicer.add_file(path.to_string_lossy().to_string())?;
}
}
// Generate .ot file
slicer.generate_ot_file(false)?;
}
Ok(())
}
ot_utils currently only accepts mono, 16-bit, wav files.
Created by @icaroferre
spektroaudio.com