Use anything as a MIDI/OSC controller with GlovePIE

Share your favorite Ableton Live tips, tricks, and techniques.
rutgermuller
Posts: 290
Joined: Thu May 31, 2007 11:27 pm

Post by rutgermuller » Wed Apr 02, 2008 7:07 pm

Hi Forge,

I don't know what the hell I did with the colors but here's the vid:

http://www.rutgermuller.nl/forumzooi/for_forge.avi [ 8 MB | Xvid ]

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 12:08 am

AHH Rutger!!!! I am so sorry - it seems I got mixed up somewhere a long the line and posted that one thinking it was self contained but forgetting it contained script from my updated one

I had updated my script so that I could route MIDI through a track and record the automation

the way I did that was to set the Control Surface input to MIDI yoke NT 4 and then set the input of a MIDI track to MIDI yoke NT 3 and then it's output to MIDI yoke NT 4

I could have jsut as easily used 1 & 2 or something

but in the script it is set to use MIDI yoke NT 3 - so if you set the control surface to MIDI yoke NT 3 then it should work, or you could try what I'm doing and set it to MIDI yoke NT 4 and use a MIDI track to receive MIDI yoke NT 3 and output to MIDI yoke NT 4

you still need MIDI yoke NT 1 enabled under 'track' because that is where the note is triggered (unless you route through the track)

really sorry about that - I wasnt paying attention!!


BTW - I also swapped over the A and B buttons - I find the trigger easier for playing the note

so here's the updated script, all I've changed is the A and B buttons



//Forge's Ableton script to control Macros with instant mapping
//thanks to Chris Vine

//pressing A triggers C0
midi1.channel3.C0 = Wiimote1.B

//these variables are created to help smooth the controls
//I'm exploring how to make it smoother
var.xRot = smooth((Wiimote1.gx * 30), 15)
var.yRot = smooth((Wiimote1.gy * 30), 15)
var.zRot = smooth((Wiimote1.gz * 30), 15)


//press keys to Map MIDI controls in Live - Wii changes too much to map
//easily - control30 uses A just because I added it later
//this is not case sensitive, a different command is probably needed to
// select case - I will explore better key commands with modifiers later

midi.Control30 = Keyboard.a

midi.Control31 = Keyboard.Q

midi.Control32 = Keyboard.W

midi.Control33 = Keyboard.E

midi.Control34 = Keyboard.R

midi.Control35 = Keyboard.T

midi.Control36 = Keyboard.Y

midi.Control37 = Keyboard.U

midi.Control38 = Keyboard.I

midi.Control39 = Keyboard.O

midi.Control41 = Keyboard.P

midi.Control42 = Keyboard.k

midi.Control43 = Keyboard.l


/* if A is pressed these controls are active
pointing the Wiimote upwards turns the knobs to 100%
*/

if Wiimote1.A = true {
midi1.Control30= (EnsureMapRange(var.zRot, -13,13, 0,1))
midi1.Control31= (EnsureMapRange(var.xRot, -13,13, 0,1))
midi1.Control32= (EnsureMapRange(var.yRot, -13,13, 0,1))
}


//with Left D-pad button held, Wiimote pitch controls Macro 1 and
//LED 1 lights up
if Wiimote1.Left = true {
midi3.Control33= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led1 = true
else
Wiimote1.Led1 = false
}

//with Up D-pad button held, Wiimote pitch controls Macro 2 and
//LED 2 lights up
if Wiimote1.up = true {
midi3.Control34= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led2 = true
else
Wiimote1.Led2 = false
}

//with Right D-pad button held, Wiimote pitch controls Macro 3 and
//LED 3 lights up
if Wiimote1.Right = true {
midi3.Control35= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led3 = true
else
Wiimote1.Led3 = false
}

//with Down D-pad button held, Wiimote pitch controls Macro 4 and
//LED 4 lights up
if Wiimote1.Down = true {
midi3.Control36= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led4 = true
else
Wiimote1.Led4 = false
}

//with minus button held, Wiimote pitch controls Macro 5 and
//LED 1 lights up
if Wiimote1.Minus = true {
//midi1.Control33= (EnsureMapRange(var.zRot, -13,13, 0,1))
midi3.Control37= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led1 = true
else
Wiimote1.Led1 = false
}

//with plus button held, Wiimote pitch controls Macro 6 and
//LED 2 lights up
if Wiimote1.Plus = true {
midi3.Control38= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led2 = true
else
Wiimote1.Led2 = false
}

////with the '1' button held, Wiimote pitch controls Macro 7 and
//LED 3 lights up
if Wiimote1.one = true {
midi3.Control39= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led3 = true
else
Wiimote1.Led3 = false
}

//with the '2' button held, Wiimote pitch controls Macro 8 and
//LED 4 lights up
if Wiimote1.two = true {
midi3.Control40= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led4 = true
else
Wiimote1.Led4 = false
}

// if home is pressed, these controls are active - I use them like this:
//41: Grain delay dry/wet or send; 42: GDelay Pitch,
//43: GDly feedback - this is all still being worked out
if Wiimote1.Home = true {
midi1.Control41= (EnsureMapRange(var.xRot, 13,-13, 0,1))
midi1.Control42= (EnsureMapRange(var.yRot, 13,-13, 0,1))
midi1.Control43= (EnsureMapRange(var.zRot, 13,-13, 0,1))
}
Last edited by forge on Thu Apr 03, 2008 1:06 am, edited 1 time in total.

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 12:14 am

BTW - to use the keys to map CCs you will need MIDI yoke NT 1 enabled under 'remote'

I have just been playing with this and noticing there's a lot of stepping, so I need to smooth it out a bit

you can play it smoothly by turning it slowly, but that's probably not ideal

rutgermuller
Posts: 290
Joined: Thu May 31, 2007 11:27 pm

Post by rutgermuller » Thu Apr 03, 2008 12:39 am

still nothing....

you mean the setup like this: http://www.rutgermuller.nl/forumzooi/help.jpg

?

EDIT : oh wait haven't read your last post yet

rutgermuller
Posts: 290
Joined: Thu May 31, 2007 11:27 pm

Post by rutgermuller » Thu Apr 03, 2008 12:43 am

Nope, still nothing.

No motion sensing, no LED's lighting up.

Mapping doesn't help, but it should work without that anyway right?

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 12:44 am

Okay I've just realised - the 'wait 100ms' command I put in for the LEDs is affecting the CCs as well - so I have to remove that

I'll update the script above as soon as I have

rutgermuller
Posts: 290
Joined: Thu May 31, 2007 11:27 pm

Post by rutgermuller » Thu Apr 03, 2008 12:45 am

Beta Tester at your service.

I'm off to sleep, it's getting close to 3 a.m. Hope to find something awesome when I wake up :D :wink: But don't hurt yourself.

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 1:07 am

well - just in case you are awake and want to risk being up for another hour -it's updated!! ^^^^^

in the prefs contol surface is MIDI yoke NT 3

and under MIDI yoke NT 1 I have track and remote enabled

and just to add another attempt to get it working, here's the ALS I've been using - it uses operator

http://www.alexisforge.co.uk/WiiTest03.als

you can ignore any clips, they were just for testing the routing

rutgermuller
Posts: 290
Joined: Thu May 31, 2007 11:27 pm

Post by rutgermuller » Thu Apr 03, 2008 9:16 am

nothing :(

used your updated script, i see the blue hand in the macro controls, i see midi coming in when pressing b and i see you mapped the midi.

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 10:16 am

rutgermuller wrote:nothing :(

used your updated script, i see the blue hand in the macro controls, i see midi coming in when pressing b and i see you mapped the midi.
!!!!

I really thought that would solve it - to definitely make sure - the knobs would only move while the button is held, it's not a toggle

you tried my set?

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 10:18 am

just to check - can you go into the GUI tab and double check that midi1 is MIDI yoke NT1 and midi3 is MIDI yoke NT3?

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 10:29 am

maybe just try this and change the control surface input to MIDI yoke NT 1 and just try playing the note with the B Button and pressing the Minus key and tilting the WIImote up and down

you're definitely getting the last curly bracket } in as well? it's easy to miss!

midi1.channel3.C0 = Wiimote1.B

var.zRot = smooth((Wiimote1.gz * 30), 15)

if Wiimote1.Minus = true {
midi1.Control37= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led1 = true
else
Wiimote1.Led1 = false
}

rutgermuller
Posts: 290
Joined: Thu May 31, 2007 11:27 pm

Post by rutgermuller » Thu Apr 03, 2008 10:50 am

Checked all you said, used this test script (didn't miss the bracket). Still only the b button works.

I also changed minus to plus, to see if my minus key is broken.

rutgermuller
Posts: 290
Joined: Thu May 31, 2007 11:27 pm

Post by rutgermuller » Thu Apr 03, 2008 10:56 am

The LED only lights up when i disable the midi1.control code :

Code: Select all

if Wiimote1.Minus = true {
//midi1.Control37= (EnsureMapRange(var.zRot, -13,13, 0,1))
Wiimote1.Led1 = true
else
Wiimote1.Led1 = false
}
So in my n00bish opinion I think the script is stalling because of that line. I don't think this has anything to do with Live.

In GlovePie > GUI> output device > MIDI 1 (Midiyoke NT 1) > Detect Input. It detects the Pitch control of my Wiimote

Image

forge
Posts: 17422
Joined: Wed Apr 21, 2004 9:47 am
Location: Queensland, AU
Contact:

Post by forge » Thu Apr 03, 2008 11:57 am

okay I'm pretty stumped here now

if you enter MIDI map mode and select a knob and press minus and move the Wiimote does it map a CC?

maybe if you remove the 1 and change midi1 to just MIDI - that should just use the default MIDI channel and it still works here

it looks like everything is the same yet yours isnt working

maybe if someone else could try it...Angstrom are you out there? 8O

Post Reply