Several fixes and new example
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user