devalang_core/core/audio/engine/notes/
mod.rs

1use devalang_types::Value;
2use std::collections::HashMap;
3
4pub mod dsp;
5pub mod params;
6
7// Minimal safe facade: parse the setup then call DSP renderer.
8
9pub fn insert_note_impl(
10    engine: &mut crate::core::audio::engine::AudioEngine,
11    waveform: String,
12    freq: f32,
13    amp: f32,
14    start_time_ms: f32,
15    duration_ms: f32,
16    synth_params: HashMap<String, Value>,
17    note_params: HashMap<String, Value>,
18    automation: Option<HashMap<String, Value>>,
19) {
20    let setup = params::build_note_setup(
21        engine,
22        &waveform,
23        freq,
24        amp,
25        start_time_ms,
26        duration_ms,
27        &synth_params,
28        &note_params,
29        &automation,
30    );
31
32    dsp::render_notes_into_buffer(
33        engine,
34        &waveform,
35        freq,
36        amp,
37        start_time_ms,
38        duration_ms,
39        synth_params,
40        note_params,
41        automation,
42        setup,
43    );
44}