synthesizer-midi- Render audio signals from MIDI files or realtime messages

Safe HaskellNone




sampledSoundTimeLoop :: (Real -> Real -> Real -> Real -> T Real) -> (Real, T Real) -> Real -> Real -> Instrument Real RealSource

Resample a sampled sound with a smooth loop using our time manipulation algorithm. Time is first controlled linearly, then switches to a sine or triangular control. Loop start must be large enough in order provide enough spare data for interpolation at the beginning and loop start plus length must preserve according space at the end. One period is enough space for linear interpolation. The infinite sound we generate is not just a cycle, that uses bounded space. Instead we need to compute all the time. In order to avoid duplicate interpolation, we have merged resampling and time looping.