Skip to main content

Chiptunomatic

Struct Chiptunomatic 

Source
pub struct Chiptunomatic { /* private fields */ }

Implementations§

Source§

impl Chiptunomatic

Source

pub fn new() -> Self

Initialize with the default plugin

Source

pub fn with_default_plugins(self) -> Self

Source

pub fn with_sample_rate(self, sample_rate: u32) -> Self

Source

pub fn register_plugin(&mut self, plugin: Rc<dyn Plugin>)

Source

pub fn register_default_plugins(&mut self)

Source

pub fn plugin(&self) -> Rc<dyn Plugin>

Source

pub fn modes(&self) -> Vec<&'static str>

Return the possible modes

Source

pub fn modes_string(&self) -> Vec<String>

Source

pub fn mode(&self) -> &'static str

Get the selected mode

Source

pub fn mode_string(&self) -> String

Source

pub fn set_mode(&mut self, mode: &String) -> Result<(), ChiptunomaticError>

Set the selected mode

Source

pub fn song_metadata_from_seed( &self, seed: &[u8], data_byte_len: u64, ) -> Result<SongMetadata, GenerateError>

Builds SongMetadata from a bytes seed and stream byte length.

Source

pub fn load_song_metadata_from_seed( &mut self, seed: &[u8], data_byte_len: u64, ) -> Result<SongMetadata, GenerateError>

Builds SongMetadata from a bytes seed and stream byte length.

Source

pub fn song_metadata_from_string<S: Into<String>>( &self, s: S, data_byte_len: u64, ) -> Result<SongMetadata, GenerateError>

Source

pub fn load_song_metadata_from_string<S: Into<String>>( &mut self, s: S, data_byte_len: u64, ) -> Result<SongMetadata, GenerateError>

Source

pub fn song_metadata_from_path<P: AsRef<Path>>( &self, path: P, ) -> Result<SongMetadata, SongMetadataFromPathError>

Source

pub fn load_song_metadata_from_path<P: AsRef<Path>>( &mut self, path: P, ) -> Result<SongMetadata, SongMetadataFromPathError>

Source

pub fn song_note_reader(&self) -> SongNoteReader

Return a reader for the notes of a byte stream

Source

pub fn read_song_notes<R: Read>( &self, reader: R, ) -> ReadSongNotes<R, SongNoteReader>

Iterate over the notes of a byte stream

Source

pub fn drum_sample_generator<R: Rng + SeedableRng + 'static>( &self, ) -> DrumSampleGenerator

Return a generator for the drum samples

Source

pub fn sample_drum_steps<R: Rng + SeedableRng + 'static>( &self, ) -> SampleDrumSteps

Iterate over the samples of the drum steps

Source

pub fn file_to_wav<IP: AsRef<Path>, OP: AsRef<Path>>( &mut self, input_path: IP, output_path: OP, sample_rate: u32, mix_generator: MixGenerator, ) -> Result<(), ConvertWavError>

Convert a file to WAV. mode selects chiptune or lofi synthesis.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V