Ok I've made another video, and although we're not supposed to start until Saturday there's no point holding this back!
It's aimed at people new to live coding, and goes through the basics of how to interact with Tidal - starting and stopping code and so on.
Look at the video description to jump to different parts, and switch subtitles on if I'm speaking too fast.
Again any questions or feedback about this let me know. Please let me know if you'd prefer it edited down, with the "um"s and "ah"s taken out, and I can experiment with that. Longer term I'd prefer to spend time making videos than editing them, but if it would be an improvement I'd be very happy to pay someone to do it from the pay-as-you-feel-wall cash.
To be honest, there are some very heavily edited videos out there where they not only delete every āumā, āahā but also most of the breaths and gaps between words; I usually find those very irritating and artificial. This video looked good to me!
Great video!
I've been introduced to programming using languages with no significant white space, so I usually get tricked by indentation when interacting with Tidal
I don't know if this is the right time to ask but I'd love to see some tips to get indentation right, maybe in a future video
You could try to toggle invisibles and toggle indent guide from the command palette in atom to have a visual cue of them. There are some packages as well that color the indent guides so that you can see when youāre inside an indent block in your code. Hope that helps
Good questions, Iāll do a proper, detailed breakdown of this very soon. In brief though you can think of d1 as a connection to (super)dirt. $ separates a function (in this case d1) from an input (in this case the pattern youāre passing to it, sound "bd sd"). Without it, d1 would only receive the sound, and the "bd sd" would be left dangling. An alternative is to use parenthesis like d1 (sound "bd sn"), that works but that can fiddly matching up the opening and closing brackets, when the pattern gets more complicated.
"bd sd" is a pattern of words, sound turns it into a pattern of sounds, and $ makes sure that happens before itās given to d1, which then generates events from it to send to superdirt.
The dollar is Haskell syntax, and is probably the hardest thing to get your head around with Tidal. It takes a while before it āclicksā, but the good thing is that it really doesnāt much harder than thisā¦
One thing I now find quite weird with the $ is that in your description it seems to do 2 different things at once. 1. Ā« separate a function from an input Ā» (ok) 2. sort of replace parenthesis, which seems quite different. Especially, how does the $ Ā« knows Ā» where the virtual parenthesis ends ? Why is d1 $ sound Ā« bd sd Ā» correctly understood as d1 (sound Ā« bd sd Ā») and not, say, d1 (sound) Ā« bd sd Ā», with the Ā« bd sd Ā» left dangling ? Is it because the $ does something like Ā« everything on my right is one input, stretch the virtual parenthesis till the end of that line of code Ā» ?
Not sure I am clear in my confusion !
Yes itās strange. I suppose you can think about the parenthesis here d1 (sound "bd sn") as separating the input sound "bd sn" from the function d1 too.
Or maybe itās easier to think about changing the order of how things are āworked outā? Itās the same as in arithmetic, (1 + 2) * 3 gives a different result (9) from 1 + (2 * 3) (which equals 7). Without parenthesis, 1 + 2 * 3 would equal 7, the same as the latter, because thereās an arithmetical rule that * takes precedence over +.
It might also help if I explained what $ actually does. Just like +, itās an inline operator. It takes two inputs, a function (on its left) and an input to pass to that function (on its right). Then it passes that input to the function and returns the result. This is its entire definition: f $ x = f x. Thatās it! Itās so simple that itās difficult to understand. Itās almost like itās doing nothing at all.
Pretty much the only thing that makes $ useful is that (just like +) it has very low precedence. In fact I believe it has the lowest possible precedence. This means that anything on its right hand side will be āworked outā first, before it gets hold of the result, to pass to the function on the left.
Does that help? Probably notā¦ But donāt worry, weāll work with lots of examples and the usefulness of $ with slowly become clear.
YES, this very much helps. Itās been about a year since Iāve touched tidal and this is the kind of stuff that really helps when youāre first fiddling around or coming back to it. Otherwise, I find myself āexperimentingā in a bad way ā i.e., doing stuff and having no real grasp of whatās happening.
Understanding how the functions and controls, etc. interact is pretty crucial ā at least Iāve found it to be. Thanks for this.
Execute them one by one with Shift-Enter and watch the output in Atomās status window at the bottom:
t> "eijlumoronuki"
t> "eiijklmnooruu"
Note how in the first example (lacking the $) the sort function applies only to ājulieā and āmoronukiā is simply appended, while in the second example (including the $), ājulieā and āmoronukiā are concatenated before the resulting string ājuliemoronukiā is finally sorted.
import Data.Char -- package providing "toUpper" to make a single character upper case
uc xs = [ toUpper x | x <- xs ] -- our own function "uc" to make a string all caps
uc "julie" ++ "moronuki" -- uc is applied only to julie, moronuki is added after the fact
uc $ "julie" ++ "moronuki" -- uc is applied after julie, moronuki have been concatenated.
Result:
t>"JULIEmoronuki" -- uc is applied only to julie, moronuki is added after the fact
t>"JULIEMORONUKI" -- uc is applied after julie, moronuki have been concatenated.
Thanks @loopology. Itās worth noting though that this example is for working with lists, and Tidal isnāt based on lists but functions. So, in case anyone is wondering about the syntax here with ++ and <- etc, youāre unlikely to need that for tidal, so donāt worry about it.