[][src]Struct oscen::signal::Rack

pub struct Rack {
    pub modules: HashMap<Tag, SynthModule>,
    pub order: Vec<Tag>,
}

A Rack is basically a HashMap of synth modules to be visited in the specified order.

Fields

modules: HashMap<Tag, SynthModule>order: Vec<Tag>

Implementations

impl Rack[src]

pub fn new(ws: Vec<ArcMutex<Sig>>) -> Self[src]

Create a Rack object whose order is set to the order of the Signals in the input ws.

pub fn iter<'a>(&'a self) -> Iter<'a>

Important traits for Iter<'a>

impl<'a> Iterator for Iter<'a> type Item = &'a SynthModule;
[src]

Convert a rack into an Iter - note: we don't need an iter_mut since we will mostly mutating a Node via it's Mutex.

pub fn out_tag(&self) -> Tag[src]

Convenience function get the Tag of the final node in the Rack.

pub fn output(&self, n: Tag) -> Real[src]

Get the output of a Node.

pub fn append(&mut self, sig: ArcMutex<Sig>)[src]

Add a Node (synth module) to the Rack and set it's order to be last.

pub fn preppend(&mut self, sig: ArcMutex<Sig>)[src]

Add a SynthModule to the Rack and set it's order to be first`.

pub fn before(&mut self, before: Tag, sig: ArcMutex<Sig>)[src]

Add a SynthModule to the Rack at the position before was.

pub fn insert(&mut self, rack: Rack, loc: usize)[src]

Insert a sub-rack into the rack before node loc.

pub fn signal(&mut self, sample_rate: Real) -> Real[src]

A Rack generates a signal by travesing the list of modules and updating each one's output in turn. The output of the last Node is returned.

Trait Implementations

impl Clone for Rack[src]

impl<'a> IntoIterator for &'a Rack[src]

type Item = &'a SynthModule

The type of the elements being iterated over.

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl RefUnwindSafe for Rack

impl Send for Rack

impl Sync for Rack

impl Unpin for Rack

impl UnwindSafe for Rack

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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