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 

Wii drums with nunchuk and more v0.1

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
kunalkunal2



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Wed Jan 03, 2007 10:14 pm    Post subject: Wii drums with nunchuk and more v0.1

Hi all, here is my next script, it wii drums w/t nunchuk
I dont know if anyone took this idea already but w.e Rolling Eyes
Here it is

Code:
// Kunal's version of Wii Drums!!
// (based on Carl's version of Bob's wii drums)
// Improved features: included Nunchuk support
// Controls for nunchuk are:
// downward drum beat = snare
// zbutton = hihat
// cbutton = crash
// various nunchuk wheel movements = tom toms
// www.bobsomers.com to download the drum beats
// Hope you like it
// Note: For some reason when I hit the Zbutton on the Nunchuk
// it combines the snare beat and the hihat beat
// if anyone can fix it, tell me, so I can modify it.....



var.xOffset = 8
var.yOffset = -37
var.zOffset = 12

var.xRot = Wiimote.RawForceX + var.xOffset
var.yRot = Wiimote.RawForceY + var.yOffset
var.zRot = Wiimote.RawForceZ + var.zOffset

// Debug
debug = "X=" + var.xRot + "   Y=" + var.yRot + "   Z=" + var.zRot

// Downward drum beat triggered
if var.yRot > 30 then
   var.B = Wiimote.B and not (Wiimote.A or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
   var.S = Wiimote.A and not (Wiimote.B or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
   var.C = Wiimote.A and Wiimote.B and not (Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
   var.T = Wiimote.Minus and not (Wiimote.A or Wiimote.B or Wiimote.Home or Wiimote.Plus)
   var.M = Wiimote.Home and not (Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Plus)
   var.L = Wiimote.Plus and not (Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Home)
   var.H = not(Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
else
    var.B = false
    var.S = false
    var.H = false
    var.C = false
    var.T = false
    var.M = false
    var.L = false
endif

Midi.volume = 100%
Midi.BassDrum1 = var.B
Midi.AcousticSnare = var.S
Midi.CrashCymbal1 = var.C
Midi.HighMidTom = var.T
Midi.LowMidTom = var.M
Midi.LowTom = var.L
Midi.ClosedHiHat = var.H

// note, unfortunately you can't set those Midi values inside the IF
// because IF statements in GlovePIE cause it to send the midi message
// again even if it hasn't changed, whereas outside IF statements it
// only sends a MIDI message if it has changed.

var.Nunchuk.xOffset = 8
var.Nunchuk.yOffset = -37
var.Nunchuk.zOffset = 12

var.Nunchuk.xRot = Wiimote.Nunchuk.RawForceX + var.Nunchuk.xOffset
var.Nunchuk.yRot = Wiimote.Nunchuk.RawForceY + var.Nunchuk.yOffset
var.Nunchuk.zRot = Wiimote.Nunchuk.RawForceZ + var.Nunchuk.zOffset


if var.Nunchuk.yRot > 30 then
   var.bassnun = Wiimote.Nunchuk.Zbutton and not (Wiimote.Nunchuk.CButton)
   var.snarenun = not(Wiimote.Nunchuk.Zbutton or Wiimote.Nunchuk.Cbutton)
   var.crashnun = Wiimote.Nunchuk.Cbutton and not (Wiimote.Nunchuk.Zbutton
else
    var.bassnun = false
    var.snarenun = false
    var.crashnun = false
endif
Midi.volume = 100%
midi.ClosedHiHat = var.bassnun
Midi.AcousticSnare = var.snarenun
Midi.CrashCymbal1 = var.crashnun
Midi.HighMidTom = (-1.2 < wiimote.Nunchuk.JoyY < -0.5)
Midi.LowMidTom = (-1.2 < wiimote.Nunchuk.JoyX < -0.5) or (0.5 < wiimote.Nunchuk.JoyX < 1.2)
Midi.LowTom = (0.5 < wiimote.Nunchuk.JoyY < 1.2)

enjoy!! Very Happy


Last edited by kunalkunal2 on Wed Jan 10, 2007 1:49 am; edited 2 times in total
Back to top
View user's profile Send private message
Johnman



Joined: 17 Dec 2006
Posts: 10

Digg It
PostPosted: Sat Jan 06, 2007 12:31 am    Post subject:

Code:
if var.Nunchuk.yRot > 30 then
   var.bassnun = Wiimote.Nunchuk.Zbutton and not (Wiimote.A or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
   var.snarenun = not(Wiimote.B or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
   var.crashnun = Wiimote.Nunchuk.Cbutton
else


It's because of that code. It should be

Code:
if var.Nunchuk.yRot > 30 then
   var.bassnun = Wiimote.Nunchuk.Zbutton and not (Wiimote.Nunchuk.CButton)
   var.snarenun = not(Wiimote.Nunchuk.Zbutton or Wiimote.Nunchuk.Cbutton)
   var.crashnun = Wiimote.Nunchuk.Cbutton and not (Wiimote.Nunchuk.Zbutton
else


I may have made a mistake when typing it out (I didn't test), but that's what it should be, this way it isn't referencing what your pressing on the wiimote, when deciding what you're hitting on the nunchuk.
Back to top
View user's profile Send private message
kunalkunal2



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Sat Jan 06, 2007 1:36 am    Post subject:

I was to lazy to fix that when I first made it but, i fixed it
thanks for the observation
Back to top
View user's profile Send private message
Elo



Joined: 19 Dec 2006
Posts: 19

Digg It
PostPosted: Sat Jan 06, 2007 1:46 am    Post subject:

ohwell..if u had checked through one of the main script threads u would see i already made a script with mote and nunchuck Smile but seems fine from a quick glance Very Happy
http://www.wiili.org/forum/nunchuk-support-in-glovepie-027-t587-s10.html
although that was just a quick work as soon as nc was available ;P
Back to top
View user's profile Send private message
racyno



Joined: 19 Jan 2007
Posts: 7

Digg It
PostPosted: Sun Feb 04, 2007 12:33 pm    Post subject: WiiDrums : 4 Wiimotes et 4 Nunchuks

I’ve done three versions of WiiDrums :
1) 2 Wiimotes and 2 Nunchuks for 1 person (foot : BassDrum with Wiimote2 and Nunchuk2).
2) Version 2 Wiimotes 2 Nunchuks for 1 to 4 persons.
3) Drums with 4 Wiimotes et 4 Nunchuks for 1 to 8 persons
See my scripts here :
http://www.wiili.org/forum/wiidrums--4-wiimotes-and-4-nunchuks-t1119.html
_________________
Scritps WiiDrums : http://cracyno.free.fr/ for 1 to 8 persons.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts 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