hdf-0.14: gr/fig-3-6.hs
import Data.Int {- base -}
import Sound.DF.Uniform.GADT {- hdf -}
import Sound.DF.Uniform.LL.K {- hdf -}
-- | DF variant of Faust @~@.
tilde :: (Num a,K' a) => (DF a -> DF a) -> (DF a -> DF a) -> DF a
tilde f g = rec_h 0 (\i -> let r = f i in (r,g r))
-- | DF translation of Faust graph @(12345 : +) ~ (1103515245 : *)@.
--
-- > draw fig_3_6
fig_3_6 :: DF Int32
fig_3_6 = (12345 +) `tilde` (* 1103515245)
-- | Converted to floating point and sent to output.
--
-- > draw fig_3_6'
fig_3_6' :: DF ()
fig_3_6' = out1 (i32_to_normal_f32 fig_3_6 * 0.1)
main :: IO ()
main = audition [] fig_3_6'