Showing posts with label Chord sequencer. Show all posts
Showing posts with label Chord sequencer. Show all posts

Friday, 14 December 2018

TR2gen Revisited - resulting in a Probabilistic Chord Utility for Ableton Live

In 2017, I published a free two-step, two-bar triad generator that made simple chord progressions very easy to produce, and the main feedback was that people loved it and wanted more steps and more chords.

After thinking about this for a year, and having produced lots of devices that utilise probability (the 'Probably' series), then I came up with a way of extending TR2gen into something that included 'more': and it is called ProbablyCHORD.


ProbablyCHORD

ProbablyCHORD takes a lot of inspiration from ProbablyR, the latest monophonic sequencer in the Probably series - it has the same style of probabilistic grids, the same generative control, the same separation of notes and octaves,  and the same rainbow colour coding of sections (which seems to be becoming fashionable in commercial plug-ins too!). Underneath, the core is TR2gen, expanded and with new features to make it more flexible, more powerful, and more powerful. In summary, the same but 'more'! (And still FREE!)

The 'elevator pitch' goes something like:

'ProbablyCHORD is a free multi-step, clip-event triggered, generative and probabilistically controlled chord generator plug-in device for Ableton Live, implemented in MaxForLive.' 

It can be thought of as the 'chord' companion to the 'melody' ProbablyR sequencer. (and any following devices in that series...)

Although it looks very simple, there's actually a lot going on, and you need to do some setup before ProbablyCHORD will work properly when you first use it. So the following instructions are deliberately detailed so that you get familiar with how it works and what it can do for you.

(I probably need to warn you that music theory is not my strongest skill set, and so some of the stuff on chords that follows may not be 100% correct...)

From left to right, the sections are:


Root and Control

The top part of this section is the 'Octave' grid. The two default 'white' (which can also mean 'highlighted with the vertical scrolling colour bar') cells mean no transposition - as indicated by the +2...-2 labels on the right hand side of the section. If you click on any of the cells above or below then you will get a new white cell for that step, and a note will be generated when the sequencer reaches that step - or rather, the note that is output at that step will be either of the notes represented by the cells that are white. So if the '-1' cell and the default '0' cell are both white, then half of the time the root note will be produced, and half of the time a note one octave down will be produced.

At the bottom of the section are two slightly larger white boxes that control the root note - and they default to white. As the sequencer steps through, the coloured bars scroll across each grid - in the screenshot above, step 1 is playing, and so the root note white box is highlighted in red. If you click on either of these root cells so that it goes grey, then the root note will not play (even if you have a white 'octave' cell in the octave grid above). The Octave Grid is always over-ridden by the note grids in the lower pat of each section.


The big number selector in the centre of this section is the Step selector. In the screenshot this is 2, which means that there are two steps in the sequence. To the right is another selector, which shows 'A' for automatic - this controls the note length, and can be fixed (to a variety of values: 1 = short, 9 = long) or automatic. Automatic should be fine for your initial explorations...

The 'Step->' button advances the sequence by one step each time you click on it, and causes notes to be generated so that you can hear the result of adding white cells to the grids. ProbablyCHORD doesn't use Live's timing directly, but instead it uses note events in clips to tell it when to generate a chord, and how to pitch that chord. So one of the first tasks is to generate a clip that has four monophonic notes on beats, in the track that ProbablyCHORD is in.


Here's probably the simplest clip contents: four C1s on the beats, and a very boring chord progression. I would recommend leaving John Coltrane's 'Giant Steps' for a little later on! Note that the pitch of the notes on the grid transposes the chords, so this clip will cause C1s to be played as the root of the chords that ProbablyCHORD produces. You could try changing the notes and see what happens... Remember that this clip MUST be monophonic: one note at once!

Once the clip is done, then starting the clip should move the vertical colour bars across the grids in ProbablyCHORD, and depending on what white cells are present in the grids, and assuming that you have added an instrument after ProbablyCHORD, then you may get some notes. By default you should get the root note from the 'Root' section. A 'piano' type sound is good for the instrument that you have in the track, although I have a personal weakness for using cello sounds for chord progression development. What you should notice is that although there are four notes in the clip, there are only two steps in the sequence, and so ProbablyCHORD will repeat the steps twice for each repeat of the clip.

If you go to the 'Step' selector and choose '4' steps, then the number of notes in the bar will be the same as the number of steps, and so they will be kind of aligned, although not necessarily starting at the same time. You can click on the left circle just above the root note grid to advance the step sequence (same as clicking on the 'Step->' button), or click on the right circle to restart the sequence from step 1. The left circle will also flash with each step... I'm still trying to refine the synchronisation of the start of the step sequencer, and making it more controlled is one of the goals for future releases.


Whilst your attention is on the clip, you might like to try naming it with a number, and restarting the clip to play: '1' is a good value to try. At the very top left corner of this section is a letter 'N' or 'C' - this is a toggle button that controls how clip names affect ProbablyCHORD. If 'N' is displayed, then the clip name (which must be a number) will select the step sequence that ProbablyCHORD will play. So the number immediately below the 'N' (or 'C') is the current step sequence number, and the square below this are the step sequence memory slot buttons. In the screenshot above, the clip named '2' is playing, and so memory slot number 2 has been selected. (shown by the number 2, and the white highlighted memory slot button) If you don't put a number in the clip name, then nothing will happen - although you can always click on the memory slot buttons to recall a memory, of course.


To store the settings in the grids in ProbablyChord into a memory slot, then you just shift-click on one of the memory slot buttons. Empty memory slots are dark red. Memory slots with saved grids inside them are grey (or gray). The currently recalled memory slot will be highlighted in white. If you save to a memory slot then you will lose whatever was in there before you saved! Finally, at the lower left hand side, below all the memory slot buttons, there is a dark red button with 'X" on it. This CLEARS all of the memory slots - they will go dark red and will all be empty. Use this with care - it is a good idea to use this 'clear' function when you first use ProbablyCHORD in a track, and then once you have stored a step sequence in a memory slot, you should save your Live Set, which will save the memory slots as well.

First Octave


I'm calling the octave above the Root note the 'First Octave', mainly because there's another octave grid higher up, which we will come to later...

As with the Root section, the upper part is for octave grids, and the lower part is for note grids. In this section, there are three pairs of grids: one for each note that we add above the root note in a chord. So in the screenshot above, the root section is playing the root note, and this is transposed based on the note that is in the clip. So in the clip that was shown earlier, the root will be C. In the octave above that C, the grid with the orange scrolling bar plays a note above the root, and the 'yellow' grid plays another note above the root. So the combination of the root section, plus the first two grids in this first octave, gives us a triad: the root plus two other notes. The third grid in this section is for any extra note that you want to have above the root, and remember that the note grid over-rides the octave grid, so if there aren't any white cells in the note grid, then no note will be generated, regardless of what the white cells in the octave grid might suggest.

The note grids in this section are numbered as intervals from 1 to 8, where 1 is the note above the root (which is zero (0)), 2 is a 'second' interval, 5 is a fifth, etc. So the dark gap between 2 and 3 is a flattened third, or a sharpened second.


If we look at the orange grid, then there are two white cells: the first step has a white cell in the third, and the second step has a white cell in a flattened third. The yellow grid has a white cell in the fifth for the first step, and a 6th for the second step. If we look at each step in turn, then the first step has the root, plus a third, plus a fifth - which gives us a major triad, and if the root is C, then it is C Major.


For the second step, then the root is the same,  but the third is flattened, and you would normally expect a fifth to give a minor chord, but I have changed the interval to give a Minor 6 chord without the fifth, which I like the awkward jarring sound of, but which isn't going to be to everyone's taste. If the fifth was present in this second step then ProbablyCHORD would be producing exactly the chords that TR2gen would produce when playing a Major/minor sequence, but ProbablyCHORD has no such imitations, and this illustrates that you are free to do whatever you like with making chords.

This also illustrates an important part of the design of ProbablyCHORD. What happens if the clip looked like this instead of just repeated C notes?


With this clip, then the root for the first step is C, but for the second step then it is D. So although the layout of the notes looks like it is in the key of C, this is just to make entering chords easy, and it also keeps the graphics from becoming mind-bendingly complex. All you need to know is what intervals make up the chords that you want to use, and you then enter them in the key of C into the grids. The clip then sets the root note, and so whilst the first step produces a C Major chord as before, the second step now produces a D minor 6 chord. (or a D Minor if you have used a fifth instead.)

ProbablyCHORD thus enables you to enter chords easily, without needing to know anything more than the intervals that are inside them, and the clip the sets the root. Ordinary triads are going to have the same thirds, flattened thirds and fifths, and they are always going to be in the same place on the grid, because the clip will cause the transposition of the root. The output of ProbablyCHORD is not just what you see in the grids - it is a combination of the grid plus the transposition in the clip.

Because this simplifies the entry of chords, I have resisted the temptation to provide a drop-down menu that inserts pre-prepared chords into a step (there are plenty of apps that do this already!). The simple entry of intervals enables you to concentrate on the sound of the chords, instead of the names, and the clip transposition means that you never have to think about the structure of chords in any key other than C. If you want to look up the structure of chords in books, then feel free to do so and put their intervals into the grids - there are a number of useful low-cost apps for mobile phones and tablets that can provide the same information in electronic form.

The third grid in the first octave is green, and could be used to add additional notes to the triads - sevenths for example.

Second Octave


The second octave is two octaves up from the root, and can be used to add notes with intervals like 9ths, 11ths and 13ths.

There's a tiny little 'X' button at the lower right of this section. This clears all the grids, and is probably something you should click when you first start up ProbablyCHORD...

Probability

Up until this point, the grids have been used to produce single notes, but these are probabilistic grids! If there is more than one white cell in a vertical column, then the probability of that white cell causing a note to be output is distributed across all of the white cells. If there are two white cells in a vertical column, then each will occur about half of the time, on average - the actual choice happens randomly. If there are three white cells, then each possibility happens about a third of the time...

If we go back to the original 4 sep clip, and change the steps to 4, then ProbablyCHORD and the clip are in bar sync. Let's add some white cells to the note and octave grids in the first octave section, and see what effect having more than one white cell in a vertical column actually has on the output.


For the orange grid, then we have a third in the first two steps, followed by flattened thirds in steps 3 and 4 (so suggesting a major chord followed  by a minor chord), and there is only one white cell in each vertical column, so the output will always have these notes at these steps. But for the yellow grid, then steps 1 and 2 have fifths or sevenths, and steps 3 and 4 have fifths or 6ths. So for steps 1 and 2, we will get either a fifth or a seventh to accompany the third, giving either a Major chord or a 'kind of' Major 7 chord (without the fifth). For steps 3 and 4, then the output will be either a fifth or a 6th, and so the output will be either a minor chord, or that minor 6 chord that I like again.

But don't forget the octave grid for steps 3 and 4 in the yellow grid. There are now two white cells in the vertical columns: one in the default cell, but two more in each column for the -1 octave transposition. This means that at random, the notes in steps 3 and 4 in the yellow grid will be transposed down by one octave - about half of the notes in any time period will be one octave down, and half will not be affected. In terms of what this does to the chord, then it gives an inversion of the chord - the fifth or sixth notes in the yellow grid might be transposed an octave down, below the root note. You could put similar 'inversion controls' in the orange octave grid if you wanted, and this would allow you to control when the thirds were transposed, giving other inversions. In other words, whilst it may be called an 'Octave' grid, it is actually used mainly to control inversions of the chords. If we think back to TR2gen, then that had a much simpler control that didn't give this degree of flexibility.

More clips

Up until now, the clips have been very simple, but ProbablyCHORD just uses them as events that control the transposition, and so you aren't limited to straightforward 'on the beat' notes, nor are you limited to simple transpositions. Here are some other possible clip contents:


This clip has F as the root for step 1, C# as the root for step 2, B for step 3, and finishes with D for step 4. If the grids were set up with a simple two steps Major, two steps minor sequence, then this would give an output of F Major, C# Major, B minor and D minor.


This clip has twice the number of note events in the bar, and so the output of ProbablyCHORD will be at that rate, so a 4 step sequence will play twice per clip bar. The output chords will jump up and don by octaves every two notes.


Not quite a Coltrane cycle, but this clip runs through five different roots in the bar, and with the 8 step sequence in ProbablyCHORD, then this clip will also trigger two runs through the sequence per clip bar.


Finally, let's throw away 'on the beat' timing, and trigger the chord generation in a somewhat less 'dance-floor friendly' way...

Velocity

Ableton Live's factory device called 'Velocity' is very useful for manipulating the velocity of MIDI notes (an under-utilised function of Live, I would say...). You can put the Velocity device between ProbablyCHORD and the Instrument that you use to make sound...


In the screenshot above, I have deliberately compressed the MIDI velocity values so that the Cello Section has lots of drive, and to provide 'voicing' of the chords I have added randomness to the velocity values. The SoundCloud demo uses a variation of this setup, with LFOs driving the articulation. 'Three Steps from L(ive)' territory, in some ways...

Comparison

How does ProbablyCHORD compare to TR2gen? Well, here are the controls for TR2gen mapped onto two-thirds of the first octave grid in ProbablyCHORD:


The above screenshot shows the default TR2gen 'inversion' settings - which produce no inversions at all, when the R, 3 and 5 buttons are all highlighted. The 'MAJ' button is like the 3rd white cells in steps 1 and 2 of the orange grid, and the 'min' button is like the flattened 3rd white cells in steps 3 and 4 in the orange grid.


The '- button produces inversions where the Root, third and 5th are transposed down by an octave, and these are like the white cells in the octave grid. Only the mappings for the 3rd are shown here to keep things simple. The octave grid in the yellow grid controls the inversions for the 5ths.


The '+' button is for inversions where the Root, 3rd and 5th are transposed up by an octave. The equivalent in ProbablyCHORD is again the octave grid, and once again, only the thirds are shown.


The'+-' buttons in TR2gen control inversions where the transpositions can be up or down by an octave (or no transposition at all). This is like having white cells up and down an octave in the octave grid in ProbablyCHORD.

Note that ProbablyCHORD provides extra control over the transposition of the notes, so you can have an inversion mode that is not possible in TR2gen, where the notes are transposed up or down an octave with 50% probability - this is done by removing the white cells in the middle '0' default row in the octave grid, and only having white cells in the +1 and -1 rows. Also ProbablyCHORD allows notes other than the 3rd and fifth to be added to chords. Finally, ProbablyCHORD can have steps other than 2! Up to 9, in fact. (although the gird is quite small when this is the setting...)

Inversions

At the risk of too much music theory, here are some screenshots of the various inversions for a basic three note triad:


The basic Major triad has the Root, the 3rd and the fifth. This is the default, with the 'Octave' grids all showing just the middle position, and so the chord is exactly as defined by the note grids, and doesn't change. A little bit repetitive..

ROOT




The three screenshots above show the Root section (Red) with the octave grid rows for +1 and -1 filled in with white cells. The three shots show: the basic chord with the root not transposed; the root transposed one octave up, and the root transposed one octave down. With these settings, each of these chords will be equally likely, and so each will happen about one third of the time, on average.

THIRD




The above three screenshots show the orange grid, which has white cells in the note cell for the 3rd interval, so this is making the middle note of he basic triad. The octave grid has +1 and -1 white cell rows added, and the three shots show the third in: the normal position; one octave down; and one octave up.

FIFTH




The above set of screenshots show the yellow grid, which has a row of white cells producing a fifth interval in the output chord, corresponding to the fifth in the basic triad. The octave grid again has the +1 and -1 rows filled with white cells. The screenshots show: the basic triad with no inversions; the fifth transposed up one octave; and the fifth transposed down one octave. As before, with these settings, each of these chords will occur with about 33% probability on average, over time.

Finally, here's a shot of all of the possible notes that can be produced using if the octave grids for these three notes are all set to +1, 0 and -1. In reality, only particular sets of three of these notes will ever sound at once - this is a composite of all the possibilities:


Determinism

ProbablyCHORD tries to abstract a lot of detail behind what looks like a very simple user interface (like forcing everything to be rooted by a 'C' that can be any note, or making it event-driven instead of being tied to repetitive timing), and the idea behind making almost every control probabilistic via the grids is to introduce variation and unpredictability into music. But if you only put one white cell into a vertical column, then you are in direct/unambiguous control of that parameter - it becomes deterministic. So whilst you can use ProbablyCHORD to generate music with randomness inside it, you can also use it to generate exactly what you want, without variations, where it plays the same every time.


Here's an example of using ProbablyCHORD purely as a deterministic chord generator. Can you figure out what famous piece of music these are the first four bars of?

ProbablyCHORD

That completes this quick introduction to ProbablyCHORD. I hope that you can understand what it does, and how it does it! Most of all, I hope that you can see how it might help you to make music by allowing you to explore chord progressions with minimal effort and yet have a lot of flexibility.

You can find an example of ProbablyCHORD driving a simple Instrument Rack inside Ableton Live (I love using LFOs to control articulation, and I often use the 'Velocity' MIDI effect for adding random velocity so that the voicing of the chords varies) on Soundcloud.

I am preparing videos showing ProbablyCHORD in action.

Getting Probably Chord

You can download ProbablyCHORD for free from MaxForLive.com.

Here are the instructions for what to do with the .amxd file that you download from MaxforLive.com:

     https://synthesizerwriter.blogspot.co.uk/2017/12/where-do-i-put-downloaded-amxd.html

(In Live 10, you can also just double-click on the .amxd file, but this puts the device in the same folder as all of the factory devices...)

Modular Equivalents

In terms of modular equivalents, then reproducing this functionality in my modulars seemed like it should be simple, because all it requires is a 9-step sequencer and some logic, but coding up all of the logic isn't as easy as you think, and quickly eats up modules, and you rapidly get to the point where you want to step outside of the 'basic modules only' rule and go into custom programmable specialist modules. So my estimate is that full functionality is going to require a step sequencer, clock source, a random generator per grid, and then a couple of utility logic modules per grid, which quickly gets us to about 20 ME.

Buy me a coffeeBuy me a coffee


Sunday, 30 July 2017

Probably - an antidote to step sequencers...

I've always loved step sequencers. From the ARP Little Brother, to my own modular synths, 8 or 16 step notes metronomically repeated ad infinitum has always been part of my synthesis toolkit. But there's always been a tiny nagging voice whispering in my ear, and recently, I decided to listen to it and see where it took me. The voice told me to break the four rules:

The Rules of Step Sequencers

- Each step is one note.
- Each step has the same length note
- Each step has a find common velocity
- Each note always plays

So MIDI Probably gleefully breaks them! Each step in this M4L add-on can have from one to 13 pitches, spread over an octave. If you have one pitch, then the note played is that pitch. If you have two pitches, then each one will play, on average, for half the number of times that the sequencer loops round. Three notes get a third each. Four notes get a quarter, etc. Just probability really. There's a random number generator inside, and it decides which of the choices that are specified gets to control that note event.


There are four grids that are used to control Probably. From left to right they are:

Pitch, which is arranged paint roll style just like Live. Higher pitches are higher up the screen, lower pitches are lower down the screen. You get a black and white guide to show where the notes are. One octave may seem a bit limiting, but Probably accepts incoming MIDI notes as transpose settings, so you can transpose the playing sequence live with th computer keyboard, an external MIDI keyboard, or a session clip (if you make the session clip several bars long, then you get a transpose sequence that drives Probably...).

Probability, which sets the likelihood of a given step actually playing. The top row is 100%, where the note event always plays, whilst the lowest row is 0%, where the note event never happens. If you put a white square in the top row and the lowest row by clicking on the same step, then you get a 50% probability of that note event happening. If you replace those two square with one in the middle, then you get 50% as well. But if you add a lower square at 25%, then you get half of the notes playing for half of the time, plus a quarter of the notes playing for half of the time. If you have a square in the top, lower and 25%, then each gets a third of the time, which is 100% (33%), 0% (0%) and 25% (8.1%). Don't bother too much with trying to understand the maths: the more and higher the squares you fill in, the more likely it is that a note event will play.

Velocity, which sets the velocity for each note event. Again the top row is maximum velocity (127), and the lowest row is minimum velocity (1). Selecting specific squares gives fixed instances of velocity, whilst selecting a range of squares will give a range of velocities - each chosen at random. Single squares give fixed velocity. So you can have notes on the beat have fixed high velocity, whilst notes off the beat can have lower random velocities to add interest, or the opposite, or any other scheme you can think of.

Length, which sets he length of the note events. Each note event is independent, so if you want to have steps where the notes are longer than the step interval, then you can have them, and so you get chords instead of single notes. Each note can have its own length, and act length can be randomly chosen from a range or set of values. You control the values, and the randomness just make the choices.

If you've never played with a step sequencer that allows control over the length of notes (from staccato, to legato, to overlapping chords), or one where velocity is controlled random choices, the you are in for a treat!

Startup

When you add MIDI Probably to a track, then it starts up in a weird default:


This isn't very useful, and the first thing you need to do is compensate for my laziness in not writing the code to create a sensible default. Here's my suggested starting point:


This has a rising arpeggio for the Pitch grid, a top row full of 100% for the Probability grid, Maximum Velocity, and 16th demis for the Lengths. You need to provide a Pitch reference for the transpose, so arm the track, and play a note on the computer keyboard, on your external keyboard, or in a clip (which could be a slow, multi-bar transpose map for people who love circle of fifths etc.) Playing this gives a simple 8 step sequence:  


Well, nothing spectacular so far!

So let's draw in the opposite arpeggio:


Running this gives a rather more interesting result. You get each of the pairs of notes in each of the columns, selected at random. Every 16 bars or so, you stand a reasonable chance of getting all f the possible variations of each of the two arpeggios. Here's some of the output:


That word 'variations' is very significant here. Two notes have been specified for each of the 8 steps, and Probably dutifully selects at random from each of those pairs, and eventually will play every combination of the notes. The result sounds like someone learning jazz improvisation based on a scale, and most people assume that there's huge amounts of processing behind it... You might want to keep quiet that there's actually just a very simple grid, and probability does all the rest.

The red lower portion of those piano rolls shows the usual boring velocity values of 127, so lets put some ranges into the Velocity grid:


The first note in the arpeggio, plus the middle one, have single velocity values, so they will always play at maximum velocity. The remainder in the first half get quieter on average, and the second half hey get quieter still. There's still a chance that you will get all of the notes at the maximum velocity, but it might take a long time to get to it. Here's a capture:


Notice that the notes are different from the previous example. Not only re the velocity values being chosen according o the white squares for each note, but each note is independent, and so the sequence of jumping between two arpeggios that we got the first time, is different this time. This is randomness, not repetition.

Let's add a bit of control over the Probability, by making the off-beat notes less probable. (This is kind of emulating what real human players tend to do in some circumstances...) And the Length is now set to choose from a range of possibilities, but set exactly the same for each note event (painting across all of the columns is easy, but boring - I prefer the individual control against time that is shown in the probability and velocity grids). This gives us a sequence which has lots of variation across multiple parameters:


...and the result starts to look and sound quite interesting:


There's not very much range to the velocity or the length, so let's increase the amount of white squares and give it a few more pitches to play with:


Which gives us this output:


Now, does this look like a piano roll generated from a few simple choices on a few grids to you?

Lets try a different pair of arpeggios, and make those Lengths a little longer:


Resulting in:


Remember that this is produced by a step sequencer...

Instead of arpeggios, lets's constrain the choices to just a few notes from a scale, and see what happens:



 And let's try making the available note choices much sparser, and make the length of the notes (and the probability) dependent on where we are in the bar:



I'm afraid to say that when you add a piano instrument to the track, this gives results which sound pretty much like a reasonably competent player randomly noodling on the piano. All you need to do it capture it to a MIDI track, and then select the bits you like: either for inspiration, or just 'as is'.

To capture the output of Probably, you just create a new MIDI track, setts input to the output of the track with Probably on, and then use the Session Record button to create a new clip with the output of Probably. (I call the Session Record button the 'new doughnut', because it is a circle next to the 'NEW' button, and it goes red (I think of it as brown) when it is recording).

Notes

When you first insert Probably into a track, you need to provide a note. If you don't, then the transpose function will think you want to transpose way down at the bottom of the MIDI range. Because of the way that Probably works, you also lose the lowest C (C-2) from the output. Sorry. 

And that's MIDI Probably, a kind of 'antidote' to the usual M4L step sequencer. Enjoy playing with randomness!

As always, you can get MIDI Probably from MaxForLive.com