 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Sun Apr 29, 2007 7:33 pm Post subject: pitch or roll to midi-note?? |
|
|
Can an expert tell me if there is anything essentially wrong with this script, to achieve midi-note output via roll. You may say, run it and try it; but i tried something similar and crashed glovepie.
var.note=MapRange(Wiimote.Roll, -90, 90, 0, 127)/127
if var.note=>100 then
midi.C3 = true
else midi.C3=false
endif
if var.note=MapRange>80 then
midi.C3=false
else midi.D3=false
endif
if var.note=MapRange>60 then
midi.E3=true
else midi.E3=false
endif
//etc etc |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Apr 30, 2007 12:48 am Post subject: Re: pitch or roll to midi-note?? |
|
|
I'm guessing this is what you were trying to do?
| Code: |
var.note=MapRange(Wiimote.Roll, -90, 90, 0, 127)/127
if var.note > 100 then
midi.C3 = true
else
midi.C3=false
endif
if var.note >= 80 then
midi.C3=false
else
midi.D3=false
endif
if var.note >=60 then
midi.E3=true
else
midi.E3=false
endif
|
|
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Mon Apr 30, 2007 9:57 pm Post subject: pitch or roll to midi-note |
|
|
No, i've tried many variations of that same idea, and what happens is multiple notes trigger all the time; i know for a fact there is otherwise nothing wrong with my current setup, as midi notes can be triggered via buttons, and midi cc#s can be sent via pitch/roll. aaaaaargh, it's so frustrating having software this powerful and flexible, that won't work because of my inexpert scripting syntax
thanks anyway |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Tue May 01, 2007 12:49 am Post subject: |
|
|
Oh damn, I can't believe I didn't see that. I haven't messed with any of the midi stuff so I guess I must've just looked around it. What about something like this?
| Code: |
var.note=MapRange(Wiimote.Roll, -90, 90, 0, 127)/127
if var.note > 100 then
midi.C3 = true
midi.D3 = false
midi.E3 = false
elseif var.note >= 80 then
midi.C3 = false
midi.D3 = true
midi.E3 = false
elseif var.note >= 60 then
midi.C3 = false
midi.D3 = false
midi.E3 = true
endif
|
|
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Tue May 01, 2007 10:00 am Post subject: wiimote.pitch to midi notes |
|
|
Hi, and thanks again for the input
sadly this didn't work either;
my first attempt caused notes to trigger continuously, this last attempt (your suggestion) caused no midi-output? wtf?
Getting notes out via buttons is easy:
midi.C3=Wiimote.A
midi.D3=Wiimote.B
etc
What i'm looking for is a way to 'chop up' the vertical axis into, say, 12 zones, with each one triggering a single preset midi note. Can you tell me what you use glovepie/wiimote for and i might be able to tweak one of your scripts to do what i need'
thanks again, preeshiate it
Brendan |
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Tue May 01, 2007 11:01 am Post subject: wiimote pitch to midi-note: semi-success |
|
|
Almost got it!!
all i need is the correct syntax to specify greater than AND less than, within one 'if' statement; this is what i've got:
var.note = MapRange (Wiimote.SmoothPitch -90, 90, 0, 100)
//I removed the 'divide by 127' outside the bracket,
//to create a range of 0-100, from pointing up to pointing down
//and created 4 'sectors' 0-25; 26-50; 51-75; 76-100
if var.note <=25 then
midi.C3=true
else midi.C3=false
endif
wait 500ms //this works fine
if var.note = //this is the problem; i want to specify >25 and <75
//at the same time; how do i type this? Also, what happens if you put
//wait inside an if statement; with wait outside the if statement, they're all gonna add up and slow things down..........
almost there
Brendan |
|
| Back to top |
|
 |
SwedishFrog Site Admin

Joined: 25 Jan 2007 Posts: 273 Location: New York
Digg It |
Posted: Tue May 01, 2007 4:25 pm Post subject: |
|
|
| Code: |
if (var.note > 25 and var.note < 75) then
//do your thing
endif
|
|
|
| Back to top |
|
 |
|
|
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
|