pub struct Song {
pub global_volume: u8,
pub mix_volume: u8,
pub initial_speed: NonZero<u8>,
pub initial_tempo: NonZero<u8>,
pub pan_separation: u8,
pub pitch_wheel_depth: u8,
pub patterns: [Pattern; 240],
pub pattern_order: [PatternOrder; 256],
pub volume: [u8; 64],
pub pan: [Pan; 64],
pub samples: [Option<(SampleMetaData, Sample)>; 236],
}Fields§
§global_volume: u8§mix_volume: u8§initial_speed: NonZero<u8>Speed specifies how many ticks are in one row. This reduces tempo, but increases resolution of some effects.
initial_tempo: NonZero<u8>Tempo determines how many ticks are in one second with the following formula: tempo/2 = ticks per second.
pan_separation: u8§pitch_wheel_depth: u8§patterns: [Pattern; 240]§pattern_order: [PatternOrder; 256]§volume: [u8; 64]§pan: [Pan; 64]§samples: [Option<(SampleMetaData, Sample)>; 236]Implementations§
Source§impl Song
impl Song
pub const MAX_ORDERS: usize = 256usize
pub const MAX_PATTERNS: usize = 240usize
pub const MAX_SAMPLES_INSTR: usize = 236usize
pub const MAX_CHANNELS: usize = 64usize
Sourcepub fn next_pattern(&self, order: &mut u16) -> Option<u8>
pub fn next_pattern(&self, order: &mut u16) -> Option<u8>
order value shouldn’t be modified outside of this function. This moves it forward correctly and returns the pattern to be played
Sourcepub fn copy_values_from_header(&mut self, header: &ImpulseHeader)
pub fn copy_values_from_header(&mut self, header: &ImpulseHeader)
takes the values that are included in Song from the header and write them to the song.
Mostly applies to metadata about the song. Samples, patterns, instruments are not filled as they are not included in the header
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Song
impl RefUnwindSafe for Song
impl Send for Song
impl Sync for Song
impl Unpin for Song
impl UnwindSafe for Song
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more