Several fixes and new example

This commit is contained in:
2025-06-23 23:26:42 -06:00
parent 1434b0d0ed
commit e695c67363
11 changed files with 1341 additions and 92 deletions

View File

@ -3,6 +3,7 @@
//! This module contains the fundamental data structures used throughout
//! the musicgen library for representing notes, tracks, and compositions.
use crate::config::EffectConfig;
use crate::scales::ScaleType;
use crate::synthesis::Waveform;
@ -44,6 +45,7 @@ pub enum InstrumentType {
}
/// A track represents a single instrument part
/// Track represents a single instrument part in a composition
#[derive(Debug, Clone)]
pub struct Track {
pub name: String,
@ -52,6 +54,7 @@ pub struct Track {
pub volume: f32,
pub instrument_type: InstrumentType,
pub waveform: Waveform,
pub effect_configs: Vec<EffectConfig>,
}
/// Composition styles (kept for compatibility)
@ -299,6 +302,7 @@ mod tests {
volume: 0.8,
instrument_type: InstrumentType::Lead,
waveform: Waveform::Sawtooth,
effect_configs: Vec::new(),
};
composition.tracks.push(track);