How to connect Tidal to MaxMSP

Normally, when you open up Tidal and start live coding you are connected to the SuperCollider based synthesizer SuperDirt.

The way the two communicate is through an Open Sound Control (OSC) connection – a handy protocol designed for sending sound-related data over a network (in this instance locally, within your computer).

This means that every time you “play a note” in Tidal you are sending off a bundle of parameter data – note values, duration, current cycle number, etc. – as a neatly organized data package containing all the information necessary for SuperCollider to setup and play a sound.

One of the many fantastic things about this relationship – where Tidal is in charge of the composition process and SuperCollider is in charge of the sound synthesis – is its modularity (and as such: hackability).

Practically, what this means is you can simply unplug Tidal from SuperCollider and plug it in to other environments – any environment, actually, that is able to receive data over OSC. One such environment is the very popular Max MSP.

Hello Max

Connecting Tidal Cycles and Max MSP is a very rewarding way of harnessing the power of Tidal’s pattern system to explore the immense possibilities of Max MSP. Using this method, you can set up Tidal patterns to control visuals made in Jitter, manipulate a Max MSP based synthesis engine / instrument or funnel the data to Max4Live (which I will show to do later on).

To get up and running, I have made a simple setup which can be downloaded from Github. It consists of three things:
1. A Haskell module (called MaxMspOsc) that defines the OSC connection to Max MSP
2. A very simple tidal example ( tidal-maxmsp-example.tidal ) that sends off a pattern of data
3. Max MSP project ( tidal-maxmsp.maxproj ) with a simple patch receiving the data from Tidal.

Inside the max patch

Once everything is installed, you should open up the tidal-maxmsp.maxproj. This is where you will receive the OSC data. Any of the standard tidal parameters are available as well as a few extra parameters defined in the MaxMspOsc module (see the dropdown on the right side of the patch which contains all of these custom parameters which are all float values of 0.0 to 1.0 for consistency’s sake).

At the top of the patch is a udpreceive object which is the network object that will receive the OSC data from tidal. It has one parameter defined, the port number, which is set to 8020 both here and in Tidal (you can change it another integer number as long as both Max MSP and Tidal are using the same port number).

Below it is an OSC-route object which looks for any OSC bundles with a url starting with /fromTidal and passes it on to the tidal-osc-parse abstraction.

If you double click the tidal-osc-parse abstraction you will see a small patch which has three inlets. The first is for the raw osc data from the OSC-route object. Inlet 2 receives the stream number (defined in Tidal) and inlet 3 takes the parameter name to look for. It breaks down the OSC message into pairs of parameters / values and looks for the one defined in inlet 3 and spits it out of it’s left outlet (and the raw message without any url at it’s right outlet).

Now, head back to Tidal and open up tidal-maxmsp-example.tidal. At the top of this file you’ll see an import statement for the Haskell module. Evaluate this line – if you don’t get an error, you most probably installed it correctly. Now evaluate max1 <- maxmspStream “127.0.0.1” 8020 1 and the last line to start sending OSC data.

If you head back to Max you should now see the values of the velocity pattern defined in Tidal now showing up in the float box in the bottom of the patch and all of the raw bundle in the message box.

That’s it!

Try connecting the float box to whatever Max MSP project you have, or if you want: Get more Tidal parameters by copying and pasting everything inside of the purple panel and changing the dropdown or message at the rightmost inlet of the tidal-osc-parse abstraction (and changing the tidal code accordingly).

Now, this is just a basic example which is not super precise in terms of timing. To get more precision we need to add time stamps/tags to make sure everything is played on time but this basic patch should get you started.

Elastic Tempo Flux

I just published a new tutorial video on how to achieve continuous, elastic tempo changes in TidalCycles.

The video covers techniques with two different functions: nudge and spaceOut.

nudge

You can use nudge to move the timing of events into the future. Here, we schedule each of the four cp samples with future times of 0, 0.7, 0.2, and 0.4 seconds, respectively:

d1 $ sound "cp*4" # nudge "0 0.7 0.2 0.4"

The above example isn’t very interesting. However, when you apply a sine function to nudge, you can make time appear to stretch in a smooth way:

d1 $ sound "cp*4" # nudge (slow 8 $ sine)

Different pattern densities, scaling, and sine speeds interact with each other to create different results:

d1 $ sound "cp*8" # nudge (range 0 2 $ slow 16 $ sine)

spaceOut

The spaceOut function lets you specify a list of cycle speed multipliers, and then plays the pattern exactly once at each speed:

d1 $ spaceOut [1, 0.5, 1.33, 0.1, 2] $ sound "cp*4 cp*2"

The above code will play the cp*4 cp*2 pattern at 1, then 0.5, 1.33, 0.1, and 2 times the normal cycle speed.

Where spaceOut gets a little more interesting is when you use Haskell’s list syntax to build longer lists of linear (or non-linear) values. Consider this spaceOut pattern that plays at speeds ranging from 1 to 3, incrementing by 0.1:

d1 $ spaceOut [1,1.1..3] $ sound "cp*4"

The above pattern has 30 different speeds (!) but with very little code.

You can achieve speed “oscillations” that resemble a triangle wave by adding two lists together with the ++ operator:

d1 $ spaceOut ([0.1,0.2..3] ++ [3,2.9..0.1]) $ sound "cp*4"

You can use many different Haskell features to build lists. Here is a different method that constructs lists of fractional values using map:

d1 $ spaceOut (map (1/) [1,1.5..10]) $ sound "cp*4"

TidalCycles and Processing

TidalCycles is close friends with SuperDirt but can be configured to send trigger messages to anything that accepts Open Sound Control network messages (or MIDI).

A while back I made a quick example of how to live code Processing sketch from Tidal. You can find an example sketch and tidal file on github. See what can be done with this sort of approach here:

Atsushi Tadokoro is doing similar things in Tokyo, I think with openframeworks.

Yecto has been working on this sort of thing for a while too, check out his spine-tingling sh2hs2 system.

Atom Package v0.11.0: custom Tidal boot path

A new release (version 0.11.0) of the TidalCycles package for Atom is available today. With this version you can now specify a path to your own boot file in the package settings:

This means that you no longer need to modify the provided BootTidal.hs file in the package with your own custom logic (e.g. custom functions, additional modules, etc).

If you want to create your own boot file:

  1. Create a copy of the original (available here)
  2. Save it anywhere on your computer
  3. Modify the TidalCycles package settings to point to where you saved the new file

Interview with Malitzin Cortes a.k.a. CNDSD

The second in a series of interviews with TidalCycles people, this one with the awesome Malitzin Cortes, who is based in Mexico City and performs music as CNDSD, including with SuperCollider and Tidal. Follow her on Twitter and Facebook, and be sure to check out her work on soundcloud, tumblr and vimeo. You can also read a pro interview with her en Español in Noisey.

Hi Malitzin, are there particular ‘strategies’ you have developed/collected for
using Tidal? e.g. combinations of functions you like to use together,
particular ways you like to twist patterns etc. Feel free to share
particular examples!

Personally, my knowledge about Tidal has grown, studying the guide on the website and experimenting with these codes, as well with tutorials, testing with my own sounds to the extreme, sometimes simple sounds work best to test and understand how some functions affect the sound.

An extremely seductive quality of the tides is the way of writing, in which I find the logic and emotion of the sequence that I am beginning to compose.
It seems to me extremely poetic, we can write with grammatical sense and algorithmic sense at the same time, some converters like superimposition or palindrome, to mention two, that, combined with iterations can create deep and complex sonorous experiences.

--- Example **

bps (180/120)

d1 $ slowspread ($) [rev, (|+| accelerate "-2 4 12"),
 (|+| coarse "12 24 6"), chop 20, stut 4 0.05 0.25] $
 foldEvery [2,4,6] (10.5 <~) $ slowcat [
 sound (samples "supernoise*4"(irand 8)),
 sound (samples "supergong*8"(irand 20)),
 sound (samples "superchip*4"(irand 2)),
 sound (samples "supersnare*4"(irand 40))]
 |+| unit "c" |+| speed "4"
 #gain "[[1.7 0.5]/2 [0.5 1.8]]*2 "
 |=| pan "0.05 0.75"
 #delay "0.5"
 # delaytime "0.04"
 # decay "0.1"
 # sustain "0.15"
 # room "2"

d2 $ palindrome $ superimpose ((# speed "8") . (2 <~)) $ sound (samples "[bassfoo*2 casio*8]/2" (irand 10))
 |+| unit "c" |+| speed "1"
 #gain "[[1.5 0.4]*2 [0.5 1.9]]*2 "
 |=| pan "-2 1 1 0.55"
 # n (toScale [1, 5, 7] " 1 3 3 -4")
CNDSD performing at Mutek with visualist Ivan Abreu (Photos: Leonardo de la O)

Or to phrase that question another way, what parts of tidal do you
feel drawn to most? Has this changed over time, are their
techniques/functions you explore in depth but then grow bored with?

In the beginning some options lead me to a rhythm more quickly and predictably, but then I found complexity in these same functions through combination with others, leaving the common rhythm behind.

Playing with different sound parameters, the tempo of a sequence of patterns can be extended and become a mass of sound that doesn’t seem to have an identity as a rhythmic pattern, although in the background it is still there!

On the contrary it is difficult for me to get bored, for the moment I don’t think I have reached 5% of the potential of Tidal, I’m always testing functions and combinations and when I do not write well (due to a bad syntax) I learn, and discover that the correct syntax generates new effects and behaviors depending on the number of samples or synthdefs used.

To what extent do you use the standard dirt samples? If you use your
own samples as well do you feel this is important in some way?

I think that as in every library of whatever : images, cats or sounds, there are some more beautiful and interesting that you can not just discard. The default library was the first door to understanding how Tidal worked and what potential it has since you start with the first pattern and by continuing to use it, you discover and understand (especially if you are not a programmer) how a function transforms the sound.

I began to get ideas and the frantic desire to experiment with other sounds.

Personally I keep sounds extremely clean and forceful of this default library and I have dedicated to create one, which is the identity of what I compose and of my music: recorded sounds, voice samples, midi and endless synthdefs.

How do you see the tidal community/communities in relation to the
tidal language?

The community is extremely important in the process of learning and understanding the use of Tidal, as well as in the personal search for a sound identity and to know the work of other people who use it.

Some extremely committed and brilliant people in technical matters (Mike Hodnick) have really supported me in solving doubts and understanding Tidal better, also you learn a lot from the questions of others and from all the deductions that can come out when answering these questions.

Sharing music from different parts of the world makes you understand the sound and music panorama more deeply, how these artists use the same functions to create completely different realities and sound personalities.

How does Tidal compare to other music-making activities/software you have engaged with?

Contrary to what you might think, for me Tidal is extremely friendly and when you go deeper, it becomes more abstract and free than other softwares that I really love and use to compose and generate sounds.

Now Tidal has become a place where I can experiment, improvise live and also compose, the latter perhaps in a not so orderly way, not because it’s not possible, but because it’s so free that you create your own rules.

How approachable do you find the Tidal community/communities, do you think there is a language/cultural barrier and/or do you think there are separate communities growing around Spanish language and/or locality in Mexico/America?

If your knowledge of programming and English is poor, at first it can be very confusing, this is my case, but the same programming has made me want to acquire a higher level of English in order to understand Tidal better.

I think that with the existence of translate tools the barriers are becoming smaller when there is an intrinsic interest, I would like in the near future to be able to translate and give workshops in which Tidal can be understood in Spanish very clearly if the level of English of the people concerned actually represents a barrier to delve into it.

There are people in Mexico and Colombia developing their own live coding languages and in general are very willing to share their knowledge and experience, in SuperCollider mostly.

How does Tidal influence your work, when you are using it do you feel like you are composing, improvising, exploring?

I think all three, in my process the experimentation begins in the pursuit of understanding, also trying to find how I want to sound.

After mixing sounds and beginning to compose patterns improvisation is extremely easy and natural in Tidal, when you begin to listen and you propose to direct the sounds and rhythmic complexities or textures is where the composition process begins.

What do you think Tidal is?

For me it is the music of the future, not only in Tidal, it’s algorithmic music itself, but without doubt Tidal has achieved many things in terms of simplification thanks to functional programming, allowing it to go far when it comes to live coding and improvisation in a few lines.

I would like Tidal have more things, but I know that it is the beginning of something tremendous, that allows us to take sound to places uncommon and to transgress the motricity in the music. It’s that search of sounds that seem impossible and are only possible in the computer, Tidal allows you to find an unimaginable panorama of combinations.

I think I have explored little and I always want to know more and especially ask myself questions about whether it is possible that what’s in my mind musically can translate into a reality .

and always surprises me and leads me to take all sorts of decisions.

Thanks Malitzin!