Thanks to visit codestin.com
Credit goes to github.com

Skip to content

icaroferre/ot_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crates.io version Documentation


About

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.


Example

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(())
}

Limitations

ot_utils currently only accepts mono, 16-bit, wav files.


Created by @icaroferre
spektroaudio.com

About

Rust library for grouping audio samples and generating .ot files for the Elektron Octatrack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages