maolan-engine 0.1.0

Audio engine for the Maolan DAW with audio/MIDI tracks, routing, export, and CLAP/VST3/LV2 hosting
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::hw::convert_policy::{F32_FROM_F32, F32_TO_F32};

pub fn deinterleave_f32(src: &[f32], channels: usize, frames: usize, dst: &mut [Vec<f32>]) {
    for ch in 0..channels {
        let offset = ch * frames;
        let channel_dst = &mut dst[ch];
        channel_dst.resize(frames, 0.0);
        channel_dst.copy_from_slice(&src[offset..offset + frames]);
    }
}

pub fn interleave_f32(src: &[Vec<f32>], channels: usize, frames: usize, dst: &mut [f32]) {
    for ch in 0..channels {
        let offset = ch * frames;
        let channel_src = &src[ch];
        dst[offset..offset + frames].copy_from_slice(&channel_src[..frames]);
    }
}