I tried the snippet myself and I'll give you my interpretation: since you are asking scramble to create 8 pieces from a 4-piece long pattern, it will fill the pattern up with some fictive steps of silence.
That is, the pattern to scramble might look something like n "0 1 2 3 ~!4"
And that is probably why I hear silence now and then when I play it.
(although I would love @yaxu to confirm or refute)
scramble 8 "a b c d" chop the pattern into eight parts, being the first half of a, then second half of a, then first half of b, second half of b and so on. Then you scramble them, and you will probably end up with two or more second halfs in a row, which will sound like a gap, because only the event starts actually trigger anything. You'll also end up with two or more first halfs in a row, which will sound faster.
One question: what is the highest value (i.e. probability) that wchoose can take on?
A side thing: I was quite sure that random generators were lazy i.e. they gave a number only when asked, but you say that they are continuous in their generation. What is the rate of generation then?
Aaah!
So the fact that I hear silence is just a byproduct of the length of the sample - if I had a longer one then I would be listening to the second halfs?
There's no real limit apart from the underlying haskell type which will be big enough. If you have two elements, one with '1' and another with 999999, then the first one would have a million-to-one chance of being picked.
There's one number for every possible point in time, counting from when the cycle counter started (usually when you start tidal, unless you use something like resetCycles).
Time in Tidal is infinite, both in terms of how long things can last and in terms of detail. So there are an infinite number of random numbers even in the first cycle.. So when I say continuous, I mean continuous.. We call these laptops digital computers but they can represent analogue things perfectly. Of course computer memory isn't infinite so there are some constraints
Hm this is tricky to explain. When I say first / second halves I'm talking about tidal events. This is a confusing thing with Tidal.. You chop up these events but it's only the start (onset) of the event that actually triggers a message to SuperDirt. So currently the second half of an event does nothing in a lot of cases.. Does that make sense?
Yes sort of.
I can then deduce there is a difference between e.g. chop and scramble - the former creates new Tidal events from a single event whereas the latter just chops the event.
If I take this example:
d1
$ scramble "<4 8>"
$ slow 2
$ chop 8
$ s "bev:1"
# legato 1
when the no. of parts to scramble equals the no. of parts in which bev is cut, 4 events per cycles are triggered - thus bev is now a series of Tidal events. Do I understand correctly?
About repeatCycles, is there a way to lock a cycle and mutate it on evaluation ? I tried with reapeatCycles 1 but evaluating the code doesn't change anything.
Also is there a way to include resetCycle in code (in order to do stuff like every 4 (resetCycle)
Last question, in the following code i can't get the octave offset working. Am i doing it wrong? :
timeLoop lets you loop the given number of cycles. There's not a straightforward way to play a different loop on each evaluation, but here's a complicated way:
do
x <- (toRational . floor) <$> randomRIO (0, 9999)
d1 $ timeLoop 1 $ rotR x $ n (struct "t(5,8)" $ irand 8) # sound "newnotes"
I can't get this code to evaluate without errors complaining that randomRIO is out of scope. I tried to import System.Random but it seems it is not allowed in Tidal... What is the trick to access randomRIO ???
t>: error:
Could not load module ‘System.Random’
It is a member of the hidden package ‘random-1.2.0’.
You can run ‘:set -package random’ to expose it.
(Note: this unloads all the modules in the current scope.)
It is a member of the hidden package ‘random-1.1’.
You can run ‘:set -package random’ to expose it.
(Note: this unloads all the modules in the current scope.)
OK by trial and error, I found that if I add :set -package random
at the top of BootTidal.hs and then reboot tidal then I can import System.Random with no error and then evaluate the do section.
@yaxu Could you pls hint why something like this does not seem to work. I'd like to select a bunch of samples for each option or select a bunch of sample folders for each option but I cannot get it to work.
d1 $ s (segment 8 $ choose ["[bd:1|bd:2|bd:3|bd:4]", "808", "hh"])