Tidal icon indicating copy to clipboard operation
Tidal copied to clipboard

Rapidly capture a cycle

Open sasha1sum opened this issue 4 years ago • 4 comments

feature I was hoping to be able to capture the current state of a cycle so that I can pick it back up later. This would be useful for ramping up into a fully defined A section, iterating into a B, and then dropping back into the A for a few bars. Kinda like a checkpoint or the ability to improvise around song structure on the fly.

The flow would be something like this:

-- define a cycle
d1 $ ...     

-- capture the current state in a variable 
chorus <- capture 1    

-- resume
d1 chorus                      

-- modify captured pattern  
d1 $ chorus # speed 2

Describe alternatives you've considered Right now I'm using different sections of with vim marks to jump back and forth but if I was using a different editor for some reason or just want to pin for a bit keeping multiple copies for A/B get complicated especially if I want to further modify the A and then go between A/A' or whatever else.

TL;DR I can replicate this with copy/paste but that is time wasted manipulating my buffer so that it a) grows unwieldy and b) is time wasted not changing the music similar to trying to rewire a pedalboard on the fly

Additional context I had a professor once who had an "improvisational orchestra". Part of that was him trying to capture the flow of improvisation as a conductor would for a traditional group. One technique he loved was "capturing" what everyone was up to by raising fingers like "ok, this is officially section 1". Then later, he would raise the finger again so we would all resume the previous pattern.

While this feature isn't flexible enough to "resume" the improvisation at a previous state, it would be enough to capture it on the fly and drop back in. Essentially being able to define a hook/lick/chorus on the fly and drop everything back in at once. I can figure out a method with editor marks to do something more advanced, but for one-offs this feature would be awesome! Add any other context or screenshots about the feature request here.

sasha1sum avatar Apr 30 '20 20:04 sasha1sum

a capture all would be nice too though I can easily do that with some kind of a do or mapM (not sure if anything is a monad, just guessing)

sasha1sum avatar Apr 30 '20 20:04 sasha1sum

Right now you can do it interactively with a few imports, but maybe this could fit into Stream.hs or the boot file as a new function to make it easier:

import Control.Concurrent.MVar

import qualified Data.Map.Strict as Map

capture i = do
  pMap <- readMVar (sPMapMV tidal)
  return $ pattern $ pMap Map.! (show i)

d1 $ s "bd sn:2" # cps 1

thing <- capture 1

d1 $ s "cp*4" # cps 1.2

d1 $ thing

bgold-cosmos avatar Apr 30 '20 22:04 bgold-cosmos

This code is working for me

For Stream.hs

-- not sure which empty is used in this file, should be Pattern.empty

streamCapture :: Show a => Stream -> a -> IO (Pattern ControlMap)
streamCapture s i = do
      pMap <- readMVar (sPMapMV tidal)
      let p = pattern <$> Map.lookup (show i) pMap
      return $ fromMaybe empty p

sasha1sum avatar Apr 30 '20 22:04 sasha1sum

@bgold-cosmos I was to busy typing my reply to see you finished it too :)

sasha1sum avatar Apr 30 '20 23:04 sasha1sum