Safe Haskell | None |
---|---|
Language | Haskell98 |
Mapping and Abstractions for the analog four-voice synthesizer, TETR4 by Dave Smith Instruments.
Rather than being a tutorial on how to write your own mappings for your MIDI devices, this is more like the kitchen sink: it shows what is possible.
The DSI TETR4 has four separate voices that can (when set to multi-mode) be controlled via four different MIDI channels. Almost everything you can control directly on the device can be automated via MIDI messages.
- tetraController :: ControllerShape
- tetra :: Shape
- notesoff :: Pattern Double -> ParamPattern
- ccreset :: Pattern Double -> ParamPattern
- damp :: Pattern Double -> ParamPattern
- osc1freq :: Pattern Double -> ParamPattern
- osc1detune :: Pattern Double -> ParamPattern
- osc1shape :: Pattern Int -> ParamPattern
- osc1glide :: Pattern Double -> ParamPattern
- osc1kbd :: Pattern Int -> ParamPattern
- osc2freq :: Pattern Double -> ParamPattern
- osc2detune :: Pattern Double -> ParamPattern
- osc2shape :: Pattern Int -> ParamPattern
- osc2glide :: Pattern Double -> ParamPattern
- osc2kbd :: Pattern Int -> ParamPattern
- oscsync :: Pattern Double -> ParamPattern
- glidemode :: Pattern Int -> ParamPattern
- oscslop :: Pattern Double -> ParamPattern
- oscmix :: Pattern Double -> ParamPattern
- noise :: Pattern Double -> ParamPattern
- kamt :: Pattern Double -> ParamPattern
- cutoff_p :: Param
- attack_p :: Param
- release_p :: Param
- decay_p :: Param
- sustain_p :: Param
- audiomod :: Pattern Double -> ParamPattern
- fpoles :: Pattern Int -> ParamPattern
- twopole :: ParamPattern
- fourpole :: ParamPattern
- famt :: Pattern Double -> ParamPattern
- fvel :: Pattern Double -> ParamPattern
- fdel :: Pattern Double -> ParamPattern
- fatk :: Pattern Double -> ParamPattern
- fdcy :: Pattern Double -> ParamPattern
- fsus :: Pattern Double -> ParamPattern
- frel :: Pattern Double -> ParamPattern
- vcavol :: Pattern Double -> ParamPattern
- vamt :: Pattern Double -> ParamPattern
- vvel :: Pattern Double -> ParamPattern
- vdel :: Pattern Double -> ParamPattern
- lfo1rate :: Pattern Double -> ParamPattern
- lfo1shape :: Pattern Int -> ParamPattern
- lfo1amt :: Pattern Double -> ParamPattern
- lfo1dest :: Pattern Double -> ParamPattern
- lfo1sync :: Pattern Int -> ParamPattern
- lfo2rate :: Pattern Double -> ParamPattern
- lfo2shape :: Pattern Int -> ParamPattern
- lfo2amt :: Pattern Double -> ParamPattern
- lfo2dest :: Pattern Double -> ParamPattern
- lfo2sync :: Pattern Int -> ParamPattern
- lfo3rate :: Pattern Double -> ParamPattern
- lfo3shape :: Pattern Int -> ParamPattern
- lfo3amt :: Pattern Double -> ParamPattern
- lfo3dest :: Pattern Double -> ParamPattern
- lfo3sync :: Pattern Int -> ParamPattern
- lfo4rate :: Pattern Double -> ParamPattern
- lfo4shape :: Pattern Int -> ParamPattern
- lfo4amt :: Pattern Double -> ParamPattern
- lfo4dest :: Pattern Double -> ParamPattern
- lfo4sync :: Pattern Int -> ParamPattern
- emod :: Pattern Double -> ParamPattern
- eamt :: Pattern Double -> ParamPattern
- evel :: Pattern Double -> ParamPattern
- edel :: Pattern Double -> ParamPattern
- eatk :: Pattern Double -> ParamPattern
- edcy :: Pattern Double -> ParamPattern
- esus :: Pattern Double -> ParamPattern
- erel :: Pattern Double -> ParamPattern
- mod1src :: Pattern Double -> ParamPattern
- mod1amt :: Pattern Double -> ParamPattern
- mod1dst :: Pattern Double -> ParamPattern
- mod2src :: Pattern Double -> ParamPattern
- mod2amt :: Pattern Double -> ParamPattern
- mod2dst :: Pattern Double -> ParamPattern
- mod3src :: Pattern Double -> ParamPattern
- mod3amt :: Pattern Double -> ParamPattern
- mod3dst :: Pattern Double -> ParamPattern
- mod4src :: Pattern Double -> ParamPattern
- mod4amt :: Pattern Double -> ParamPattern
- mod4dst :: Pattern Double -> ParamPattern
- seq1dst :: Pattern Double -> ParamPattern
- seq2dst :: Pattern Double -> ParamPattern
- seq3dst :: Pattern Double -> ParamPattern
- seq4dst :: Pattern Double -> ParamPattern
- mwhl :: Pattern Double -> ParamPattern
- mwhldst :: Pattern Int -> ParamPattern
- aftt :: Pattern Double -> ParamPattern
- afttdst :: Pattern Int -> ParamPattern
- breath :: Pattern Double -> ParamPattern
- breathdst :: Pattern Int -> ParamPattern
- mvel :: Pattern Double -> ParamPattern
- mveldst :: Pattern Int -> ParamPattern
- foot :: Pattern Double -> ParamPattern
- footdst :: Pattern Int -> ParamPattern
- bendrng :: Pattern Int -> ParamPattern
- kbpm :: Pattern Int -> ParamPattern
- clockdiv :: Pattern Int -> ParamPattern
- sqntrig :: Pattern Double -> ParamPattern
- unisonkey :: Pattern Double -> ParamPattern
- unisonmode :: Pattern Double -> ParamPattern
- arpmode :: Pattern Double -> ParamPattern
- erepeat :: Pattern Double -> ParamPattern
- unison :: Pattern Double -> ParamPattern
- arp :: Pattern Double -> ParamPattern
- sqn :: Pattern Double -> ParamPattern
- mcr1 :: Pattern Int -> ParamPattern
- mcr2 :: Pattern Int -> ParamPattern
- mcr3 :: Pattern Int -> ParamPattern
- mcr4 :: Pattern Int -> ParamPattern
- btnfreq :: Pattern Double -> ParamPattern
- btnvel :: Pattern Double -> ParamPattern
- btnmode :: Pattern Double -> ParamPattern
- sub1vol :: Pattern Double -> ParamPattern
- sub2vol :: Pattern Double -> ParamPattern
- fbvol :: Pattern Double -> ParamPattern
- ksplitpoint :: Pattern Double -> ParamPattern
- kmode :: Pattern Double -> ParamPattern
- knormal :: ParamPattern
- kstack :: ParamPattern
- ksplit :: ParamPattern
- adsr :: Pattern String -> ParamPattern
- atk3 :: Pattern String -> ParamPattern
- dcy3 :: Pattern String -> ParamPattern
- sus3 :: Pattern String -> ParamPattern
- rel3' :: Pattern String -> ParamPattern
- lfotri :: Pattern Double
- lforsaw :: Pattern Double
- lfosaw :: Pattern Double
- lfopulse :: Pattern Double
- lforand :: Pattern Double
- lrate :: (Num b, Ord b, Functor f) => f b -> f b
- lstep :: (Num b, Ord b, Functor f) => f b -> f b
- lfo1 :: Pattern Int -> Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- lfo2 :: Pattern Int -> Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- lfo3 :: Pattern Int -> Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- lfo4 :: Pattern Int -> Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- mod1 :: Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- mod2 :: Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- mod3 :: Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- mod4 :: Pattern Double -> Pattern Double -> Pattern Double -> ParamPattern
- doublePattern :: Double -> Pattern Double
- dosc1 :: Pattern Double
- dosc2 :: Pattern Double
- dosc :: Pattern Double
- dmix :: Pattern Double
- dnoise :: Pattern Double
- dpw1 :: Pattern Double
- dpw2 :: Pattern Double
- dpw :: Pattern Double
- dcut :: Pattern Double
- dres :: Pattern Double
- damod :: Pattern Double
- dvca :: Pattern Double
- dspread :: Pattern Double
- dlfo1f :: Pattern Double
- dlfo2f :: Pattern Double
- dlfo3f :: Pattern Double
- dlfo4f :: Pattern Double
- dlfof :: Pattern Double
- dlfo1a :: Pattern Double
- dlfo2a :: Pattern Double
- dlfo3a :: Pattern Double
- dlfo4a :: Pattern Double
- dlfoa :: Pattern Double
- dfamt :: Pattern Double
- dvamt :: Pattern Double
- deamt :: Pattern Double
- damt :: Pattern Double
- dfatk :: Pattern Double
- dvatk :: Pattern Double
- deatk :: Pattern Double
- datk :: Pattern Double
- dfdcy :: Pattern Double
- dvdcy :: Pattern Double
- dedcy :: Pattern Double
- ddcy :: Pattern Double
- dfrel :: Pattern Double
- dvrel :: Pattern Double
- derel :: Pattern Double
- drel :: Pattern Double
- dmod1 :: Pattern Double
- dmod2 :: Pattern Double
- dmod3 :: Pattern Double
- dmod4 :: Pattern Double
- dfb :: Pattern Double
- dsub1 :: Pattern Double
- dsub2 :: Pattern Double
- dshape :: Pattern Double
- dslew :: Pattern Double
- sseq1 :: Pattern Double
- sseq2 :: Pattern Double
- sseq3 :: Pattern Double
- sseq4 :: Pattern Double
- slfo1 :: Pattern Double
- slfo2 :: Pattern Double
- slfo3 :: Pattern Double
- slfo4 :: Pattern Double
- sfenv :: Pattern Double
- svenv :: Pattern Double
- seenv :: Pattern Double
- spitchb :: Pattern Double
- smodwh :: Pattern Double
- saftert :: Pattern Double
- sbreath :: Pattern Double
- sfoot :: Pattern Double
- sexpr :: Pattern Double
- svel :: Pattern Double
- snote :: Pattern Double
- snoise :: Pattern Double
- snare :: ParamPattern
- kick :: ParamPattern
- chip :: ParamPattern
Documentation
tetraController :: ControllerShape Source #
The controller mapping for TETR4
To get the most out of this device with tidal, I chose to use the non-registered parameter (NRPN) variant to control it. This allows to use the full spectrum for controls like cutoff
that allow more granular stepping than standard MIDI (164 instead of 128 steps).
Many parameters diverge from the default ranges of 0 to 127 and therefore this mapping uses the mapRange
functionality for controls to allow you to always use double params, e.g.:
>>>
t1 $ n (run 4) # famt "0.5" # cutoff "0.3" # resonance "0.8"
while famt
, cutoff
and resonance
all have different ranges of operation (0..254, 0..14 and 0..127 respectively)
Some parameters are essentially mode switches and I chose to pass the values you enter into patterns directly through to the resulting control change. The method passThru
on control specification simply skips the scaling of values (you can write your own scaler if you want).
For very generic control I reused Tidal's own params, like cutoff
, attack
, gain
, pan
and release
. Sometimes the defaults for Tidal do not make sense for MIDI. See (_, cutoff_p)
below the actual controller shape for examples on how to deal with this.
osc1detune :: Pattern Double -> ParamPattern Source #
osc2detune :: Pattern Double -> ParamPattern Source #
unisonmode :: Pattern Double -> ParamPattern Source #
ksplitpoint :: Pattern Double -> ParamPattern Source #
adsr :: Pattern String -> ParamPattern Source #
Abstractions
Though not yet finished, these are some examples on how to combine multiple parameters into one single function you can use within your patterns.
Since Tidal 0.7 you can use the grp
method to allow things like:
>>>
t1 $ n (run 4) # adsr "0.1:0.6:0.3:0.9 0.8:0.3:0.9:0.1"
which alternates between two filter envelope shapes, the first one with a sharp attack and a long decay/release and the latter with a long attack, high sustain and a short release.
lrate :: (Num b, Ord b, Functor f) => f b -> f b Source #
A hack to handle a param with completely different behavior for certain parts of the range:
lrate
is limited from 0 to 150 and specifies values that will produce an lfo frequency
lstep
however is essentially limited from 0 to 16 and specifies values that will produce rhythmic lfo based on the _sequence speed_. as taken from the manual:
0: 32 steps 1: 16 steps 2: 8 steps 3: 6 steps 4: 4 steps 5: 3 steps 6: 2 steps 7: 1.5 steps 8: 1 step 9: 2/3 steps 10: 1/2 step 11: 1/3 step 12: 1/4 step 13: 1/6 step 14: 1/8 step 15: 1/16 step
doublePattern :: Double -> Pattern Double Source #
Modulation
named sources and destinations to able to refer them for lfos, mods and also sequences.
snare :: ParamPattern Source #
Presets suck, but I constantly forget how to make drums with the TETR4, so here are some defaults (that can mostly be changed when using them) to make a snare and a kick.
Use the snare like this:
>>>
t1 $ n "0(3,8)" # snare
To make it shorter:
>>>
t1 $ n "0(3,8)" # snare |-| release "0.1" |-| decay "0.1"
kick :: ParamPattern Source #
usage would be:
>>>
t1 $ n "0 [[0 1] 1]" # kick
you can change the defaults by applying merge operations for certain params:
>>>
t1 $ n "0(3,8)" # kick |+| edcy "0.05"
will give the kick more resonance
>>>
t1 $ n "0(3,8)" # kick |-| edcy "0.15"
will make it really dry
chip :: ParamPattern Source #
Since the TETR4 lacks a high-pass filter, things like snares and especially cymbals are somewhat limited to filtered noise which sounds okish.
Therefore some presets for the different types of sounds you can get from the TETR4 can come in handy and can also be combined and modified with and through others:
A chip tune like sound, reminds me of gameboys