This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The X,Y,Z measurements are a little off. Also, it does it whenever you are playing, so that could get very annoying very fast.
- Loading branch information
1 parent
e7b23aa
commit 41f4ad7
Showing
5 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Microsoft.Kinect; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Ventuz.OSC; | ||
|
||
namespace GesturalMusic | ||
{ | ||
class Filter | ||
{ | ||
private String instrumentName; | ||
|
||
public Filter(String instrumentName) | ||
{ | ||
this.instrumentName = instrumentName; | ||
} | ||
|
||
public void SendFilterData(Body body) | ||
{ | ||
CameraSpacePoint rWrist = body.Joints[JointType.WristRight].Position; | ||
CameraSpacePoint rShoulder = body.Joints[JointType.ShoulderRight].Position; | ||
|
||
// X works fairly well | ||
// Y is somewhat bad | ||
// Z is bad | ||
MainWindow.osc.Send(new OscElement("/" + instrumentName + "/filterX", rWrist.X - rShoulder.X)); | ||
MainWindow.osc.Send(new OscElement("/" + instrumentName + "/filterY", rWrist.Y)); | ||
MainWindow.osc.Send(new OscElement("/" + instrumentName + "/filterZ", rShoulder.Z - rWrist.Z)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.