 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
Ant
Joined: 07 May 2008 Posts: 9
Digg It |
Posted: Wed Jun 04, 2008 8:15 am Post subject: Carl.., Anyone.., Please :) |
|
|
I would like to use the wiimote to control Midi system exclusive data.
Examp: System Exclusive would be F0 42 30 5D 53 00 00 00 00 00 xx F7
The "xx" would be the byte to control using the wiimote.
I think this could be done using the mmwin.dll functions midiOutPrepareHeader and midiOutLongMsg only I have no idea how to script this.
Here is a link describing the functions.
msdn.microsoft.___/en-us/library/ms711629(VS.85).aspx
I was getting an error message when posting the link so I had to change 'com' to ' __' sorry for any confusion.
Any help is much appreciated
Thank you..,
Ant |
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 86
Digg It |
Posted: Thu Jun 05, 2008 9:20 pm Post subject: |
|
|
Can I ask what the function of your script is....i might be able to help, although i don't use G'pie to send sysex data out?
Brendan |
|
| Back to top |
|
 |
Ant
Joined: 07 May 2008 Posts: 9
Digg It |
Posted: Wed Jun 11, 2008 7:06 am Post subject: |
|
|
Hey Brendan..,
Basically what I wish to do is control various parameters on my hardware synth and guitar processor using the Wii-remote. I know I could go the MIDI CCs' route , but I rather reserve those for controlling software synths and video software, plus it's alot easier to setup and manage multiple parameters using sysex. Oh.., by the way.., thank you for the MIDI related code you have contributed on this forum it has been really useful. If you can help me out with this that would be GREAT !!! If you need anymore info just let me know. Here is an example....,
F0 42 30 5D 53 00 00 00 (aa) 00 (xx) F7
var.aa is the param. number and var.xx is the value. I could set each of the nunchuck's t-stick directions to var.aa and var.xx to the wiimote.roll. This would allow me to change eight params. quickly by holding the wiimote at a certain angle and then rotating the thumbstick. I already have working code that does this using CCs', but utilizing sysex is what I'm really hoping for.
Thank you..,
Ant |
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 86
Digg It |
Posted: Wed Jun 11, 2008 11:03 am Post subject: |
|
|
if you could post a full example of your script, then i could have a 'noodle' with it (a technical term which means 'to noodle'!)...
thanks
also, two users who have been very helpful in the past are: 'swedishfrog' and 'R.Legault'; they will admit that they're not particularly midi-fluent, but what they don't know about glovepie ain't worth knowin'
Brendan |
|
| Back to top |
|
 |
Ant
Joined: 07 May 2008 Posts: 9
Digg It |
Posted: Wed Jun 11, 2008 8:01 pm Post subject: |
|
|
Brendan,
Here is the script.., I basically just tweaked one of Carol Kenner's scripts which was written to map MIDI notes to the
T-Stick to work with MIDI chanels and CCs' instead. So the majority of code is his.
| Code: | //Assignment of Nunchuk T-Stick into eight directions
var.roll = atan2(nunchuk.joyX, -nunchuk.JoyY)
if |nunchuk.joy|<40% then
var.pos = -1
else
var.pos = RemoveUnits(var.roll / 360)*8
if var.pos <= -0.5 then var.pos = var.pos + 8
if 0.4 <= frac(var.pos) <= 0.6 then
var.pos = -1
else
var.pos = round(var.pos)
end if
end if
//Variable Initialization
if !var.Initialize
var.Chan = 8
var.currentChannel = 1
var.Initialize = true
endif
midi.DefaultChannel = (var.currentChannel)
//Nunchuks T-stick cycles through Midi Channels/Tracks 1-8
//if Nunchuk C button is pressed then T-Stick cycles Channels/Tracks 9-16
if var.pos = -1 then
var.currentChannel = -1
else if not Nunchuk.CButton then
// Tracks 1-8
if var.pos = 0 then
var.currentChannel = 1 //Track 1
else if var.pos = 1 then
var.currentChannel = 2 //Track 2
else if var.pos = 2 then
var.currentChannel = 3 // Track 3
else if var.pos = 3 then
var.currentChannel = 4 // Track 4
else if var.pos = 4 then
var.currentChannel = 5 // Track 5
else if var.pos = 5 then
var.currentChannel = 6 // Track 6
else if var.pos = 6 then
var.currentChannel = 7 // Track 7
else if var.pos = 7 then
var.currentChannel = 8 // Track 8
end if
else
// Tracks 9-16
if var.pos = 0 then
var.currentChannel = 9 //Track 9
else if var.pos = 1 then
var.currentChannel = 10 //Track 10
else if var.pos = 2 then
var.currentChannel = 11 //Track 11
else if var.pos = 3 then
var.currentChannel = 12 //Track 12
else if var.pos = 4 then
var.currentChannel = 13 //Track 13
else if var.pos = 5 then
var.currentChannel = 14 //Track 14
else if var.pos = 6 then
var.currentChannel = 15 //Track 15
else if var.pos = 7 then
var.currentChannel = 16 //Track 16
end if
end if
/*If Nunchuk Z button is Held then CC-7 becomes Active and is controlled using
Nunchuk Pitch up and down */
if Nunchuk.ZButton = true
midi.Channel.ByteControl7=EnsureMapRange(Wiimote.Nunchuk.SmoothPitch, -60, 60, 0, 100)/100
endif
/*If Wiimote B button is Held then CC-10 becomes Active and is controlled using
Wiimote Roll Left to Right */
if wiimote.B = true
midi.Channel.ByteControl10=EnsureMapRange(Wiimote.SmoothRoll, -60, 60, 0, 100)/100
endif
debug = var.pos
|
Here is how it works.., MIDI channels 1-8 are mapped to the 8 directions of the Nunchuk T-Stick.
So if you point T-Stick up then channel 1 is active, while holding T-Stick up if you hold the Z-button down CC-7 becomes active and then pitching up or down with Nunchuk changes the param. If you hold the wiimote.B button then CC-10 is active and Rolling Wiimote Left or Right will change the param. If you hold the Nunchuk.C button then MIDI channels 9-16 are mapped to the T-Stick.
MY Korg synth has a built in 16 track sequencer so I just set each track to it's own MIDI Channel and then I am able to control Volume with Nunchuk.Pitch and Pan with Wiimote.Roll. What is cool is say you want to have all Tracks 1-8 Pan set to hard left.., just roll the wiimote to it's left side then hold down Wiimote.B and rotate the T-Stick 360 deg. in whatever direction you want. Nice and quick.., really good for in the studio. I can assign MIDI CCs' to just about any param. on my synth but when programming drumkits or synth patches with hundreds of params using CCs' quickly becomes a pain in the ass! So this is where sysex steps in and makes tweaking params quicker and easier to manage.
A single drumkit on my synth can contain 128 samples each with multiple params. Here is the sysex parameter change message
F0 42 30 5D 53 (aa) (bb) (cc) (dd) (ee) (ff) F7
F0 42 30 5D 53 = Sysex Header\ID
aa = Drumkit Number 00-3F(00-63)
bb = Index\sample number 00-7F(00-127)
cc = Param.Number (MSB)
dd = Param.Number (LSB)
ee = Param.Value (MSB)
ff = Param.Value (LSB)
F7 = end transmition
So to change the Pan(16) for sample 60(3C) on DKit-06(05) to center position(40) would be
F0 42 30 5D 53 05 3C 00 16 00 40 F7.
So what I would like is to have aa-ff assigned to variables.(var.aa, var.bb, etc..)
Also..,do you know if there is a way to assign which MIDI CC is being used via a variable ?
Something like var.xxx = midi.ByteControl(xxx)
Thanks..,
Ant |
|
| Back to top |
|
 |
Ant
Joined: 07 May 2008 Posts: 9
Digg It |
Posted: Wed Jun 25, 2008 2:27 pm Post subject: |
|
|
Brendan,
Just wondering if you got around to any noodling ?
Also Carl.., if you happen to read this, I sent you an email awhile back and never received a reply. Maybe you did'nt receive the email or you've just been busy, but if you could please spare a little time to come up with a solution I would sooooo much appreciate it. I have a gig coming up next month and a solution here would make things about 100 times easier.
Thank You..,
Ant |
|
| 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
|