WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with midi1.Control37= (EnsureMapRange(

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> General Windows Wiimote
View previous topic :: View next topic  
Author Message
rutgermuller



Joined: 03 Apr 2008
Posts: 4

Digg It
PostPosted: Thu Apr 03, 2008 11:50 am    Post subject: Problem with midi1.Control37= (EnsureMapRange(

What could be wrong with this code? I'm trying to get a nice script by Forge working.

See: ableton. com /forum/viewtopic.php?t=88813&start=30
Get rid of the spaces in the adress.

Code:
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
}


The LED isn't lighting up at all, except for when I disable the ensuremaprange line. And I get no midi output.

My buttons and accelerometer work fine. And for example pitch is detected on MIDI1 (midiyoke NT1) > wiimote1 .

Hope you understand my explanation, i'm not a programmer.
Back to top
View user's profile Send private message
rutgermuller



Joined: 03 Apr 2008
Posts: 4

Digg It
PostPosted: Thu Apr 03, 2008 1:25 pm    Post subject:

Ok it works with glovepie 0.29 and doesn't with 0.30!
Back to top
View user's profile Send private message
rutgermuller



Joined: 03 Apr 2008
Posts: 4

Digg It
PostPosted: Thu Apr 03, 2008 1:43 pm    Post subject:

Ah i see it's a Maprange problem that's being adressed in this topic: wiili. org / forum/maprange-functions-not-working-in-glovepie-030--t3786.html
Back to top
View user's profile Send private message
rutgermuller



Joined: 03 Apr 2008
Posts: 4

Digg It
PostPosted: Thu Apr 03, 2008 2:33 pm    Post subject:

fixed it thanks to the tips there

Code:
//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.0, 13.0, 0.0, 1.0)
midi1.Control31= EnsureMapRange(var.xRot, -13.0, 13.0, 0.0, 1.0)
midi1.Control32= EnsureMapRange(var.yRot, -13.0, 13.0, 0.0, 1.0)
}


//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.0, 13.0, 0.0,1.0)
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.0, 13.0, 0.0,1.0)
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.0, 13.0, 0.0,1.0)
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.0, 13.0, 0.0,1.0)
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.0, 13.0, 0.0,1.0)
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.0, 13.0, 0.0,1.0)
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.0, 13.0, 0.0,1.0)
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.0, 13.0, 0.0,1.0)
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.0, -13.0, 0.0,1.0)
midi1.Control42= EnsureMapRange(var.yRot, 13.0, -13.0, 0.0,1.0)
midi1.Control43= EnsureMapRange(var.zRot, 13.0, -13.0, 0.0,1.0)
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> General Windows Wiimote All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group