scriptSONIC - Tutorial 02

Augmented Keyboard. Use MIDI binding to turn an external keyboard into a harmonic rhythm machine.

Notes played on an external MIDI keyboard are bound to an Event and stored by a script. Loops play back the notes as a rhythmic chord pattern.

create a new project

Screen Shot 2016-03-12 at 8.38.11 p.m..png

 ← ② add a new Loop

this will be used for the script to save received MIDI notes

add the script to the Event

we will bind this Event to all received MIDI note-on messages below

every time a note is received, the script will be executed

Screen Shot 2016-03-12 at 9.12.18 p.m..png

the script stores received notes in n, an N-length circular buffer

$.midievents contains all bound MIDI events received by the Event

in this case, it will contain one or more note-ons, depending on how many keys were played simultaneously

② →

add some

initialisation code and the binding itself

the binding says:

Event 0.0 will start when a note-on is received on any channel and of any note value

null acts as a wildcard value

run the script

Screen Shot 2016-03-12 at 9.43.56 p.m..png

← ① go to the Script screen

← ④

try typing bindings() in the console to see the new binding

test the binding by going to an external keyboard, or synth app

make sure it is sending MIDI out to scriptSONIC

Screen Shot 2016-03-12 at 9.45.07 p.m..png

play some keys and you should see the contents of n printed out

it should contain the last three notes played

now to do something with the stored note values

go back to the Loops page and add a new Loop

add the following script to Event 1.0[0])

Screen Shot 2016-03-12 at 10.08.15 p.m..png

this will play the first note in n to the MIDI output object m

split the Loop into 3 by tapping it at the far left where the Start and Stop buttons are

this gives us a triplet rhythm

Screen Shot 2016-03-12 at 9.53.14 p.m..png

← set Split mode and #3

copy Loop1 by tapping it at the far left

Screen Shot 2016-03-12 at 10.10.19 p.m..png

← set Copy mode

edit the first Event of the copy to be[1])

Screen Shot 2016-03-12 at 10.01.24 p.m..png

Screen Shot 2016-03-12 at 10.01.41 p.m..png

← split the copied Loop into 4

a quadruple rhythm

repeat the Loop copy & script edit steps with[2])

 split into 5 for a quintuple rhythm

Screen Shot 2016-03-12 at 10.02.00 p.m..png

← each of these 3 Loops plays a different note from n in a different rhythm

go to Play mode →

and Toggle mode →

deselect Events to create an interesting rhythm

also make the Loops active and make them loop using the Loop buttons

Screen Shot 2016-03-12 at 10.27.56 p.m..png

I'm using Cubasis as the external keyboard to send MIDI notes to scriptSONIC, and as the destination for the MIDI note rhythms generated by the Events

make sure MIDI in and out are connected so scriptSONIC

Screen Shot 2016-03-12 at 11.06.19 p.m..png

you could also have an external physical keyboard via a MIDI hardware input to the iPad, or via BlueTooth

the device in action

 the Loops playing the rhythm have been set going in sync with the Start Active Loops button

then switching to the keyboard and playing a note at a time

now Cubasis has an augmented keyboard where you play a chord rhythm instead of single notes

Things to try:

- alter which Events are selected to change the rhythm

- trigger the Loops out of sync

- split the Loops in other ways

- play different notes from n in sequence