Safe Haskell | Safe-Infered |
---|
- ioToLazyList :: IO a -> IO [a]
- inputEventsCore :: ReaderT Handle IO [T]
- inputEvents :: ReaderT Handle IO (T Time Data)
- pairListFromRelativeEvents :: T Time a -> [(TimeAbs, a)]
- outputEvents :: T Time Data -> ReaderT Handle IO ()
- outputEventBundles :: T Time EventDataBundle -> ReaderT Handle IO ()
- outputEventBundled :: T Time EventDataBundle -> ReaderT Handle IO ()
- data Trigger a
- type EventDataTrigger = Bundle (Trigger Data)
- makeTriggerEvent :: Handle -> TimeAbs -> Trigger Data -> T
- makeTriggerEvents :: Handle -> TimeAbs -> EventDataTrigger -> [T]
- outputTriggerEvents :: T Time EventDataTrigger -> ReaderT Handle IO ()
- mergeGenerated :: T Time (Bundle a) -> T Time (Bundle a) -> T Time (Bundle (Trigger a))
- equidistantEvents :: Time -> [a] -> T Time a
- whirl :: T Time EventDataBundle
- mergeGeneratedAtoms :: (Time -> a) -> T Time a -> T Time a -> T Time a
- patternMono :: PatternMono i -> Time -> T Time Data -> T Time EventDataTrigger
- patternMonoTempo :: PatternMono i -> ((Channel, Controller), (Time, Time, Time)) -> T Time Data -> T Time EventDataTrigger
- patternPolyTempo :: PatternPoly i -> ((Channel, Controller), (Time, Time, Time)) -> T Time Data -> T Time EventDataTrigger
- class Pattern pat where
- patternTempo :: pat -> ((Channel, Controller), (Time, Time, Time)) -> T Time Data -> T Time EventDataTrigger
- sweep :: Channel -> Time -> (Controller, (Time, Time)) -> Controller -> Controller -> (Double -> Double) -> T Time Data -> T Time EventDataTrigger
- filter :: (a -> Bool) -> State (T Time (Bundle a)) (T Time (Bundle a))
- filterSimple :: (a -> Bool) -> T Time (Bundle a) -> T Time (Bundle a)
- merge :: T Time (Bundle a) -> T Time (Bundle a) -> T Time (Bundle a)
- process :: (T Time Data -> T Time EventDataTrigger) -> ReaderT Handle IO ()
- processSimple :: (T Time Data -> T Time EventDataBundle) -> ReaderT Handle IO ()
- runWhirl :: ReaderT Handle IO ()
- runDelay :: ReaderT Handle IO ()
- runKeyboardSplit :: ReaderT Handle IO ()
- runKeyboardSplitLow :: ReaderT Handle IO ()
- runKeyboardSplitHigh :: ReaderT Handle IO ()
- runCyclePrograms :: [Program] -> ReaderT Handle IO ()
- runProgramsAsBanks :: [Int32] -> ReaderT Handle IO ()
- runPattern :: Time -> PatternMono i -> ReaderT Handle IO ()
- runPatternTempo :: Pattern pat => Time -> pat -> ReaderT Handle IO ()
- runFilterSweep :: ReaderT Handle IO ()
- main :: IO ()
Documentation
ioToLazyList :: IO a -> IO [a]Source
pairListFromRelativeEvents :: T Time a -> [(TimeAbs, a)]Source
outputEventBundles :: T Time EventDataBundle -> ReaderT Handle IO ()Source
Sends (drain) each event individually since the events in the bundle might be created in a lazy manner.
type EventDataTrigger = Bundle (Trigger Data)Source
makeTriggerEvents :: Handle -> TimeAbs -> EventDataTrigger -> [T]Source
outputTriggerEvents :: T Time EventDataTrigger -> ReaderT Handle IO ()Source
This function distinguishes between events from portIn
and events that are generated by us.
Our generated events must also send an echo to the input port
in order to break event_input
and thus trigger their delivery.
equidistantEvents :: Time -> [a] -> T Time aSource
patternMono :: PatternMono i -> Time -> T Time Data -> T Time EventDataTriggerSource
patternMonoTempo :: PatternMono i -> ((Channel, Controller), (Time, Time, Time)) -> T Time Data -> T Time EventDataTriggerSource
patternPolyTempo :: PatternPoly i -> ((Channel, Controller), (Time, Time, Time)) -> T Time Data -> T Time EventDataTriggerSource
This allows more complex patterns including pauses, notes of different lengths and simultaneous notes.
patternTempo :: pat -> ((Channel, Controller), (Time, Time, Time)) -> T Time Data -> T Time EventDataTriggerSource
Pattern (PatternPoly i) | |
Pattern (PatternMono i) |
sweep :: Channel -> Time -> (Controller, (Time, Time)) -> Controller -> Controller -> (Double -> Double) -> T Time Data -> T Time EventDataTriggerSource
Automatically changes the value of a MIDI controller
every period
seconds according to a periodic wave.
The wave function is a mapping
from the phase in [0,1)
to a controller value in the range (-1,1)
.
The generation of the wave is controlled by a speed controller
(minSpeed
and maxSpeed
are in waves per second),
the modulation depth and the center value.
The center controller is also the one where we emit our wave.
That is, when modulation depth is zero
then this effect is almost the same
as forwarding the controller without modification.
The small difference is, that we emit a controller value at a regular patternMono,
whereas direct control would mean
that only controller value changes are transfered.
sweep channel period (speedCtrl, (minSpeed, maxSpeed)) depthCtrl centerCtrl (ctrlRange (-1,1) (sin . (2*pi*)))
We could use the nice Wave abstraction from the synthesizer package, but that's a heavy dependency because of multi-parameter type classes.
combinators
filter :: (a -> Bool) -> State (T Time (Bundle a)) (T Time (Bundle a))Source
The function maintains empty bundles in order to maintain laziness breaks. These breaks are import for later merging of the streams.
run filters
runCyclePrograms :: [Program] -> ReaderT Handle IO ()Source
runCyclePrograms (map VoiceMsg.toProgram [8..12])
runPattern :: Time -> PatternMono i -> ReaderT Handle IO ()Source
runPattern 0.12 (cycleUp 4)
runPatternTempo :: Pattern pat => Time -> pat -> ReaderT Handle IO ()Source
runPatternTempo 0.12 (cycleUp 4)
runPatternTempo 0.2 (PatternMono selectFromOctaveChord (cycle [0,1,2,0,1,2,0,1]))
runPatternTempo 0.1 (PatternPoly selectFromLimittedChord (let pat = [item 0 1] ./ 1 /. [item 1 1] ./ 2 /. [item 1 1] ./ 1 /. [item 0 1] ./ 2 /. pat in 0 /. pat))