Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Implementation of server b_gen routines.
The naming scheme is: _p generates one partial, _l generates a list of partials, _nrm is the unit normalised form.
Synopsis
- sum_l :: Num n => [[n]] -> [n]
- nrm_u :: (Fractional n, Ord n) => [n] -> [n]
- sine1_p :: (Enum n, Floating n) => Int -> (n, n) -> [n]
- sine1_l :: (Enum n, Floating n) => Int -> [n] -> [[n]]
- sine1 :: (Enum n, Floating n) => Int -> [n] -> [n]
- sine1_nrm :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n]
- sine1Tbl :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n]
- sine2_l :: (Enum n, Floating n) => Int -> [(n, n)] -> [[n]]
- sine2 :: (Enum n, Floating n) => Int -> [(n, n)] -> [n]
- sine2_nrm :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n]
- sine3_p :: (Enum n, Floating n) => Int -> (n, n, n) -> [n]
- sine3_l :: (Enum n, Floating n) => Int -> [(n, n, n)] -> [[n]]
- sine3 :: (Enum n, Floating n) => Int -> [(n, n, n)] -> [n]
- gen_cheby :: (Enum n, Floating n, Ord n, Integral i) => i -> [n] -> [n]
- cheby :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n]
- chebyShaperTbl :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n]
Documentation
nrm_u :: (Fractional n, Ord n) => [n] -> [n] Source #
Unit normalisation.
sine1
sine1_p :: (Enum n, Floating n) => Int -> (n, n) -> [n] Source #
sine3_p
with zero phase.
import Sound.Sc3.Plot plot_p1_ln [sine1_p 512 (1, 1)]
sine1_l :: (Enum n, Floating n) => Int -> [n] -> [[n]] Source #
Series of sine wave harmonics using specified amplitudes.
sine1Tbl :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n] Source #
Variant that generates a wavetable (without guard point) suitable for the Shaper Ugen.
sine2
sine2_l :: (Enum n, Floating n) => Int -> [(n, n)] -> [[n]] Source #
Series of n sine wave partials using specified frequencies and amplitudes.
sine3
sine3_p :: (Enum n, Floating n) => Int -> (n, n, n) -> [n] Source #
Sine wave table at specified frequency, amplitude and phase. The table does not arrive back at the starting point.
>>>
map (round . (* 100)) (sine3_p 8 (1, 1, 0))
[0,71,100,71,0,-71,-100,-71]
cheby
gen_cheby :: (Enum n, Floating n, Ord n, Integral i) => i -> [n] -> [n] Source #
Generate Chebyshev waveshaping table, see b_gen_cheby. Cf. https://www.csounds.com/manual/html/GEN13.html
import Sound.Sc3.Plot let p x = plot_p1_ln [gen_cheby 512 x]
p [1, 0, 1, 1, 0, 1] p [100, -50, -33, 25, 20, -16.7, -14.2, 12.5, 11.1, -10, -9.09, 8.333, 7.69, -7.14, -6.67, 6.25, 5.88, -5.55, -5.26, 5] p [100, 0, -33, 0, 20, 0, -14.2, 0, 11.1, 0, -9.09, 0, 7.69, 0, -6.67, 0, 5.88, 0, -5.26] p [100, 0, -11.11, 0, 4, 0, -2.04, 0, 1.23, 0, -0.826, 0, 0.59, 0, -0.444, 0, 0.346, 0, -0.277] p [1, -0.8, 0, 0.6, 0, 0, 0, 0.4, 0, 0, 0, 0, 0.1, -0.2, -0.3, 0.5] p [0, 0, -0.1, 0, 0.3, 0, -0.5, 0, 0.7, 0, -0.9, 0, 1, 0, -1, 0] p [0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, -0.1, 0, 0.1, 0, -0.2, 0.3, 0, -0.7, 0, 0.2, 0, -0.1] p [5, 0, 3, 0, 1]