Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data AudioClock (rate :: AudioRate) (bufferSize :: Nat) = AudioClock
- data AudioRate
- data PureAudioClock (rate :: AudioRate) = PureAudioClock
- pureAudioClockF :: PureAudioClockF rate
Documentation
data AudioClock (rate :: AudioRate) (bufferSize :: Nat) Source #
A clock for audio analysis and synthesis.
It internally processes samples in buffers of size bufferSize
,
(the programmer does not have to worry about this),
at a sample rate of rate
(of type AudioRate
).
Both these parameters are in the type signature,
so it is not possible to compose signals with different buffer sizes
or sample rates.
After processing a buffer, the clock will wait the remaining time
until the next buffer must be processed,
using system UTC time.
The tag of the clock specifies whether the attempt to finish the last buffer in real time was successful.
A value of Nothing
represents success,
a value of Just double
represents a lag of double
seconds.
Instances
(MonadIO m, KnownNat bufferSize, AudioClockRate rate) => Clock m (AudioClock rate bufferSize) Source # | |
Defined in FRP.Rhine.Clock.Realtime.Audio type TimeDomainOf (AudioClock rate bufferSize) :: * Source # type Tag (AudioClock rate bufferSize) :: * Source # startClock :: AudioClock rate bufferSize -> m (MSF m () (TimeDomainOf (AudioClock rate bufferSize), Tag (AudioClock rate bufferSize)), TimeDomainOf (AudioClock rate bufferSize)) Source # | |
type TimeDomainOf (AudioClock rate bufferSize) Source # | |
Defined in FRP.Rhine.Clock.Realtime.Audio | |
type Tag (AudioClock rate bufferSize) Source # | |
Defined in FRP.Rhine.Clock.Realtime.Audio |
data PureAudioClock (rate :: AudioRate) Source #
A side-effect free clock for audio synthesis and analysis.
The sample rate is given by rate
(of type AudioRate
).
Since this clock does not wait for the completion of buffers,
the producer or the consumer of the signal has the obligation to
synchronise the signal with the system clock, if realtime is desired.
Otherwise, the clock is also suitable e.g. for batch processing of audio files.
Instances
(Monad m, PureAudioClockRate rate) => Clock m (PureAudioClock rate) Source # | |
Defined in FRP.Rhine.Clock.Realtime.Audio type TimeDomainOf (PureAudioClock rate) :: * Source # type Tag (PureAudioClock rate) :: * Source # startClock :: PureAudioClock rate -> m (MSF m () (TimeDomainOf (PureAudioClock rate), Tag (PureAudioClock rate)), TimeDomainOf (PureAudioClock rate)) Source # | |
type TimeDomainOf (PureAudioClock rate) Source # | |
Defined in FRP.Rhine.Clock.Realtime.Audio | |
type Tag (PureAudioClock rate) Source # | |
Defined in FRP.Rhine.Clock.Realtime.Audio |
pureAudioClockF :: PureAudioClockF rate Source #