TR8S + TidalCycles = ❤️

Hi all. Been having loads of fun tidaling on a Roland TR-8S. It's an awesome pair for tidal, but quite tricky to get the MIDI mappings right - sharing mine here to (hopefully) save someone's time.

-- TR8S MIDI CC Map
tr8sChanArray = [36,38,43,47,50,37,39,42,46,49,51]
tr8sAltChanArray = [35,40,41,45,48,56,54,44,55,57,59]
tr8sToneCCArray = [20,25,46,49,52,55,58,61,80,83,86]
tr8sDecayCCArray = [23,28,47,50,53,56,59,62,81,84,87]
tr8sCtrlCCArray = [96,97,102,103,104,105,106,107,108,109,110]

-- TR8S Functions
:{
let ctrl = modw
    translateEventsToMIDICC array name valueGetter idx pat = ccv (fmap valueGetter $ filterJust $ M.lookup name <$> pat) # ccn (array!!idx)
    noteToTR8STuneCC = translateEventsToMIDICC tr8sToneCCArray "note" (fromIntegral . (`mod` 127) . toInteger . floor . (* 64) . (/ 12) . toRational . nvalue)
    modwToTR8SCtrlCC = translateEventsToMIDICC tr8sCtrlCCArray "modwheel" ((* 127) . max 0 . min 1 . fvalue)
    susToTR8SDecayCC = translateEventsToMIDICC tr8sDecayCCArray "sustain" ((* 127) . max 0 . min 1 . fvalue)
    tr idx pat = p (toID $ "tr8s" ++ show (tr8sToneCCArray!!idx))
      $ stack (pat : fmap (\translator -> translator idx pat) [ noteToTR8STuneCC, susToTR8SDecayCC, modwToTR8SCtrlCC ])
      # stack [
        s "tr" # midichan 9 # midinote (tr8sChanArray!!idx),
        s "loopback" # midichan (pure $ fromIntegral idx)
      ]
    trbank num = asap $ progNum num # s "tr"
    trs pats = mapM_ (\(pat,idx) -> tr idx pat) $ zip pats [0..16]
:}

-- channels by name (as written on the device)
:{
let bd = d1
    sd = d2
    lt = d3
    mt = d4
    ht = d5
    rs = d6
    hc = d7
    ch = d8
    oh = d9
    cc = d10
    rc = d11
:}

-- If you want to substitute d1-12 with tr8s channels
:{
let d1 = tr 0
    d2 = tr 1
    d3 = tr 2
    d4 = tr 3
    d5 = tr 4
    d6 = tr 5
    d7 = tr 6
    d8 = tr 7
    d9 = tr 8
    d10 = tr 9 
    d11 = tr 10
    d12 = tr 11
    d13 = tr 12
    d14 = tr 13
    d15 = tr 14
    d16 = tr 15
:}

Usage:

bd $ n "0*2"

sn $ n "~ 0"

lt $ (scale "major" $ note "0*4") # sus 0.1 # ctrl 1

mt $ scale "major" $ note "0 2 4 7" #

This definition provides the ctrl, note and sus methods to control the ctrl, tune and decay knobs respectively

7 Likes

PS.: Should we start a repo for storing synth / midi devices / external device definitions for tidal? Is there enough demand for this kind of knowledge?

2 Likes

hey this is awesome!
me and my studio are working on this,
we are focusing work on Korg Volca machines,
and doing other experiments, happy to include
the TR8S for the rest of the community :slight_smile:

3 Likes

Looks good! Will add it there. I have a question though: why follow this pattern?

ccn :: Pattern String -> ControlPattern
ccn = Sound.Tidal.Params.ccn . (ccnList <$>)

Instead of using a map or something?