Showing posts with label Randomness. Show all posts
Showing posts with label Randomness. Show all posts

Tuesday, 24 April 2018

Irregular timing in a MaxForLive LFO...

Previously I have described the design of ProbablyLFO, my 'alternative' LFO for Ableton Live, built using MaxForLive. Since the first release, I have gradually added extra timing sources, and until now, these have all used the MIDI input so that the LFO timing was driven by MIDI notes in the clip. "Genious" was how one user described the use of MIDI note events to drive an LFO...

But recent experiments with Max's 'random' and 'metro' objects have resulted in a new timing mode that extends the functionality of ProbablyLFO in another direction. I have added a timing source that uses the 'Free' mode asynchronous oscillator but uses that to drive a noise generator that clocks the LFO probability grid. The result is an LFO that doesn't output the waveform at a regular rate, but it kind of jerks along across the grid. By altering the 'Smooth' control you can calm it down or make it more jagged, which aren't the kind of words that you normally see used to describe an LFO...


As with all the other timing sources, there is an indicator 'light' that shows when that timing source is generating a clock. The rate of the 'Noise' timing is the same as the 'Free' mode, which wasn't easy to achieve - I had to make two 'metro' objects running at different rates in order to keep the rate the same, and I have to admit that I cheated and set the parameters experimentally, rather than doing the maths. Entropy and probability ain't my strong points. 

So what does this give you in terms of control? Well, conventional LFOs output a waveform where each cycle takes the same time, and the shape of that waveform tends to stay the same - so a sine wave always has the same shape, a sawtooth is always a sawtooth... By using random noise to time the movement across a grid that controls the waveform, ProbablyLFO lets you have waveforms that can vary per cycle, and that have an average rate rather than exactly the same time for every cycle. Depending on what the random noise does, some cycles might be short, while others might be longer, and the progress across the grid can vary within the cycle. 

Let's look at the output of an unsmoothed sawtooth from ProbablyLFO with 'Free' timing:


So the sawtooth is the same each cycle, and each cycle takes the same time.

And now, the output with the same unsmoothed sawtooth with 'Noise' timing (several examples):






As you can see, cycles vary in their length, and the ramp isn't a nice straight line any longer because the progress across the grid is driven by random timing. The only thing that is the same is the average rate - over a long period of time, the same number of cycles will hap[pen as in the first sawtooth example.

( Note that this is using a fixed waveform in the grid. ProbablyLFO's grid allows you to set the probability of different outputs, and this isn't being used here - this is just the 'Noise' timing. ) 

Musically, this gives you an LFO where the parameter you are controlling does not change repeatedly with exactly the same timing and waveform. Instead you get a much more variable timing and output - less metronomically predictable...

Downloading MIDI ProbablyLFO 0v06

You can download MIDI ProbablyLFO 0v06 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



Buy me a coffeeBuy me a coffee




Sunday, 22 October 2017

ProbablyS tutorial - using the newly added memory sequencing

Probably was my first attempt at an 'antidote to step sequencers' - a simple monophonic step sequencer that took a different approach to step sequences by adding probabilistic control over events, as well as legato note lengths.

ProbablyZ added extra time features, a well as separating the octave transposition from the notes in an octave. The controls that you get over time allow probabilistic control over time-warping, which isn't a common feature of sequencers...

Since I first released ProbablyZ, I have fixed the state memories (the little grey squares)(thanks to Cory at Ableton for his help on this!) and improved the sync with Ableton Live's transport. Whilst I was fixing the memories, I tried out one of my further extension ideas, and this is now ready for release...

ProbablyS (available from MaxForLive.com)

ProbablyS adds extra control over the state memories. There are now 12 'State' memories (each grey square can save the state of all the grids to the right - just Shift-Click in one of the grey squares in the black 'Memory' section). To recall a state then just click on the grey square, and it will turn white.

The 'Memory' grid on the left of the vertical bar of memories allows you to sequence thee. Each row corresponds to the associated memory on the right, and so if you set all of the memory cells to the top row only (white cells all along the top of the grid), then ProbablyS will play back just the state stored in that memory. Here's an ASCII text illustration of the layout:

State Grid  OOOOOOOO []  State Memory
            OOOOOOOO [] 
              ... 

The default setting for the state grid should be similar to the basic setting for the other grids - a horizontal line o white 'cells'. (As with the time grid, the 'cells' are round, not squares...). Time scans horizontally across the cells - and this is shown by a darker cursor line.


If you set the 'repeat' to 1 and the length to 2, and set the second grid position to a different memory, then the memory grid will cycle between those two memories. If you set the 'repeats' to 4, then each memory will play for four times, before moving to the next memory. If you set the 'length' to 8, and the 'repeats' to 8, then it will play each memory 8 times.


The two screenshots above show the 2nd and 8th stage of the 8 step state sequencer (which drives the underlying 16 step grids). The 2nd stage is playing the top memory (see the white square in the vertical memory bar in the 'Memory' section?), which has a very simple set of grids, whilst the 8th stage gas chosen one of 9 possibilities, and has chosen a memory four steps lower, with a much more complex set of grids controlling the output.

As with all the other grids in Probably, you can have more than one white cell in a vertical column, and the choice between the two cells will happen at random. This means that you now have probabilistic control over which memory is playing at any time.

(I'm still working on providing a separate way to store the 'State' grid - and I may provide a preset state in the next version, plus some new functions...)

Looking at just the state grid (plus the time grid so you know where the new Memory section is positioned):


The first two stages (which could each be from 1 bar through to 8 bars long), are set to play the top memory. The next two stages play the next memory down, and the same for the firth and sixth stages. The final two stages are different - they each provide a choice of any of the remaining 9 memories for each stage. So the first couple of stages could be simple introductory patterns, the next two could add some extra detail, and the next two might add some more detail. The final two stages are chosen from a range of memories, and could provide lots of variations of the basic patterns. 


In this state grid, the second repeat stage for the first six stages provides a choice of 1 of 3 memories. As you may be realising, the key to using the state memories effectively is to fill them with fried patterns, and to keep track of where you store each pattern, so that you can then sequence them into builds, breaks and other pats of your song structure. 

Hint:

Here's a hint derived from hours of playing with state memories:

"Keep shift-clicking to save your work!"

The sinking feeling you get when you click on another memory and you realise that you have just lost that brilliant pattern you were working on, is not a good one... Save, save, save...

My recommendation is that you start with Probably, then try ProbablyZ, and then ProbablyS - the features increase each time if you try them in this order, and this should give a smoother learning curve. ProbablyS is the most complex step sequencer so far in this series, and I have more ideas in the pipeline. 

New to this?


(If you are new to Probably's way of working, then don't forget to set the transpose by setting the record focus to the track with ProbablyS in it, and then playing a note - otherwise you just get very low MIDI notes. Transpose from a clip in the track can still be used to transpose ProbablyS, of course...)

Tutorial for Probably (1st in the series):
http://synthesizerwriter.blogspot.co.uk/2017/07/probably-antidote-to-step-sequencers.html

Tutorial for ProbablyZ (2nd in the series):
http://synthesizerwriter.blogspot.co.uk/2017/09/probablyz-tutorial.html

SoundCloud demo for ProbablyZ:
https://soundcloud.com/martinruss/probablyz-tutorial-demo-01


Sunday, 17 September 2017

ProbablyZ Tutorial - adding time warping

When I released Probably, my Max For Live 'antidote to step sequencers' MIDI Effect for Ableton Live, I included some details on how to use it, particularly the way to use the probabilistic 'more than one white square in a column' interface metaphor that it uses. ProbablyZ, the first 'expanded' version, adds in some new grids, and these extend the control possibilities, so I thought it was about time to produce a tutorial...

Programming ProbablyZ

ProbablyZ is an unusual step sequencer that breaks some of the usual rules. Here are the main features:

*NEW* A 'purple' 'Order' grid that allows time to be re-ordered and repeated, with the usual vertical column probability-based control (one white cell in a column means that note plays every time, two white cells means each plays 50% of the time, three cells equals 33% of the time, etc.). 

The red 'Pitch' grid is the same as in Probably, and allows notes to be entered over a one octave range.

The old orange 'Probability' grid has been moved downwards slightly, to make way for a new grid. It allows the probability of a note being played to be controlled, independently of the pitch, octave, velocity and length, and once again, the choice between possibilities can be controlled by having more than one white cell in a vertical column.

*NEW* The newly added, small, red 'Oct(ave)' grid controls the octave shift of the notes, and it is independent of the 'Pitch' grid. The default white cells in the Oct grid are in the middle of the five octave range, so you can shift the note in the 'Pitch' grid up or down by up to two octaves, and the usual probabilistic column control applies, so if you fill all five cells in  column, then the pitch of that note will be shifted to one of those 5 octaves at random each time the column is scanned. 

Having the Pitch and Octave of the notes controlled independently like this provides very precise adjustments to be made to what actually plays. If you have a fixed Pitch grid, but put a bit of variation in the Oct(ave) grid, then the sequence will play those notes, but the octave can vary. You can use this to create lines where just the leading note plays different octaves, or the 'on the beat' notes play a choice from a set of octaves, etc. If you do it the other way round, and put the variability in the Pitch grid, with  fixed Octave grid, then the notes will only play in the ordinary one-octave range. Remember, that this range can always be transposed sing a MIDI keyboard or the Virtual A-L keyboard on a laptop - or by the notes in a Clip. (Oh, and don't forget that you need to set the transposition when you first start ProbablyZ by sending it a note event, other wise it thinks the transposition is right at the bottom of the MIDI range, and you get very low notes!)

The green 'Velocity' grid controls the velocity of the notes in the sequence, and as usual, is independent of any of the other grids.

The blue 'Length' grid controls the length of the notes produced, and is not only independent of the other grids, but it also allows the length of the notes to be controlled, which means that you can have notes overlapping in the output. This is quite unusual for a step sequencer...

Getting Started

I'm still trying to get ProbablyZ to start up with a special default state, and this doesn't always happen. It should look something like the first screen-shot above...

From that starting position, then edit the Pitch grid so that there is only one white cell in the first column, and the Oct(ave) grid so that there is only one white cell in the first column.
I chose a very basic Electric Piano preset for this track, followed by a little reverb - simple percussive sounds are often good when starting work on a step sequence. If you set Live to play, then you get a 'ting', followed by silence for the rest of the bar, and then another ting. So far, so good, and if not, then you did remember to set the transpose by sending a note event, didn't you?

Next, let's explore the Oct(ave) grid. Add four extra white cells in the first column:
Playing this gives us one of five things, dependent on the octave that ProbablyZ randomly chooses for each repetition. If you are used to ordinary step sequencers that always play exactly the same notes every time, then this is your first glimpse of the hidden depth inside ProbablyZ.

When you are bored with those slow tings, then add in some more notes on the beat in the Pitch grid, and give them the same 5 octave choices in the Oct(ave) grid:
This gives us a ting on each beat, with a random choice of octave. This is probably a little too extreme for most purposes! (Used live, it can give the impression that something is about to happen, and can give you time to set up your next song... In the 80s, some bands used Sample & Hold into VCF for the same sort of tantalising effect. )

Next, change the last two Cs to Fs, and adjust the range in the Oct(ave) grid. this is also a good time to tweak the Velocity grid so that the beats are louder, and alter the Length grid so that the beats are longer too:
Okay, so now we have the start of something that has a bit of variation in it, and we can now add in some choices for the second and fourth beats, adjust the Octave so that it feels like a descending line on average, and make the first and third beats longer:
What we are really doing here is defining probabilities. The Pitch grid has set the first note to be a C (always, so 100% probability), and the Oct(ave) grid provides a choice of the upper four octaves (So each octave will happen 25% of the time on average). The second note can be a C or a D#, with a three octave range that doesn't have the top octave included any longer. The third note is always an F, with the four octaves shifted downwards, and the final note is either an F or an A#, with a three octave choice. Taking the final note as an example, then there are six different notes (two notes, three octaves) that could occur, so a specific note will occur 1/6th of the time, on average. Over the course of six repetitions, you might get all of these, and you might not. It is rather like throwing a die (or several dice): you will eventually throw all of the numbers from 1 to 6, but getting them all in 6 throws, or in a specific order, doesn't happen very often...

When you set this sequence playing, then what you hear might be difficult to reconcile with what you see on the grids. There may not seem to be enough white cells to create the variations that you are hearing! If this happens, then read the previous paragraph again, matching the chosen note that you can hear, with the white cells in the Pitch grid and the Oct(ave) grid. As I said earlier, ProbablyZ has hidden depths that are not immediately obvious, and a little time spent getting familiar with the way it works can be time well spent.

At this point, ProbablyZ is playing stuff that is not quite your typical robotic, repetitive step sequence. Now, let's add in some extra notes away from the beat:
You should be able to figure out that these new notes have a fixed pitch and a fixed octave. The lower velocity makes then sound like grace notes or ornamentation. You can experiment with reducing the velocity, or giving a range of velocities, or making these notes very short.

Bending time

So, far, we haven't explored the new 'Order' grid, so let's add a few extra choices to the ornamentation, tweak the octave choices, and increase the length of the beat notes. Then, let's edit the Order grid so that the diagonal is broken, and add in two 'off-the-diagonal' cells: 
 The ornamentation is now chosen from a D and a D# in the first part of the bar, and an F, G or A# in the second part of the bar... Except that the Order grid changes the order in which time happens in all of the other grids. So the first column plays as normal, but the second column jumps to the ornamentation in the second part of the bar, then jumps back to playing the middle part of the bar, and then swaps back to the first little bit of ornamentation just after the middle beat note, and the back to 'time as usual'.

This means that the time order of the columns in all the grids that you see to the right of the Order grid has been changed. Time no longer scans across the grids evenly. Instead, it now follows the Order grid. Watch the dark vertical cursors jump back and forth when this plays...

In detail, this means that after the first C, we will now get a random choice from F, G or A#, then a C or D#, and then the choice of D or D# that we got before. We then get an F, followed by the ornamentation that used to follow the C at the beginning of the bar.

If you want to, you can replace the standard 'lower left to upper right' diagonal in the Order grid with one that goes from upper left to lower right, and the sequence will play backwards. You can adjust the ordering of the sequence in any way you like, live!

If you don't remove the white cells on the diagonal, then things happen a little differently. (In fact, tings happen a little differently! :) ):
The Order grid has exactly the same probabilistic behaviour as th other grids, so when we put two white cells in a column, then it makes a choice between the values. In the Order grid, this means that we have control over the probability that time will be warped. In the above Order grid, there is a 50% chance that the first ornamentation will be swapped to the later one, and a 50% chance that the later one will be swapped with the earlier one. So there are now four ways that time can be warped in the bar: no warping, early ornamentation repeated later, later ornamentation repeated earlier, and ornamentation swapped in time (early moved the later, later moved to earlier). Thos two extra white cells have a big effect!

(As before, feel free to experiment, and to re-read the previous paragraph whilst listening to the output. ProbablyZ can be tricky to get your head around at first!)

Finally, what happens if we extend the time warping to all of the ornamentation? Here's what it looks like inside Ableton Live:
What we have set ProbablyZ to do here is this: Whenever we have an ornamentation note choice, choose from one of the four possibilities and play that. Because the ornamentation is just two sets of notes, then we are only using half of the available possibilities - you can try changing the fourth and eighth columns to give a different 'pool' of notes if you want, and then listen to the output.

You can listen to the output of the above grid setup on Soundcloud here. Remember, this is a single step sequence, produced using only the setup shown above.

I hope that this quick tutorial has shown you some of the possibilities (!) of ProbablyZ.

Warning - you may find it hard to go back to the step sequence that you used previously...

ProbablyZ can be downloaded from MaxForLive.com. It is FREE!