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

Safe HaskellNone
LanguageHaskell2010

Synthesizer.MIDI.Example.Instrument

Synopsis

Documentation

sampleRate :: C a => a Source #

sampledSoundTimeLoop :: (Real -> Real -> Real -> Real -> T Real) -> (Real, T Real) -> Real -> Real -> Instrument Real Real Source #

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.