|
Viewed 7206 times. 14 people liked this blog. You can rate it below if you haven't already.
People who enjoyed reading this: RRine, yghartsyrt, mrk087, Zanf, lematt, bigfatpwner, eyesnine, Roshi, celibacyclub, Mr12000, populus, hecanjog, Moriarty, artsmusic
-->
Hi!
There have already been a couple blogs about musical applications for the Wiimote on the mac from populus and ricemutt but I thought I'd blog a PC Wiimote tutorial and share my script which maps the the Wiimote to midi notes/ccs etc. Also, this script allows the use of the nunchuk peripheral and the classic controller as well as the Wiimote itself.
First of all to use my script you shall need the following :
Wiimote
Wii Nunchuk (optional)
Wii Classic Controller (optional)
A Bluetooth adapter for your PC
BlueSoleil Software (likely bundled with your bluetooth adapter)
GlovePIE software
And any app which accepts MIDI input.
My Script *updated*
Settting it Up...
1 - Start the BlueSoleil software.
2 - On your Wiimote press the 1 + 2 buttons. The leds at the bottom will now start to flash.
3 - In BlueSoleil, press the red 'sun' in the middle of the window, hopefully bluesoleil should find your wii remote (NINTENDO RVL-CNT-01).
4 - Once the device is found, right click on its icon in BlueSoleil and select 'Refresh Services'. If this fails make sure your Wiimotes leds are still flashing, if not press the 1 + 2 buttons again.
5 - Bluesoleil should have found a 'Human Interface Device' service and the mouse icon in BlueSoleil should have a square around it. Right click on this or the Wiimote icon and select 'Connect'.
6 - Once the Wiimote is connected to BlueSoleil, start the GlovePIE software and load my script.
7 - In GlovePIE under the 'CP-Settings' menu, click on the 'MIDI' item and set your default midi device to the MIDI device you would like to output to.
8 - Under the same menu, click the 'Wiimote Calibration' item and calibrate your Wiimote.
9 - Press the 'Run' button in the main GlovePIE window to execute the script. If all is well the leds on your Wiimote should stop flashing and 1 and 4 leds should be illuminated.
About the script
My script is just a general purpose one to get you started with the Wiimote. On the Wiimote the buttons are mapped as follows :
Wiimote A,B,DPad Up,Down,Left,Right,1,2 : Midi Notes
Wiimote + and - buttons : Program Change Up/Down
Wiimote Home button : Enable/Disable CCs
Wiimote X,Y,Z : MIDI CCs 10,11 and 12
Nunchuk C and Z buttons : Midi Notes
Nunchuk X,Y,Z : MIDI CCs 20,21 and 22
Nunchuk analog stick : MIDI CCs 23 and 24
Classic Controller buttons A,B,X,Y,ZL,ZR,L,R,-,+,Home,1 and 2 - Midi Notes
Classic Controller analog stick 1 : Midi CCs 20 and 21
Classic Controller analog stick 2 : Midi CCs 22 and 23
...Enjoy!
| |
Comments
04/26/07
+
PM |
QUOTE |
PERMALINK |
REPORT
yghartsyrt
wicked
04/26/07
+
PM |
QUOTE |
PERMALINK |
REPORT
mlbot
you mean, wiicked, right?
04/26/07
+
PM |
QUOTE |
PERMALINK |
REPORT
celibacyclub
hell yeahs.
04/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
KidQuaalude
noticed a bug with multiple note-ons being sent from the classic controller. fixed. now noticed the script has some preformance issues when using the nunchuk or classic controller. i made a note in the script but i fear that this will not be fixed until GlovePIE is updated...i'm trying to optimise the script in the meantime tho...
get the updated script here
04/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
a2n3d7y
nice thanks for the script.
10/02/07
+
PM |
QUOTE |
PERMALINK |
REPORT
KidQuaalude
because the download link has expired here's the code to copy/paste into notepad.
/*==============================================================================
Simple Wiimote to MIDI Script by Kid Quaalude
---------------------------------------------
link
KidQuaalude AT gmail.com
==============================================================================*/
/*==============================================================================
Note :
This script has some performance problems when using the nunchuk or classic
controller. The result is some note-ons may be lost. Hit the wiimote 'home'
button to disable CC processing if this occurs. Hopefully this problem will be
resolved in a future release of GlovePIE.
==============================================================================*/
//initialise (this 'if' part useful for code you only need to run once)
if (var.Init = 0) then
midi.DeviceOut = 0; // default midi device
midi.DefaultChannel = 1; //midi channel
Wiimote1.Leds = 9; //set 1 and 4 leds
var.CCEnabled = true; //ccs enabled?
var.Prog1 = 1; //instrument number
var.Init = 1; // initialised (do not run again)
end if
/*==============================================================================
Wiimote #1
==============================================================================*/
/*==============================================================================
CCs
==============================================================================*/
//only if ccs enabled
if (var.CCEnabled) then
midi.Control10=(EnsureMapRange(Wiimote1.gx,1,-1,0,1))
//decrease y sensitivity
midi.Control11=(EnsureMapRange(Wiimote1.gy,1,0,0,1))
midi.Control12=(EnsureMapRange(Wiimote1.gz, 1,-1,0,1))
if (Wiimote1.HasNunchuk) then
midi.Control20=(EnsureMapRange(Wiimote1.Nunchuk.gx,1,-1,0,1));
//decrease y sensitivity
midi.Control21=(EnsureMapRange(Wiimote1.Nunchuk.gy,1,0,0,1));
midi.Control22=(EnsureMapRange(Wiimote1.Nunchuk.gz,1,-1,0,1));
midi.Control23=(EnsureMapRange(Wiimote1.Nunchuk.JoyX,-1,1,0,1));
midi.Control24=(EnsureMapRange(Wiimote1.Nunchuk.JoyY,1,-1,0,1));
end if
if (Wiimote1.HasClassic) then
midi.Control20=(EnsureMapRange(Wiimote1.Classic.Joy1X,-1,1,0,1));
midi.Control21=(EnsureMapRange(Wiimote1.Classic.Joy1Y,1,-1,0,1));
midi.Control22=(EnsureMapRange(Wiimote1.Classic.Joy2X,-1,1,0,1));
midi.Control23=(EnsureMapRange(Wiimote1.Classic.Joy2Y,1,-1,0,1));
end if
end if
/*==============================================================================
Midi Notes
==============================================================================*/
if Wiimote1.A then
//fix for multiple note-ons
if (not midi.C3) then
midi.C3 = true;
end if
else
midi.C3 = false;
end if
if Wiimote1.B then
//fix for multiple note-ons
if (not midi.D3) then
midi.D3 = true;
end if
else
midi.D3 = false;
end if
if Wiimote1.Up then
//fix for multiple note-ons
if (not midi.E3) then
midi.E3 = true;
end if
else
midi.E3 = false;
end if
if Wiimote1.Down then
//fix for multiple note-ons
if (not midi.F3) then
midi.F3 = true;
end if
else
midi.F3 = false;
end if
if Wiimote1.Left then
//fix for multiple note-ons
if (not midi.G3) then
midi.G3 = true;
end if
else
midi.G3 = false;
end if
if Wiimote1.Right then
//fix for multiple note-ons
if (not midi.A3) then
midi.A3 = true;
end if
else
midi.A3 = false;
end if
if Wiimote1.One then
//fix for multiple note-ons
if (not midi.B3) then
midi.B3 = true;
end if
else
midi.B3 = false;
end if
if Wiimote1.Two then
//fix for multiple note-ons
if (not midi.C4) then
midi.C4 = true;
end if
else
midi.C4 = false;
end if
//if classic controller connected
if (Wiimote1.HasClassic) then
if Wiimote1.Classic.a then
//fix for multiple note-ons
if (not midi.D4) then
midi.D4 = true;
end if
else
midi.D4 = false;
end if
if Wiimote1.Classic.b then
//fix for multiple note-ons
if (not midi.E4) then
midi.E4 = true;
end if
else
midi.E4 = false;
end if
if Wiimote1.Classic.x then
//fix for multiple note-ons
if (not midi.F4) then
midi.F4 = true;
end if
else
midi.F4 = false;
end if
if Wiimote1.Classic.y then
//fix for multiple note-ons
if (not midi.G4) then
midi.G4 = true;
end if
else
midi.G4 = false;
end if
if Wiimote1.Classic.Up then
//fix for multiple note-ons
if (not midi.A4) then
midi.A4 = true;
end if
else
midi.A4 = false;
end if
if Wiimote1.Classic.Down then
//fix for multiple note-ons
if (not midi.B4) then
midi.B4 = true;
end if
else
midi.B4 = false;
end if
if Wiimote1.Classic.Left then
//fix for multiple note-ons
if (not midi.C5) then
midi.C5 = true;
end if
else
midi.C5 = false;
end if
if Wiimote1.Classic.Right then
//fix for multiple note-ons
if (not midi.D5) then
midi.D5 = true;
end if
else
midi.D5 = false;
end if
if Wiimote1.Classic.LFull then
//fix for multiple note-ons
if (not midi.E5) then
midi.E5 = true;
end if
else
midi.E5 = false;
end if
if Wiimote1.Classic.RFull then
//fix for multiple note-ons
if (not midi.F5) then
midi.F5 = true;
end if
else
midi.F5 = false;
end if
if Wiimote1.Classic.ZR then
//fix for multiple note-ons
if (not midi.G5) then
midi.G5 = true;
end if
else
midi.G5 = false;
end if
if Wiimote1.Classic.ZL then
//fix for multiple note-ons
if (not midi.A5) then
midi.A5 = true;
end if
else
midi.A5 = false;
end if
if Wiimote1.Classic.Minus then
//fix for multiple note-ons
if (not midi.B5) then
midi.B5 = true;
end if
else
midi.B5 = false;
end if
if Wiimote1.Classic.Home then
//fix for multiple note-ons
if (not midi.C6) then
midi.C6 = true;
end if
else
midi.C6 = false;
end if
if Wiimote1.Classic.Plus then
//fix for multiple note-ons
if (not midi.D6) then
midi.D6 = true;
end if
else
midi.D6 = false;
end if
wait 30ms; //poll at less regular intervals
end if
//if nunchuck controller connected
if (Wiimote1.HasNunchuk) then
//remmed due to this method causing multiple note-ons on button press
//midi.G4 = Wiimote1.Nunchuk.CButton;
//midi.A4 = Wiimote1.Nunchuk.ZButton;
if Wiimote1.Nunchuk.CButton then
//fix for multiple note-ons
if (not midi.D4) then
midi.D4 = true;
end if
else
midi.D4 = false;
end if
if Wiimote1.Nunchuk.ZButton then
//fix for multiple note-ons
if (not midi.E4) then
midi.E4 = true;
end if
else
midi.E4 = false;
end if
wait 30ms; //poll at less regular intervals
end if
/*==============================================================================
Custom
==============================================================================*/
//
if (Wiimote1.Home) then
//switch
var.CCEnabled = not var.CCEnabled;
//show which mode we are in
if (var.CCEnabled) then
Wiimote1.Leds = 9; //set 1 and 4 leds
else
Wiimote1.Leds = 6; //set 2 and 3 leds
end if
//stop multiple calls while button held
wait 250ms;
end if
//program change
if Wiimote1.Plus then
if var.Prog1 < 128 then
var.Prog1 = var.Prog1 + 1;
midi.Instrument = var.Prog1;
wait 150ms;
end if
end if
if Wiimote1.Minus then
if var.Prog1 > 1 then
var.Prog1 = var.Prog1 - 1;
midi.Instrument = var.Prog1;
wait 150ms;
end if
end if
//display program
debug = "Program : " & var.Prog1
Register / login
|
^
EM411 is Copyright 2001-2008 EM411.com
All rights reserved. | Contact | RSS
|