extern crate alloc;
use alloc::boxed::Box;
use alloc::sync::Arc;
pub use super::audionode::*;
pub use super::audiounit::*;
pub use super::biquad::*;
pub use super::buffer::*;
pub use super::combinator::*;
pub use super::delay::*;
pub use super::dynamics::*;
pub use super::envelope::*;
pub use super::feedback::*;
pub use super::filter::*;
pub use super::fir::*;
pub use super::follow::*;
pub use super::granular::*;
pub use super::math::*;
pub use super::moog::*;
pub use super::net::*;
pub use super::noise::*;
pub use super::oscillator::*;
pub use super::oversample::*;
pub use super::pan::*;
pub use super::realnet::*;
pub use super::resample::*;
pub use super::resynth::*;
pub use super::reverb::*;
pub use super::rez::*;
pub use super::ring::*;
pub use super::sequencer::*;
pub use super::setting::*;
pub use super::shape::*;
pub use super::shared::*;
pub use super::signal::*;
pub use super::slot::*;
pub use super::snoop::*;
pub use super::svf::*;
pub use super::system::*;
pub use super::wave::*;
pub use super::wavetable::*;
pub use super::*;
pub type U0 = numeric_array::typenum::U0;
pub type U1 = numeric_array::typenum::U1;
pub type U2 = numeric_array::typenum::U2;
pub type U3 = numeric_array::typenum::U3;
pub type U4 = numeric_array::typenum::U4;
pub type U5 = numeric_array::typenum::U5;
pub type U6 = numeric_array::typenum::U6;
pub type U7 = numeric_array::typenum::U7;
pub type U8 = numeric_array::typenum::U8;
pub type U9 = numeric_array::typenum::U9;
pub type U10 = numeric_array::typenum::U10;
pub type U11 = numeric_array::typenum::U11;
pub type U12 = numeric_array::typenum::U12;
pub type U13 = numeric_array::typenum::U13;
pub type U14 = numeric_array::typenum::U14;
pub type U15 = numeric_array::typenum::U15;
pub type U16 = numeric_array::typenum::U16;
pub type U17 = numeric_array::typenum::U17;
pub type U18 = numeric_array::typenum::U18;
pub type U19 = numeric_array::typenum::U19;
pub type U20 = numeric_array::typenum::U20;
pub type U21 = numeric_array::typenum::U21;
pub type U22 = numeric_array::typenum::U22;
pub type U23 = numeric_array::typenum::U23;
pub type U24 = numeric_array::typenum::U24;
pub type U25 = numeric_array::typenum::U25;
pub type U26 = numeric_array::typenum::U26;
pub type U27 = numeric_array::typenum::U27;
pub type U28 = numeric_array::typenum::U28;
pub type U29 = numeric_array::typenum::U29;
pub type U30 = numeric_array::typenum::U30;
pub type U31 = numeric_array::typenum::U31;
pub type U32 = numeric_array::typenum::U32;
pub type U33 = numeric_array::typenum::U33;
pub type U34 = numeric_array::typenum::U34;
pub type U35 = numeric_array::typenum::U35;
pub type U36 = numeric_array::typenum::U36;
pub type U37 = numeric_array::typenum::U37;
pub type U38 = numeric_array::typenum::U38;
pub type U39 = numeric_array::typenum::U39;
pub type U40 = numeric_array::typenum::U40;
pub type U41 = numeric_array::typenum::U41;
pub type U42 = numeric_array::typenum::U42;
pub type U43 = numeric_array::typenum::U43;
pub type U44 = numeric_array::typenum::U44;
pub type U45 = numeric_array::typenum::U45;
pub type U46 = numeric_array::typenum::U46;
pub type U47 = numeric_array::typenum::U47;
pub type U48 = numeric_array::typenum::U48;
pub type U49 = numeric_array::typenum::U49;
pub type U50 = numeric_array::typenum::U50;
pub type U51 = numeric_array::typenum::U51;
pub type U52 = numeric_array::typenum::U52;
pub type U53 = numeric_array::typenum::U53;
pub type U54 = numeric_array::typenum::U54;
pub type U55 = numeric_array::typenum::U55;
pub type U56 = numeric_array::typenum::U56;
pub type U57 = numeric_array::typenum::U57;
pub type U58 = numeric_array::typenum::U58;
pub type U59 = numeric_array::typenum::U59;
pub type U60 = numeric_array::typenum::U60;
pub type U61 = numeric_array::typenum::U61;
pub type U62 = numeric_array::typenum::U62;
pub type U63 = numeric_array::typenum::U63;
pub type U64 = numeric_array::typenum::U64;
pub type U65 = numeric_array::typenum::U65;
pub type U66 = numeric_array::typenum::U66;
pub type U67 = numeric_array::typenum::U67;
pub type U68 = numeric_array::typenum::U68;
pub type U69 = numeric_array::typenum::U69;
pub type U70 = numeric_array::typenum::U70;
pub type U71 = numeric_array::typenum::U71;
pub type U72 = numeric_array::typenum::U72;
pub type U73 = numeric_array::typenum::U73;
pub type U74 = numeric_array::typenum::U74;
pub type U75 = numeric_array::typenum::U75;
pub type U76 = numeric_array::typenum::U76;
pub type U77 = numeric_array::typenum::U77;
pub type U78 = numeric_array::typenum::U78;
pub type U79 = numeric_array::typenum::U79;
pub type U80 = numeric_array::typenum::U80;
pub type U81 = numeric_array::typenum::U81;
pub type U82 = numeric_array::typenum::U82;
pub type U83 = numeric_array::typenum::U83;
pub type U84 = numeric_array::typenum::U84;
pub type U85 = numeric_array::typenum::U85;
pub type U86 = numeric_array::typenum::U86;
pub type U87 = numeric_array::typenum::U87;
pub type U88 = numeric_array::typenum::U88;
pub type U89 = numeric_array::typenum::U89;
pub type U90 = numeric_array::typenum::U80;
pub type U91 = numeric_array::typenum::U91;
pub type U92 = numeric_array::typenum::U92;
pub type U93 = numeric_array::typenum::U93;
pub type U94 = numeric_array::typenum::U94;
pub type U95 = numeric_array::typenum::U95;
pub type U96 = numeric_array::typenum::U96;
pub type U97 = numeric_array::typenum::U97;
pub type U98 = numeric_array::typenum::U98;
pub type U99 = numeric_array::typenum::U99;
pub type U100 = numeric_array::typenum::U100;
pub type U101 = numeric_array::typenum::U101;
pub type U102 = numeric_array::typenum::U102;
pub type U103 = numeric_array::typenum::U103;
pub type U104 = numeric_array::typenum::U104;
pub type U105 = numeric_array::typenum::U105;
pub type U106 = numeric_array::typenum::U106;
pub type U107 = numeric_array::typenum::U107;
pub type U108 = numeric_array::typenum::U108;
pub type U109 = numeric_array::typenum::U109;
pub type U110 = numeric_array::typenum::U110;
pub type U111 = numeric_array::typenum::U111;
pub type U112 = numeric_array::typenum::U112;
pub type U113 = numeric_array::typenum::U113;
pub type U114 = numeric_array::typenum::U114;
pub type U115 = numeric_array::typenum::U115;
pub type U116 = numeric_array::typenum::U116;
pub type U117 = numeric_array::typenum::U117;
pub type U118 = numeric_array::typenum::U118;
pub type U119 = numeric_array::typenum::U119;
pub type U120 = numeric_array::typenum::U120;
pub type U121 = numeric_array::typenum::U121;
pub type U122 = numeric_array::typenum::U122;
pub type U123 = numeric_array::typenum::U123;
pub type U124 = numeric_array::typenum::U124;
pub type U125 = numeric_array::typenum::U125;
pub type U126 = numeric_array::typenum::U126;
pub type U127 = numeric_array::typenum::U127;
pub type U128 = numeric_array::typenum::U128;
pub fn constant<X: ConstantFrame<Sample = f32>>(x: X) -> An<Constant<X::Size>>
where
X::Size: Size<f32>,
{
An(Constant::new(x.frame()))
}
pub fn dc<X: ConstantFrame<Sample = f32>>(x: X) -> An<Constant<X::Size>>
where
X::Size: Size<f32>,
{
An(Constant::new(x.frame()))
}
pub fn zero() -> An<Constant<U1>> {
dc(0.0)
}
pub fn multizero<N: Size<f32>>() -> An<Constant<N>> {
An(Constant::new(Frame::splat(0.0)))
}
pub fn update<X: AudioNode, F: FnMut(f32, f32, &mut X) + Clone + Send + Sync>(
x: An<X>,
dt: f32,
f: F,
) -> An<System<X, F>> {
An(System::new(x, dt, f))
}
pub fn pass() -> An<Pass> {
An(Pass::new())
}
pub fn multipass<N: Size<f32>>() -> An<MultiPass<N>> {
An(MultiPass::new())
}
pub fn monitor(shared: &Shared, meter: Meter) -> An<Monitor> {
An(Monitor::new(shared, meter))
}
pub fn meter(meter: Meter) -> An<MeterNode> {
An(MeterNode::new(meter))
}
pub fn sink() -> An<Sink<U1>> {
An(Sink::new())
}
pub fn multisink<N: Size<f32>>() -> An<Sink<N>> {
An(Sink::new())
}
pub fn reverse<N: Size<f32>>() -> An<Reverse<N>> {
An(Reverse::new())
}
pub fn sine() -> An<Sine<f32>> {
An(Sine::new())
}
pub fn sine_hz(f: f32) -> An<Pipe<Constant<U1>, Sine<f32>>> {
constant(f) >> sine()
}
pub fn sine_phase(phase: f32) -> An<Sine<f32>> {
An(Sine::with_phase(phase))
}
pub fn ramp() -> An<Ramp<f32>> {
An(Ramp::new())
}
pub fn ramp_hz(f: f32) -> An<Pipe<Constant<U1>, Ramp<f32>>> {
constant(f) >> ramp()
}
pub fn ramp_phase(phase: f32) -> An<Ramp<f32>> {
An(Ramp::with_phase(phase))
}
pub fn ramp_hz_phase(f: f32, phase: f32) -> An<Pipe<Constant<U1>, Ramp<f32>>> {
constant(f) >> ramp_phase(phase)
}
pub fn rossler() -> An<Rossler> {
An(Rossler::new())
}
pub fn lorenz() -> An<Lorenz> {
An(Lorenz::new())
}
pub fn add<X: ConstantFrame<Sample = f32>>(
x: X,
) -> An<Binop<FrameAdd<X::Size>, MultiPass<X::Size>, Constant<X::Size>>>
where
X::Size: Size<f32> + Add<U0>,
<X::Size as Add<U0>>::Output: Size<f32>,
{
An(MultiPass::new()) + dc(x)
}
pub fn sub<X: ConstantFrame<Sample = f32>>(
x: X,
) -> An<Binop<FrameSub<X::Size>, MultiPass<X::Size>, Constant<X::Size>>>
where
X::Size: Size<f32> + Add<U0>,
<X::Size as Add<U0>>::Output: Size<f32>,
{
An(MultiPass::new()) - dc(x)
}
pub fn mul<X: ConstantFrame<Sample = f32>>(
x: X,
) -> An<Binop<FrameMul<X::Size>, MultiPass<X::Size>, Constant<X::Size>>>
where
X::Size: Size<f32> + Add<U0>,
<X::Size as Add<U0>>::Output: Size<f32>,
{
An(MultiPass::new()) * dc(x)
}
pub fn butterpass() -> An<ButterLowpass<f32, U2>> {
An(ButterLowpass::new(440.0))
}
pub fn butterpass_hz(f: f32) -> An<ButterLowpass<f32, U1>> {
An(ButterLowpass::new(f))
}
pub fn lowpole() -> An<Lowpole<f32, U2>> {
An(Lowpole::new(440.0))
}
pub fn lowpole_hz(f: f32) -> An<Lowpole<f32, U1>> {
An(Lowpole::new(f))
}
pub fn allpole() -> An<Allpole<f32, U2>> {
An(Allpole::new(1.0))
}
pub fn allpole_delay(delay: f32) -> An<Allpole<f32, U1>> {
An(Allpole::new(delay))
}
pub fn highpole() -> An<Highpole<f32, U2>> {
An(Highpole::new(440.0))
}
pub fn highpole_hz(cutoff: f32) -> An<Highpole<f32, U1>> {
An(Highpole::new(cutoff))
}
pub fn resonator() -> An<Resonator<f32, U3>> {
An(Resonator::new(440.0, 110.0))
}
pub fn resonator_hz(center: f32, bandwidth: f32) -> An<Resonator<f32, U1>> {
An(Resonator::new(center, bandwidth))
}
pub fn biquad(a1: f32, a2: f32, b0: f32, b1: f32, b2: f32) -> An<Biquad<f32>> {
An(Biquad::with_coefs(BiquadCoefs::arbitrary(
a1, a2, b0, b1, b2,
)))
}
pub fn moog() -> An<Moog<f32, U3>> {
An(Moog::new(1000.0, 0.1))
}
pub fn moog_q(q: f32) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Moog<f32, U3>>> {
(multipass::<U2>() | dc(q)) >> An(Moog::new(1000.0, q))
}
pub fn moog_hz(frequency: f32, q: f32) -> An<Moog<f32, U1>> {
An(Moog::new(frequency, q))
}
pub fn envelope<E, R>(f: E) -> An<Envelope<f32, E, R>>
where
E: FnMut(f32) -> R + Clone + Send + Sync,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(Envelope::new(0.002, f))
}
pub fn lfo<E, R>(f: E) -> An<Envelope<f32, E, R>>
where
E: FnMut(f32) -> R + Clone + Send + Sync,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(Envelope::new(0.002, f))
}
pub fn envelope2<E, R>(
mut f: E,
) -> An<EnvelopeIn<f32, impl FnMut(f32, &Frame<f32, U1>) -> R + Clone, U1, R>>
where
E: FnMut(f32, f32) -> R + Clone + Send + Sync,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(EnvelopeIn::new(0.002, move |t, i: &Frame<f32, U1>| {
f(t, convert(i[0]))
}))
}
pub fn lfo2<E, R>(
mut f: E,
) -> An<EnvelopeIn<f32, impl FnMut(f32, &Frame<f32, U1>) -> R + Clone, U1, R>>
where
E: FnMut(f32, f32) -> R + Clone + Send + Sync,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(EnvelopeIn::new(0.002, move |t, i: &Frame<f32, U1>| {
f(t, convert(i[0]))
}))
}
pub fn envelope3<E, R>(
mut f: E,
) -> An<EnvelopeIn<f32, impl FnMut(f32, &Frame<f32, U2>) -> R + Clone, U2, R>>
where
E: FnMut(f32, f32, f32) -> R + Clone + Send + Sync,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(EnvelopeIn::new(0.002, move |t, i: &Frame<f32, U2>| {
f(t, convert(i[0]), convert(i[1]))
}))
}
pub fn lfo3<E, R>(
mut f: E,
) -> An<EnvelopeIn<f32, impl FnMut(f32, &Frame<f32, U2>) -> R + Clone, U2, R>>
where
E: FnMut(f32, f32, f32) -> R + Clone + Send + Sync,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(EnvelopeIn::new(0.002, move |t, i: &Frame<f32, U2>| {
f(t, convert(i[0]), convert(i[1]))
}))
}
pub fn envelope_in<E, I, R>(f: E) -> An<EnvelopeIn<f32, E, I, R>>
where
E: FnMut(f32, &Frame<f32, I>) -> R + Clone + Send + Sync,
I: Size<f32>,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(EnvelopeIn::new(0.002, f))
}
pub fn lfo_in<E, I, R>(f: E) -> An<EnvelopeIn<f32, E, I, R>>
where
E: FnMut(f32, &Frame<f32, I>) -> R + Clone + Send + Sync,
I: Size<f32>,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(EnvelopeIn::new(0.002, f))
}
pub fn adsr_live(
attack: f32,
decay: f32,
sustain: f32,
release: f32,
) -> An<EnvelopeIn<f32, impl FnMut(f32, &Frame<f32, U1>) -> f32 + Clone, U1, f32>> {
super::adsr::adsr_live(attack, decay, sustain, release)
}
pub fn mls_bits(n: u64) -> An<Mls> {
An(Mls::new(MlsState::new(n as u32)))
}
pub fn mls() -> An<Mls> {
mls_bits(29)
}
pub fn noise() -> An<Noise> {
An(Noise::new())
}
pub fn white() -> An<Noise> {
An(Noise::new())
}
pub fn hold(variability: f32) -> An<Hold> {
An(Hold::new(variability))
}
pub fn hold_hz(f: f32, variability: f32) -> An<Pipe<Stack<Pass, Constant<U1>>, Hold>> {
(pass() | dc(f)) >> hold(variability)
}
pub fn fir<X: ConstantFrame<Sample = f32>>(weights: X) -> An<Fir<X::Size>> {
An(Fir::new(weights))
}
pub fn fir3(gain: f32) -> An<Fir<U3>> {
super::prelude::fir3(gain)
}
pub fn tick() -> An<Tick<U1>> {
An(Tick::new())
}
pub fn multitick<N: Size<f32>>() -> An<Tick<N>> {
An(Tick::new())
}
pub fn delay(t: f32) -> An<Delay> {
An(Delay::new(t as f64))
}
pub fn tap(min_delay: f32, max_delay: f32) -> An<Tap<U1>> {
An(Tap::new(min_delay, max_delay))
}
pub fn multitap<N>(min_delay: f32, max_delay: f32) -> An<Tap<N>>
where
N: Size<f32> + Add<U1>,
<N as Add<U1>>::Output: Size<f32>,
{
An(Tap::new(min_delay, max_delay))
}
pub fn tap_linear(min_delay: f32, max_delay: f32) -> An<TapLinear<U1>> {
An(TapLinear::new(min_delay, max_delay))
}
pub fn multitap_linear<N>(min_delay: f32, max_delay: f32) -> An<TapLinear<N>>
where
N: Size<f32> + Add<U1>,
<N as Add<U1>>::Output: Size<f32>,
{
An(TapLinear::new(min_delay, max_delay))
}
pub fn oversample<X>(node: An<X>) -> An<Oversampler<X>>
where
X: AudioNode,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
X::Inputs: Size<Frame<f32, U128>>,
X::Outputs: Size<Frame<f32, U128>>,
{
An(Oversampler::new(DEFAULT_SR, node.0))
}
pub fn resample<X>(node: An<X>) -> An<Resampler<X>>
where
X: AudioNode<Inputs = U0>,
X::Outputs: Size<f32>,
X::Outputs: Size<Frame<f32, U128>>,
{
An(Resampler::new(DEFAULT_SR, node.0))
}
pub fn feedback<N, X>(node: An<X>) -> An<Feedback<N, X, FrameId<N>>>
where
N: Size<f32>,
X: AudioNode<Inputs = N, Outputs = N>,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
{
An(Feedback::new(node.0, FrameId::new()))
}
pub fn feedback2<N, X, Y>(node: An<X>, loopback: An<Y>) -> An<Feedback2<N, X, Y, FrameId<N>>>
where
N: Size<f32>,
X: AudioNode<Inputs = N, Outputs = N>,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
Y: AudioNode<Inputs = N, Outputs = N>,
Y::Inputs: Size<f32>,
Y::Outputs: Size<f32>,
{
An(Feedback2::new(node.0, loopback.0, FrameId::new()))
}
pub fn allnest_c<X>(coefficient: f32, x: An<X>) -> An<AllNest<U1, X>>
where
X: AudioNode<Inputs = U1, Outputs = U1>,
{
An(AllNest::new(coefficient, x.0))
}
pub fn allnest<X>(x: An<X>) -> An<AllNest<U2, X>>
where
X: AudioNode<Inputs = U1, Outputs = U1>,
{
An(AllNest::new(0.0, x.0))
}
pub fn map<M, I, O>(f: M) -> An<Map<M, I, O>>
where
M: Fn(&Frame<f32, I>) -> O + Clone + Send + Sync,
I: Size<f32>,
O: ConstantFrame<Sample = f32>,
O::Size: Size<f32>,
{
An(Map::new(f, Routing::Arbitrary(0.0)))
}
pub fn dcblock_hz(cutoff: f32) -> An<DCBlock<f32>> {
An(DCBlock::new(cutoff))
}
pub fn dcblock() -> An<DCBlock<f32>> {
An(DCBlock::new(10.0))
}
pub fn declick() -> An<Declick<f32>> {
An(Declick::new(0.010))
}
pub fn declick_s(t: f32) -> An<Declick<f32>> {
An(Declick::new(t))
}
pub fn shape_fn<S: Fn(f32) -> f32 + Clone + Send + Sync>(f: S) -> An<Shaper<ShapeFn<S>>> {
An(Shaper::new(ShapeFn(f)))
}
pub fn shape<S: Shape>(mode: S) -> An<Shaper<S>> {
An(Shaper::new(mode))
}
pub fn clip() -> An<Shaper<Clip>> {
An(Shaper::new(Clip(1.0)))
}
pub fn clip_to(minimum: f32, maximum: f32) -> An<Shaper<ClipTo>> {
An(Shaper::new(ClipTo(minimum, maximum)))
}
pub fn panner() -> An<Panner<U2>> {
An(Panner::new(0.0))
}
pub fn pan(pan: f32) -> An<Panner<U1>> {
An(Panner::new(pan))
}
pub fn follow(response_time: f32) -> An<Follow<f32>> {
An(Follow::new(response_time))
}
pub fn afollow(attack_time: f32, release_time: f32) -> An<AFollow<f32>> {
An(AFollow::new(attack_time, release_time))
}
pub fn limiter(attack_time: f32, release_time: f32) -> An<Limiter<U1>> {
An(Limiter::new(DEFAULT_SR, attack_time, release_time))
}
pub fn limiter_stereo(attack_time: f32, release_time: f32) -> An<Limiter<U2>> {
An(Limiter::new(DEFAULT_SR, attack_time, release_time))
}
pub fn pinkpass() -> An<Pinkpass<f32>> {
An(Pinkpass::new())
}
pub fn pink() -> An<Pipe<Noise, Pinkpass<f32>>> {
white() >> pinkpass()
}
pub fn brown() -> An<Pipe<Noise, Binop<FrameMul<U1>, Lowpole<f32, U1>, Constant<U1>>>> {
white() >> lowpole_hz(10.0) * dc(13.7)
}
pub fn fdn<N, X>(x: An<X>) -> An<Feedback<N, X, FrameHadamard<N>>>
where
N: Size<f32>,
X: AudioNode<Inputs = N, Outputs = N>,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
{
An(Feedback::new(x.0, FrameHadamard::new()))
}
pub fn fdn2<N, X, Y>(x: An<X>, y: An<Y>) -> An<Feedback2<N, X, Y, FrameHadamard<N>>>
where
N: Size<f32>,
X: AudioNode<Inputs = N, Outputs = N>,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
Y: AudioNode<Inputs = N, Outputs = N>,
Y::Inputs: Size<f32>,
Y::Outputs: Size<f32>,
{
An(Feedback2::new(x.0, y.0, FrameHadamard::new()))
}
pub fn bus<X, Y>(x: An<X>, y: An<Y>) -> An<Bus<X, Y>>
where
X: AudioNode,
Y: AudioNode<Inputs = X::Inputs, Outputs = X::Outputs>,
{
x & y
}
pub fn busi<N, X, F>(f: F) -> An<MultiBus<N, X>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
F: Fn(u64) -> An<X>,
{
super::prelude::busi(f)
}
pub fn busf<N, X, Y>(f: Y) -> An<MultiBus<N, X>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
Y: Fn(f32) -> An<X>,
{
super::prelude::busf(f)
}
pub fn stack<X, Y>(x: An<X>, y: An<Y>) -> An<Stack<X, Y>>
where
X: AudioNode,
Y: AudioNode,
X::Inputs: Add<Y::Inputs>,
X::Outputs: Add<Y::Outputs>,
<X::Inputs as Add<Y::Inputs>>::Output: Size<f32>,
<X::Outputs as Add<Y::Outputs>>::Output: Size<f32>,
{
x | y
}
pub fn stacki<N, X, F>(f: F) -> An<MultiStack<N, X>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32> + Mul<N>,
X::Outputs: Size<f32> + Mul<N>,
<X::Inputs as Mul<N>>::Output: Size<f32>,
<X::Outputs as Mul<N>>::Output: Size<f32>,
F: Fn(u64) -> An<X>,
{
super::prelude::stacki(f)
}
pub fn stackf<N, X, Y>(f: Y) -> An<MultiStack<N, X>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32> + Mul<N>,
X::Outputs: Size<f32> + Mul<N>,
<X::Inputs as Mul<N>>::Output: Size<f32>,
<X::Outputs as Mul<N>>::Output: Size<f32>,
Y: Fn(f32) -> An<X>,
{
super::prelude::stackf(f)
}
pub fn branch<X, Y>(x: An<X>, y: An<Y>) -> An<Branch<X, Y>>
where
X: AudioNode,
Y: AudioNode<Inputs = X::Inputs>,
X::Outputs: Add<Y::Outputs>,
<X::Outputs as Add<Y::Outputs>>::Output: Size<f32>,
{
x ^ y
}
pub fn branchi<N, X, F>(f: F) -> An<MultiBranch<N, X>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32>,
X::Outputs: Size<f32> + Mul<N>,
<X::Outputs as Mul<N>>::Output: Size<f32>,
F: Fn(u64) -> An<X>,
{
super::prelude::branchi(f)
}
pub fn branchf<N, X, Y>(f: Y) -> An<MultiBranch<N, X>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32>,
X::Outputs: Size<f32> + Mul<N>,
<X::Outputs as Mul<N>>::Output: Size<f32>,
Y: Fn(f32) -> An<X>,
{
super::prelude::branchf(f)
}
pub fn thru<X>(x: An<X>) -> An<Thru<X>>
where
X: AudioNode,
{
!x
}
pub fn product<X, Y>(x: An<X>, y: An<Y>) -> An<Binop<FrameMul<X::Outputs>, X, Y>>
where
X: AudioNode,
Y: AudioNode<Outputs = X::Outputs>,
X::Inputs: Add<Y::Inputs>,
<X::Inputs as Add<Y::Inputs>>::Output: Size<f32>,
{
x * y
}
pub fn sum<X, Y>(x: An<X>, y: An<Y>) -> An<Binop<FrameAdd<X::Outputs>, X, Y>>
where
X: AudioNode,
Y: AudioNode<Outputs = X::Outputs>,
X::Inputs: Add<Y::Inputs>,
<X::Inputs as Add<Y::Inputs>>::Output: Size<f32>,
{
x + y
}
pub fn sumi<N, X, F>(f: F) -> An<Reduce<N, X, FrameAdd<X::Outputs>>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32> + Mul<N>,
X::Outputs: Size<f32>,
<X::Inputs as Mul<N>>::Output: Size<f32>,
F: Fn(u64) -> An<X>,
{
super::prelude::sumi(f)
}
pub fn sumf<N, X, Y>(f: Y) -> An<Reduce<N, X, FrameAdd<X::Outputs>>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32> + Mul<N>,
X::Outputs: Size<f32>,
<X::Inputs as Mul<N>>::Output: Size<f32>,
Y: Fn(f32) -> An<X>,
{
super::prelude::sumf(f)
}
pub fn pipe<X, Y>(x: An<X>, y: An<Y>) -> An<Pipe<X, Y>>
where
X: AudioNode,
Y: AudioNode<Inputs = X::Outputs>,
{
x >> y
}
pub fn pipei<N, X, F>(f: F) -> An<Chain<N, X>>
where
N: Size<f32> + Size<X>,
X: AudioNode,
F: Fn(u64) -> An<X>,
{
super::prelude::pipei(f)
}
pub fn pipef<N, X, Y>(f: Y) -> An<Chain<N, X>>
where
N: Size<f32>,
N: Size<X>,
X: AudioNode,
X::Inputs: Size<f32>,
X::Outputs: Size<f32>,
Y: Fn(f32) -> An<X>,
{
super::prelude::pipef(f)
}
pub fn split<N>() -> An<Split<N>>
where
N: Size<f32>,
{
An(Split::new())
}
pub fn multisplit<M, N>() -> An<MultiSplit<M, N>>
where
M: Size<f32> + Mul<N>,
N: Size<f32>,
<M as Mul<N>>::Output: Size<f32>,
{
An(MultiSplit::new())
}
pub fn join<N>() -> An<Join<N>>
where
N: Size<f32>,
{
An(Join::new())
}
pub fn multijoin<M, N>() -> An<MultiJoin<M, N>>
where
N: Size<f32>,
M: Size<f32> + Mul<N>,
<M as Mul<N>>::Output: Size<f32>,
{
An(MultiJoin::new())
}
pub fn reverb_stereo(
room_size: f32,
time: f32,
damping: f32,
) -> An<impl AudioNode<Inputs = U2, Outputs = U2>> {
super::prelude::reverb_stereo(room_size as f64, time as f64, damping as f64)
}
pub fn reverb2_stereo(
room_size: f32,
time: f32,
diffusion: f32,
modulation_speed: f32,
filter: An<impl AudioNode<Inputs = U1, Outputs = U1>>,
) -> An<impl AudioNode<Inputs = U2, Outputs = U2>> {
super::prelude::reverb2_stereo(
room_size as f64,
time as f64,
diffusion as f64,
modulation_speed as f64,
filter,
)
}
pub fn reverb3_stereo(
time: f32,
diffusion: f32,
filter: An<impl AudioNode<Inputs = U1, Outputs = U1>>,
) -> An<impl AudioNode<Inputs = U2, Outputs = U2>> {
An(super::reverb::Reverb::new(
time as f64,
diffusion as f64,
filter.0,
))
}
pub fn reverb4_stereo(room_size: f32, time: f32) -> An<impl AudioNode<Inputs = U2, Outputs = U2>> {
super::prelude::reverb4_stereo(room_size as f64, time as f64)
}
pub fn reverb4_stereo_delays(
delays: &[f32],
time: f32,
) -> An<impl AudioNode<Inputs = U2, Outputs = U2>> {
super::prelude::reverb4_stereo_delays(delays, time as f64)
}
pub fn dsf_saw() -> An<Dsf<U2>> {
An(Dsf::new(1.0, 0.5))
}
pub fn dsf_saw_r(roughness: f32) -> An<Dsf<U1>> {
An(Dsf::new(1.0, roughness))
}
pub fn dsf_square() -> An<Dsf<U2>> {
An(Dsf::new(2.0, 0.5))
}
pub fn dsf_square_r(roughness: f32) -> An<Dsf<U1>> {
An(Dsf::new(2.0, roughness))
}
pub fn pluck(frequency: f32, gain_per_second: f32, high_frequency_damping: f32) -> An<Pluck> {
An(Pluck::new(
frequency,
gain_per_second,
high_frequency_damping,
))
}
pub fn saw() -> An<WaveSynth<U1>> {
An(WaveSynth::new(saw_table()))
}
pub fn square() -> An<WaveSynth<U1>> {
An(WaveSynth::new(square_table()))
}
pub fn triangle() -> An<WaveSynth<U1>> {
An(WaveSynth::new(triangle_table()))
}
pub fn organ() -> An<WaveSynth<U1>> {
An(WaveSynth::new(organ_table()))
}
pub fn soft_saw() -> An<WaveSynth<U1>> {
An(WaveSynth::new(soft_saw_table()))
}
pub fn hammond() -> An<WaveSynth<U1>> {
An(WaveSynth::new(hammond_table()))
}
pub fn saw_hz(f: f32) -> An<Pipe<Constant<U1>, WaveSynth<U1>>> {
constant(f) >> saw()
}
pub fn square_hz(f: f32) -> An<Pipe<Constant<U1>, WaveSynth<U1>>> {
constant(f) >> square()
}
pub fn triangle_hz(f: f32) -> An<Pipe<Constant<U1>, WaveSynth<U1>>> {
constant(f) >> triangle()
}
pub fn organ_hz(f: f32) -> An<Pipe<Constant<U1>, WaveSynth<U1>>> {
constant(f) >> organ()
}
pub fn soft_saw_hz(f: f32) -> An<Pipe<Constant<U1>, WaveSynth<U1>>> {
constant(f) >> soft_saw()
}
pub fn hammond_hz(f: f32) -> An<Pipe<Constant<U1>, WaveSynth<U1>>> {
constant(f) >> hammond()
}
pub fn lowpass() -> An<Svf<f32, LowpassMode<f32>>> {
super::prelude::lowpass()
}
pub fn lowpass_hz(f: f32, q: f32) -> An<FixedSvf<f32, LowpassMode<f32>>> {
super::prelude::lowpass_hz(f, q)
}
pub fn lowpass_q(
q: f32,
) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Svf<f32, LowpassMode<f32>>>> {
super::prelude::lowpass_q(q)
}
pub fn highpass() -> An<Svf<f32, HighpassMode<f32>>> {
super::prelude::highpass()
}
pub fn highpass_hz(f: f32, q: f32) -> An<FixedSvf<f32, HighpassMode<f32>>> {
super::prelude::highpass_hz(f, q)
}
pub fn highpass_q(
q: f32,
) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Svf<f32, HighpassMode<f32>>>> {
super::prelude::highpass_q(q)
}
pub fn bandpass() -> An<Svf<f32, BandpassMode<f32>>> {
super::prelude::bandpass()
}
pub fn bandpass_hz(f: f32, q: f32) -> An<FixedSvf<f32, BandpassMode<f32>>> {
super::prelude::bandpass_hz(f, q)
}
pub fn bandpass_q(
q: f32,
) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Svf<f32, BandpassMode<f32>>>> {
super::prelude::bandpass_q(q)
}
pub fn notch() -> An<Svf<f32, NotchMode<f32>>> {
super::prelude::notch()
}
pub fn notch_hz(f: f32, q: f32) -> An<FixedSvf<f32, NotchMode<f32>>> {
super::prelude::notch_hz(f, q)
}
pub fn notch_q(q: f32) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Svf<f32, NotchMode<f32>>>> {
super::prelude::notch_q(q)
}
pub fn peak() -> An<Svf<f32, PeakMode<f32>>> {
super::prelude::peak()
}
pub fn peak_hz(f: f32, q: f32) -> An<FixedSvf<f32, PeakMode<f32>>> {
super::prelude::peak_hz(f, q)
}
pub fn peak_q(q: f32) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Svf<f32, PeakMode<f32>>>> {
super::prelude::peak_q(q)
}
pub fn allpass() -> An<Svf<f32, AllpassMode<f32>>> {
super::prelude::allpass()
}
pub fn allpass_hz(f: f32, q: f32) -> An<FixedSvf<f32, AllpassMode<f32>>> {
super::prelude::allpass_hz(f, q)
}
pub fn allpass_q(
q: f32,
) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Svf<f32, AllpassMode<f32>>>> {
super::prelude::allpass_q(q)
}
pub fn bell() -> An<Svf<f32, BellMode<f32>>> {
super::prelude::bell()
}
pub fn bell_hz(f: f32, q: f32, gain: f32) -> An<FixedSvf<f32, BellMode<f32>>> {
super::prelude::bell_hz(f, q, gain)
}
pub fn bell_q(
q: f32,
gain: f32,
) -> An<Pipe<Stack<MultiPass<U2>, Constant<U2>>, Svf<f32, BellMode<f32>>>> {
super::prelude::bell_q(q, gain)
}
pub fn lowshelf() -> An<Svf<f32, LowshelfMode<f32>>> {
super::prelude::lowshelf()
}
pub fn lowshelf_hz(f: f32, q: f32, gain: f32) -> An<FixedSvf<f32, LowshelfMode<f32>>> {
super::prelude::lowshelf_hz(f, q, gain)
}
pub fn lowshelf_q(
q: f32,
gain: f32,
) -> An<Pipe<Stack<MultiPass<U2>, Constant<U2>>, Svf<f32, LowshelfMode<f32>>>> {
super::prelude::lowshelf_q(q, gain)
}
pub fn highshelf() -> An<Svf<f32, HighshelfMode<f32>>> {
super::prelude::highshelf()
}
pub fn highshelf_hz(f: f32, q: f32, gain: f32) -> An<FixedSvf<f32, HighshelfMode<f32>>> {
super::prelude::highshelf_hz(f, q, gain)
}
pub fn highshelf_q(
q: f32,
gain: f32,
) -> An<Pipe<Stack<MultiPass<U2>, Constant<U2>>, Svf<f32, HighshelfMode<f32>>>> {
super::prelude::highshelf_q(q, gain)
}
pub fn lowrez() -> An<Rez<f32, U3>> {
super::prelude::lowrez()
}
pub fn lowrez_hz(cutoff: f32, q: f32) -> An<Rez<f32, U1>> {
super::prelude::lowrez_hz(cutoff, q)
}
pub fn lowrez_q(q: f32) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Rez<f32, U3>>> {
super::prelude::lowrez_q(q)
}
pub fn bandrez() -> An<Rez<f32, U3>> {
super::prelude::bandrez()
}
pub fn bandrez_hz(center: f32, q: f32) -> An<Rez<f32, U1>> {
super::prelude::bandrez_hz(center, q)
}
pub fn bandrez_q(q: f32) -> An<Pipe<Stack<MultiPass<U2>, Constant<U1>>, Rez<f32, U3>>> {
super::prelude::bandrez_q(q)
}
pub fn pulse() -> An<PulseWave> {
super::prelude::pulse()
}
pub fn morph() -> An<Morph<f32>> {
super::prelude::morph()
}
pub fn morph_hz(f: f32, q: f32, morph: f32) -> An<Pipe<Stack<Pass, Constant<U3>>, Morph<f32>>> {
super::prelude::morph_hz(f, q, morph)
}
pub fn wavech(wave: &Arc<Wave>, channel: usize, loop_point: Option<usize>) -> An<WavePlayer> {
An(WavePlayer::new(wave, channel, 0, wave.length(), loop_point))
}
pub fn wavech_at(
wave: &Arc<Wave>,
channel: usize,
start_point: usize,
end_point: usize,
loop_point: Option<usize>,
) -> An<WavePlayer> {
An(WavePlayer::new(
wave,
channel,
start_point,
end_point,
loop_point,
))
}
pub fn chorus(
seed: u64,
separation: f32,
variation: f32,
mod_frequency: f32,
) -> An<impl AudioNode<Inputs = U1, Outputs = U1>> {
super::prelude::chorus(seed, separation, variation, mod_frequency)
}
pub fn flanger<X: Fn(f32) -> f32 + Clone + Send + Sync>(
feedback_amount: f32,
minimum_delay: f32,
maximum_delay: f32,
delay_f: X,
) -> An<impl AudioNode<Inputs = U1, Outputs = U1>> {
super::prelude::flanger(feedback_amount, minimum_delay, maximum_delay, delay_f)
}
pub fn phaser<X: Fn(f32) -> f32 + Clone + Send + Sync>(
feedback_amount: f32,
phase_f: X,
) -> An<impl AudioNode<Inputs = U1, Outputs = U1>> {
super::prelude::phaser(feedback_amount, phase_f)
}
pub fn shared(value: f32) -> Shared {
Shared::new(value)
}
pub fn var(shared: &Shared) -> An<Var> {
An(Var::new(shared))
}
pub fn var_fn<F, R>(shared: &Shared, f: F) -> An<VarFn<F, R>>
where
F: Clone + Fn(f32) -> R + Send + Sync,
R: ConstantFrame<Sample = f32>,
R::Size: Size<f32>,
{
An(VarFn::new(shared, f))
}
pub fn timer(shared: &Shared) -> An<Timer> {
An(Timer::new(shared))
}
pub fn snoop(capacity: usize) -> (Snoop, An<SnoopBackend>) {
super::prelude::snoop(capacity)
}
pub fn resynth<I, O, F>(window_length: usize, processing: F) -> An<Resynth<I, O, F>>
where
I: Size<f32>,
O: Size<f32>,
F: FnMut(&mut FftWindow) + Clone + Send + Sync,
{
An(Resynth::new(window_length, processing))
}
pub fn impulse<N: Size<f32>>() -> An<Impulse<N>> {
An(Impulse::new())
}
pub fn rotate(angle: f32, gain: f32) -> An<Mixer<U2, U2>> {
An(Mixer::new(
[
[cos(angle) * gain, -sin(angle) * gain].into(),
[sin(angle) * gain, cos(angle) * gain].into(),
]
.into(),
))
}
pub fn unit<I: Size<f32>, O: Size<f32>>(unit: Box<dyn AudioUnit>) -> An<Unit<I, O>> {
An(Unit::new(unit))
}
pub fn dbell<S: Shape>(shape: S) -> An<DirtyBiquad<f32, BellBiquad<f32>, S>> {
An(DirtyBiquad::new(BellBiquad::new(), shape))
}
pub fn dbell_hz<S: Shape>(
shape: S,
center: f32,
q: f32,
gain: f32,
) -> An<FixedDirtyBiquad<f32, BellBiquad<f32>, S>> {
super::prelude::dbell_hz(shape, center, q, gain)
}
pub fn fbell<S: Shape>(shape: S) -> An<FbBiquad<f32, BellBiquad<f32>, S>> {
An(FbBiquad::new(BellBiquad::new(), shape))
}
pub fn fbell_hz<S: Shape>(
shape: S,
center: f32,
q: f32,
gain: f32,
) -> An<FixedFbBiquad<f32, BellBiquad<f32>, S>> {
super::prelude::fbell_hz(shape, center, q, gain)
}
pub fn dhighpass<S: Shape>(shape: S) -> An<DirtyBiquad<f32, HighpassBiquad<f32>, S>> {
An(DirtyBiquad::new(HighpassBiquad::new(), shape))
}
pub fn dhighpass_hz<S: Shape>(
shape: S,
cutoff: f32,
q: f32,
) -> An<FixedDirtyBiquad<f32, HighpassBiquad<f32>, S>> {
super::prelude::dhighpass_hz(shape, cutoff, q)
}
pub fn fhighpass<S: Shape>(shape: S) -> An<FbBiquad<f32, HighpassBiquad<f32>, S>> {
An(FbBiquad::new(HighpassBiquad::new(), shape))
}
pub fn fhighpass_hz<S: Shape>(
shape: S,
cutoff: f32,
q: f32,
) -> An<FixedFbBiquad<f32, HighpassBiquad<f32>, S>> {
super::prelude::fhighpass_hz(shape, cutoff, q)
}
pub fn dlowpass<S: Shape>(shape: S) -> An<DirtyBiquad<f32, LowpassBiquad<f32>, S>> {
An(DirtyBiquad::new(LowpassBiquad::new(), shape))
}
pub fn dlowpass_hz<S: Shape>(
shape: S,
cutoff: f32,
q: f32,
) -> An<FixedDirtyBiquad<f32, LowpassBiquad<f32>, S>> {
super::prelude::dlowpass_hz(shape, cutoff, q)
}
pub fn flowpass<S: Shape>(shape: S) -> An<FbBiquad<f32, LowpassBiquad<f32>, S>> {
An(FbBiquad::new(LowpassBiquad::new(), shape))
}
pub fn flowpass_hz<S: Shape>(
shape: S,
cutoff: f32,
q: f32,
) -> An<FixedFbBiquad<f32, LowpassBiquad<f32>, S>> {
super::prelude::flowpass_hz(shape, cutoff, q)
}
pub fn dresonator<S: Shape>(shape: S) -> An<DirtyBiquad<f32, ResonatorBiquad<f32>, S>> {
An(DirtyBiquad::new(ResonatorBiquad::new(), shape))
}
pub fn dresonator_hz<S: Shape>(
shape: S,
center: f32,
q: f32,
) -> An<FixedDirtyBiquad<f32, ResonatorBiquad<f32>, S>> {
super::prelude::dresonator_hz(shape, center, q)
}
pub fn fresonator<S: Shape>(shape: S) -> An<FbBiquad<f32, ResonatorBiquad<f32>, S>> {
An(FbBiquad::new(ResonatorBiquad::new(), shape))
}
pub fn fresonator_hz<S: Shape>(
shape: S,
center: f32,
q: f32,
) -> An<FixedFbBiquad<f32, ResonatorBiquad<f32>, S>> {
super::prelude::fresonator_hz(shape, center, q)
}