#[allow(dead_code)]
pub(crate) mod text_table {
use crate::text::{Catalog, Seg};
include!(concat!(env!("OUT_DIR"), "/text-va.rs"));
}
mod dsp;
mod fx;
mod rrev;
use pikopiko_runtime::kit::m;
pub mod dx7;
pub mod engine;
pub mod presets;
pub mod sample;
use std::sync::Arc;
use crate::{Command, Song};
pub use engine::{wavetables_built, VaSynth, VA};
pub use sample::{DrumSample, SampleError};
pub fn render_solo(song: &Song, sample_rate: u32, loops: u32, solo: Option<u8>) -> Vec<[f32; 2]> {
let mut p = crate::synth::player(Arc::new(song.clone()), sample_rate);
p.handle(Command::SetSolo(solo));
if loops > 0 {
p.handle(Command::SetLooping(true));
p.handle(Command::SetLoopLimit(Some(loops)));
}
let mut out = Vec::new();
let mut buf = [[0.0f32; 2]; 1024];
while !p.is_finished() {
let n = p.render_counted(&mut buf);
out.extend_from_slice(&buf[..n]);
}
out
}