tidal-midi-0.9.4: MIDI support for tidal

Safe HaskellNone
LanguageHaskell98

Sound.Tidal.MIDI.Control

Description

Mappings between Tidal's Params and MIDI control changes

Synopsis

Documentation

type RangeMapFunc = (Int, Int) -> Double -> Int Source #

Map a Double to Int using given min/max values

type MIDINoteShape = ParamMap Source #

Make sure you apply cutShape midiShape to an ParamMap before passing it into a function wanting this type

data ControlChange Source #

Describe mapping a Tidal Param in terms of MIDI

Constructors

CC 

Fields

  • param :: Param

    the Param this control will apply to

  • midi :: Int

    the MIDI parameter number to map to

  • range :: (Int, Int)

    the range this MIDI parameter accepts, by default this is (0,127)

  • scalef :: RangeMapFunc

    the function to apply mapping floating point values from pattern to MIDI integer values

NRPN 

Fields

  • param :: Param

    the Param this control will apply to

  • midi :: Int

    the MIDI parameter number to map to

  • range :: (Int, Int)

    the range this MIDI parameter accepts, by default this is (0,127)

  • scalef :: RangeMapFunc

    the function to apply mapping floating point values from pattern to MIDI integer values

SysEx 

Fields

  • param :: Param

    the Param this control will apply to

  • midi :: Int

    the MIDI parameter number to map to

  • range :: (Int, Int)

    the range this MIDI parameter accepts, by default this is (0,127)

  • scalef :: RangeMapFunc

    the function to apply mapping floating point values from pattern to MIDI integer values

data ControllerShape Source #

A definition for using a Tidal with specific MIDI device type.

By default, every ControllerShape accepts the following Params:

which will define the MIDI note to be played.

Constructors

ControllerShape 

Fields

midiShape :: Shape Source #

A simple shape defining the Params that are used for generating MIDI notes.

This simplifies splitting a ParamMap into params for notes and control values.

computeTiming Source #

Arguments

:: Tempo

the current playback speed

-> Ratio Integer

if unit is specified as cycle, this will be utilized to calculate the note's absolute duration with regard to current cycle length Note: this will ignore the specified duration of the Tidal param dur

-> MIDINoteShape

A map of Params that describes the note to be played

-> ((Int, Int, Ratio Integer), Double)

A tuple of a TimedNote triplet and the value for nudge to offset this note by

Turns a MIDINoteShape into concrete values for scheduling.

toShape :: ControllerShape -> Shape Source #

Converts a ControllerShapes controls into Params and makes a Shape This acts as an interface between Tidal's scheduling loop and MIDI scheduling.

passThru :: (Int, Int) -> Double -> Int Source #

A RangeMapFunc that simply passes floors Doubles.

This can be used if a MIDI parameter of a device has different meanings for each value, e.g. the type of oscillator has to be specified by either "0", "1", "2" or "3" each representing a different waveform (sine, tri, square, rand)

mapRange :: (Int, Int) -> Double -> Int Source #

Default mapping function from Double to Int.

>>> mapRange (0, 127) 0.5
63

mCC :: Param -> Int -> ControlChange Source #

Helper function for creating a standard ControlChange for MIDI parameter

mNRPN :: Param -> Int -> ControlChange Source #

Helper function for creating a standard ControlChange for a non-registered MIDI parameter

mrNRPN :: Param -> Int -> (Int, Int) -> ControlChange Source #

Helper function for creating a ControlChange for a non-registered MIDI parameter with a custom range

toParams :: ControllerShape -> [Param] Source #

Translate a ControllerShapes controls into a list of Param

ctrlN :: Num b => ControllerShape -> Param -> Maybe b Source #

Translate a Tidal Param into the corresponding MIDI parameter number according to a specific ControllerShape