Safe Haskell | None |
---|---|
Language | Haskell98 |
Midi.
- data MidiChn
- type MidiFun a = (Msg -> SE a) -> SE a
- toMidiFun :: Sigs a => MidiChn -> MidiFun a
- toMidiFun_ :: MidiChn -> MidiFun ()
- data Msg :: *
- type Channel = Int
- midi :: (Num a, Sigs a) => (Msg -> SE a) -> SE a
- midin :: (Num a, Sigs a) => Channel -> (Msg -> SE a) -> SE a
- pgmidi :: (Num a, Sigs a) => Maybe Int -> Channel -> (Msg -> SE a) -> SE a
- ampCps :: Msg -> (D, D)
- midi_ :: (Msg -> SE ()) -> SE ()
- midin_ :: Channel -> (Msg -> SE ()) -> SE ()
- pgmidi_ :: Maybe Int -> Channel -> (Msg -> SE ()) -> SE ()
- monoMsg :: MidiChn -> D -> D -> SE (Sig, Sig)
- holdMsg :: MidiChn -> D -> SE (Sig, Sig)
- midiKeyOn :: MidiChn -> D -> SE (Evt D)
- midiKeyOff :: MidiChn -> D -> SE Tick
- cpsmidi :: Msg -> D
- ampmidi :: Msg -> D -> D
- initc7 :: D -> D -> D -> SE ()
- ctrl7 :: D -> D -> D -> D -> Sig
- midiCtrl7 :: D -> D -> D -> D -> D -> SE Sig
- midiCtrl :: D -> D -> D -> SE Sig
- umidiCtrl :: D -> D -> D -> SE Sig
- class MidiInstr a where
- type MidiInstrOut a :: *
- onMsg :: a -> Msg -> SE (MidiInstrOut a)
Documentation
Specifies the midi channel or programm.
toMidiFun_ :: MidiChn -> MidiFun () Source
data Msg :: *
MidiInstr (Msg -> (Sig, Sig)) | |
MidiInstr (Msg -> (Sig, Sig, Sig)) | |
MidiInstr (Msg -> (Sig, Sig, Sig, Sig)) | |
MidiInstr (Msg -> Sig) | |
MidiInstr (Msg -> SE (Sig, Sig)) | |
MidiInstr (Msg -> SE (Sig, Sig, Sig)) | |
MidiInstr (Msg -> SE (Sig, Sig, Sig, Sig)) | |
MidiInstr (Msg -> SE Sig) | |
type MidiInstrOut (Msg -> (Sig, Sig)) = (Sig, Sig) | |
type MidiInstrOut (Msg -> (Sig, Sig, Sig)) = (Sig, Sig, Sig) | |
type MidiInstrOut (Msg -> (Sig, Sig, Sig, Sig)) = (Sig, Sig, Sig, Sig) | |
type MidiInstrOut (Msg -> Sig) = Sig | |
type MidiInstrOut (Msg -> SE (Sig, Sig)) = (Sig, Sig) | |
type MidiInstrOut (Msg -> SE (Sig, Sig, Sig)) = (Sig, Sig, Sig) | |
type MidiInstrOut (Msg -> SE (Sig, Sig, Sig, Sig)) = (Sig, Sig, Sig, Sig) | |
type MidiInstrOut (Msg -> SE Sig) = Sig |
midi :: (Num a, Sigs a) => (Msg -> SE a) -> SE a
Triggers a midi-instrument (aka Csound's massign) for all channels. It's useful to test a single instrument.
midin :: (Num a, Sigs a) => Channel -> (Msg -> SE a) -> SE a
Triggers a midi-instrument (aka Csound's massign) on the specified channel.
pgmidi :: (Num a, Sigs a) => Maybe Int -> Channel -> (Msg -> SE a) -> SE a
Triggers a midi-instrument (aka Csound's pgmassign) on the specified programm bank.
midin_ :: Channel -> (Msg -> SE ()) -> SE ()
Triggers a midi-procedure (aka Csound's pgmassign) on the given channel.
pgmidi_ :: Maybe Int -> Channel -> (Msg -> SE ()) -> SE ()
Triggers a midi-procedure (aka Csound's pgmassign) on the given programm bank.
Mono-midi synth
monoMsg :: MidiChn -> D -> D -> SE (Sig, Sig) Source
Produces midi amplitude and frequency as a signal. The signal fades out when nothing is pressed. It can be used in mono-synths. Arguments are portamento time and release time. A portamento time is time it takes for transition from one note to another.
monoMsg channel portamentoTime releaseTime
holdMsg :: MidiChn -> D -> SE (Sig, Sig) Source
Produces midi amplitude and frequency as a signal and holds the last value till the next one is present. It can be used in mono-synths. Arguments are portamento time and release time. A portamento time is time it takes for transition from one note to another.
holdMsg portamentoTime
Midi event streams
midiKeyOn :: MidiChn -> D -> SE (Evt D) Source
Listens to midi on event on the given key as event stream. The event stream carries the level of volume (ranges from 0 to 1).
midiKeyOff :: MidiChn -> D -> SE Tick Source
Listens to midi on event off the given key as event stream.
Reading midi note parameters
Get the note number of the current MIDI event, expressed in cycles-per-second.
icps cpsmidi
csound doc: http://www.csounds.com/manual/html/cpsmidi.html
Get the velocity of the current MIDI event.
iamp ampmidi iscal [, ifn]
csound doc: http://www.csounds.com/manual/html/ampmidi.html
ctrl7 :: D -> D -> D -> D -> Sig
Allows a floating-point 7-bit MIDI signal scaled with a minimum and a maximum range.
idest ctrl7 ichan, ictlno, imin, imax [, ifn] kdest ctrl7 ichan, ictlno, kmin, kmax [, ifn] adest ctrl7 ichan, ictlno, kmin, kmax [, ifn] [, icutoff]
csound doc: http://www.csounds.com/manual/html/ctrl7.html
midiCtrl7 :: D -> D -> D -> D -> D -> SE Sig Source
Initializes midi control and get the value in the specified range.
midiCtrl :: D -> D -> D -> SE Sig Source
Initializes midi control and get the value in the range (-1) to 1.
umidiCtrl :: D -> D -> D -> SE Sig Source
Unipolar midiCtrl. Initializes midi control and get the value in the range 0 to 1.
Overload
class MidiInstr a where Source
type MidiInstrOut a :: * Source
onMsg :: a -> Msg -> SE (MidiInstrOut a) Source