hid object causing crash
I made a nifty little patch for reading HID information from an Xbox controller and spitting it out all organized, and it was working fine about a month ago.
I finally decided to put it to use and now the HID object causes PD to crash without fail! O no!
When I open the hid help file (which I built my patch from), I click the green box that turns on the hid reading, and as soon as I click the object that lets me choose which hid (channel?) I'm reading, the whole program goes belly-up.
Why is this happening now and not before? Hid worked fine before... Is it my system?
I'm using pdL20rk and ubuntu 16.04
as always, I appreciate the help.
updates: vanilla crashed as well and jstest shows the controller is working fine
also ubuntu generated an error report but I've no idea what it means or what info would be useful to include from it. The most relevant piece seems to be "pd crashed with SIGSEV in hid_poll()"
for every position on the hradio in the help file patch, when I click it the console reads
error: [hid] open /dev/input/event0 failed
error: [hid] can not open device x
where x is the position of the hradio and the variable attached to the open message
FIXED?
for some reason hid was recognizing the controller as device 19, so I made an open message for device 19 and it is polling the controller.
This still doesn't tell me why it was crashing, which is worrisome.
B.14 sampler.rockafella.pd questions
@lovelovevideo Damn...... I thought someone else would reply. It has to do with old technologies and ways of reproducing them on computers.
In ancient times this effect was achieved by speeding up and slowing down the tape (a very long plastic film coated with........ enough..... see here https://en.wikipedia.org/wiki/Magnetic_tape)
Obviously that would also change the pitch. But if the tape head (reading the information) was a complete circle (for domestic stuff like "cassettes" it was a small arc of a circle) then the head could be revolving slowly in one sense or the other, and so read the information at a different speed....... and so compensate for the change in speed of the tape.
Of course in the digital sampling domain the solution has to be different.... but only slightly.
In the analogue example the number of samples (ferrite bits stuck to the tape) being read every second by the revolving head was irrelevant. Not so in the digital domain...... the sample rate being necessarily constant.
To get around this constraint extra copies of samples need to be added when the speed is slow, and some need to be removed when the "tape is running fast" so as to keep the sample rate stable.
Hence the "chunk size" (a revolution of the head) and the continuous re-adjustment of the phase so as to insert (copies) and drop samples as necessary by continuously updating the read point of tabplay......
Of course, when in doubt ask @katjav .........http://www.katjaas.nl/pitchshift/pitchshift.html
David.
Install PD extend on Ubuntustudio
I just installed Ubuntustudio 15.10 Wily Werewolf 32bit on a thinkpad and I am trying to upgrade PD to extend. I am fairly new to linux but it seems like the instructions on https://puredata.info/docs/faq/debian fails.
This is the log from executing the commands. Any suggestions and help will be appreciated
myuser@machine:~$ sudo add-apt-repository "deb http://apt.puredata.info/releases `lsb_release -c | awk '{print $2}'` main"[sudo] password for zoundart:
myuser@machine:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 9f0fe587374bbe81
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.beJyKhm5Lr --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-key 9f0fe587374bbe81
gpg: requesting key 374BBE81 from hkp server keyserver.ubuntu.com
gpg: key 374BBE81: "Hans-Christoph Steiner <hans@guardianproject.info>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
myuser@machine:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key D63D3D09C39F5EEB
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.BDfXAe3l5j --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-key D63D3D09C39F5EEB
gpg: requesting key C39F5EEB from hkp server keyserver.ubuntu.com
gpg: key C39F5EEB: "Launchpad Pure Data" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
myuser@machine:~$ sudo apt-get update
Hit http://no.archive.ubuntu.com wily InRelease
Get:1 http://no.archive.ubuntu.com wily-updates InRelease [64,4 kB]
Get:2 http://no.archive.ubuntu.com wily-backports InRelease [64,5 kB]
Get:3 http://security.ubuntu.com wily-security InRelease [64,4 kB]
Ign http://apt.puredata.info wily InRelease
Ign http://apt.puredata.info wily Release.gpg
Ign http://apt.puredata.info wily Release
Get:4 http://security.ubuntu.com wily-security/main Sources [17,0 kB]
Get:5 http://no.archive.ubuntu.com wily-updates/main Sources [24,1 kB]
Get:6 http://no.archive.ubuntu.com wily-updates/restricted Sources [3 741 B]
Get:7 http://security.ubuntu.com wily-security/restricted Sources [2 854 B]
Get:8 http://no.archive.ubuntu.com wily-updates/universe Sources [6 112 B]
Get:9 http://no.archive.ubuntu.com wily-updates/multiverse Sources [1 922 B]
Get:10 http://security.ubuntu.com wily-security/universe Sources [3 691 B]
Get:11 http://no.archive.ubuntu.com wily-updates/main i386 Packages [59,3 kB]
Get:12 http://no.archive.ubuntu.com wily-updates/restricted i386 Packages [13,4 kB]
Get:13 http://security.ubuntu.com wily-security/multiverse Sources [1 922 B]
Get:14 http://no.archive.ubuntu.com wily-updates/universe i386 Packages [31,0 kB]
Get:15 http://no.archive.ubuntu.com wily-updates/multiverse i386 Packages [6 052 B]
Get:16 http://security.ubuntu.com wily-security/main i386 Packages [43,4 kB]
Err http://apt.puredata.info wily/main i386 Packages
404 Not Found
Ign http://apt.puredata.info wily/main Translation-en_US
Get:17 http://no.archive.ubuntu.com wily-backports/main Sources [750 B]
Get:18 http://security.ubuntu.com wily-security/restricted i386 Packages [10,8 kB]
Get:19 http://no.archive.ubuntu.com wily-backports/restricted Sources [28 B]
Ign http://apt.puredata.info wily/main Translation-en
Get:20 http://no.archive.ubuntu.com wily-backports/universe Sources [833 B]
Get:21 http://no.archive.ubuntu.com wily-backports/multiverse Sources [28 B]
Get:22 http://no.archive.ubuntu.com wily-backports/main i386 Packages [606 B]
Get:23 http://security.ubuntu.com wily-security/universe i386 Packages [24,8 kB]
Get:24 http://no.archive.ubuntu.com wily-backports/restricted i386 Packages [28 B]
Get:25 http://no.archive.ubuntu.com wily-backports/universe i386 Packages [714 B]
Get:26 http://security.ubuntu.com wily-security/multiverse i386 Packages [6 052 B]
Get:27 http://no.archive.ubuntu.com wily-backports/multiverse i386 Packages [28 B]
Hit http://no.archive.ubuntu.com wily-backports/multiverse Translation-en
Hit http://no.archive.ubuntu.com wily-backports/restricted Translation-en
Get:28 http://security.ubuntu.com wily-security/main Translation-en [23,2 kB]
Hit http://no.archive.ubuntu.com wily/main Sources
Hit http://no.archive.ubuntu.com wily/restricted Sources
Hit http://no.archive.ubuntu.com wily/universe Sources
Get:29 http://security.ubuntu.com wily-security/multiverse Translation-en [2 536 B]
Hit http://no.archive.ubuntu.com wily/multiverse Sources
Hit http://no.archive.ubuntu.com wily/main i386 Packages
Hit http://no.archive.ubuntu.com wily/restricted i386 Packages
Hit http://no.archive.ubuntu.com wily/universe i386 Packages
Get:30 http://security.ubuntu.com wily-security/restricted Translation-en [2 666 B]
Hit http://no.archive.ubuntu.com wily/multiverse i386 Packages
Hit http://no.archive.ubuntu.com wily/main Translation-en
Hit http://no.archive.ubuntu.com wily/multiverse Translation-en
Hit http://no.archive.ubuntu.com wily/restricted Translation-en
Get:31 http://security.ubuntu.com wily-security/universe Translation-en [15,2 kB]
Hit http://no.archive.ubuntu.com wily/universe Translation-en
Hit http://no.archive.ubuntu.com wily-updates/main Translation-en
Hit http://no.archive.ubuntu.com wily-updates/multiverse Translation-en
Hit http://no.archive.ubuntu.com wily-updates/restricted Translation-en
Hit http://no.archive.ubuntu.com wily-updates/universe Translation-en
Hit http://no.archive.ubuntu.com wily-backports/main Translation-en
Hit http://no.archive.ubuntu.com wily-backports/universe Translation-en
Fetched 496 kB in 7s (70,7 kB/s)
W: Failed to fetch http://apt.puredata.info/releases/dists/wily/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
myuser@machine:~$ sudo apt-get install pd-extended
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package pd-extended is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'pd-extended' has no installation candidate
Achieving Polyphony with ASCII numbers as MIDI control
@mholes1 You might be able to do it using [key] and [keyup]....... needs looking into unless someone has done it already....... woof! Gilberto will know (or EEight)! If you turn the note on with [key] and off with [keyup] that might do it!
hid.zip (you need to right click for help the [hid] object about half way down on the left hand side).......
Here it is (I can no longer remember what was in the original Pd that I downloaded)......
hid.pd
David.
P5 glove-\>P5osc-\>Pd
I have usb device (non HID) that sends X, Y, Z (and more) signals via OSC messages that I'm reading in PD. I very much need to send it into [hid] library for re-routing to various axis, but cannot find a way to build a patch to take OSC > PD patch(?) > [hid]. Basically that takes [int] OSC messages, converts to a simulated HID device, then feeds into the [hid] library, then reroute using [hid] as normal.
Do you have any ideas or a patch that might work?! Any help would be much much appreciated... Thanks.
http://www.pdpatchrepo.info/hurleur/Screen_Shot_2014-05-09_at_14.54.01.png
P5 glove-\>P5osc-\>Pd
I have usb device (non HID) that sends X, Y, Z (and more) signals via OSC messages that I'm reading in PD. I very much need to send it into [hid] library for re-routing to various axis, but cannot find a way to build a patch to take OSC > PD patch(?) > [hid]. Basically that takes [int] OSC messages, converts to a simulated HID device, then feeds into the [hid] library, then reroute using [hid] as normal.
Do you have any ideas or a patch that might work?! Any help would be much much appreciated... Thanks.
http://www.pdpatchrepo.info/hurleur/Screen_Shot_2014-05-09_at_14.54.01.png
Unable to lower resolution of unibrain webcams.
yup!
It's super weird.
[pix_videoDarwin]: using RGB
[pix_videoDarwin]: height 480 width 640
[pix_videoDarwin]: starting reset
[pix_videoDarwin]: SG channnel Device List count 6 index 4
[pix_videoDarwin]: SG channnel Device List DV Video
[pix_videoDarwin]: SG channnel Device List DVCPRO HD (1080i50)
[pix_videoDarwin]: SG channnel Device List DVCPRO HD (1080i60)
[pix_videoDarwin]: SG channnel Device List DVCPRO HD (720p60)>
[pix_videoDarwin]: SG channnel Device List IIDC FireWire Videofstg
[pix_videoDarwin]: SG channnel Device List USB Video Class Video
[pix_videoDarwin]: SG channnel Input Device List 0 unibrain Fire-i
error: [pix_videoDarwin]: SGSetChannelDevice returned error -9408
error: [pix_videoDarwin]: SGSetChannelDeviceInput returned error 709
[pix_videoDarwin]: vdigName is unibrain Fire-i
[pix_videoDarwin]: digitizer rect is top 0 bottom 1200 left 0 right 1600
[pix_videoDarwin]: active src rect is top 0 bottom 1200 left 0 right 1600
that's kind of the extent of the messages and I don't really know what to make of it. What's with all that HD jazz? I certainly don't want that.
but yeah, so far, I can only get 1200 1600 and higher. Maybe if I worked in YUV?
edit: I forgot to mention that I'm running a macbook pro with snow leopard.
Changing length of beats/steps/something......?
Hi,
I've got a quick question to Maelstroms patch.
When I hit [stop( once while playing, then [play(, the counter are out of sync, meaning, they don't hit 0 at the same time anymore.
When I hit [stop( twice before hitting [play( again, the counter are in sync.
So, for now I fixed it for my needs with a [delay], sending the needed second hit.
But I would really like to understand what is going on.
Is it something I'm doing wrong or what?
Anyway, thanks for the awesome inspiration with the clock solution.
Regards,
j
Processing to communicate with Pd
hey Arif, thanks for the reply. I have input what I think is right. Still no joy. Now it is disagreeing with CoordsCalc. I have included the code. I already had some of the things from the example. I think I just need to add integers but I dont know how or what to put.
import processing.video.*;
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
Capture video;
int numPixels; // number of pixels in the video
int rectDivide = 4; // the stage width/height divided by this number is the video width/height
int vidW; // video width
int vidH; // video height
int[][] colouredPixels; // the different colour references for each pixel
int[][] colourCompareData; // captured r, g and b colours
int currR; //
int currG; //
int currB; //
int[][] squareCoords; // x, y, w + h of the coloured areas
color[] colours; // captured colours
int colourRange = 25; // colour threshold
int[][] centrePoints; // centres of the coloured squares
color[] pixelColours;
boolean isShowPixels = false; // determines whether the square and coloured pixels are displayed
int colourMax = 2; // max amount of colours - also adjust the amount of colours added to pixelColours in setup()
int coloursAssigned = 0; // amount of cours currently assigned
CoordsCalc coordsCalc;
void setup()
{
size(640, 480);
vidW = width / rectDivide;
vidH = height / rectDivide;
video = new Capture(this, vidW, vidH, 30);
noStroke();
numPixels = vidW * vidH;
colouredPixels = new int[vidH][vidW];
colourCompareData = new int[colourMax][3];
squareCoords = new int[colourMax][4];
colours = new color[colourMax];
centrePoints = new int[colourMax][2];
color c1 = color(0, 255, 0);
color c2 = color(255, 0, 0);
pixelColours = new color[colourMax];
pixelColours[0] = color(0, 255, 0);
pixelColours[1] = color(255, 0, 0);
coordsCalc = new CoordsCalc();
oscP5 = new OscP5(this, 12000);
myRemoteLocation = new NetAddress("127.0.0.1", 12000);
}
void captureEvent(Capture video)
{
video.read();
}
void draw()
{
noStroke();
fill(255, 255, 255);
rect(0, 0, width, height);
drawVideo();
coordsCalc.update();
for (int i = 0; i < coloursAssigned; i++)
{
if (isShowPixels) drawSquare(i);
}
background(0);
}
void mousePressed() {
/* in the following different ways of creating osc messages are shown by example */
OscMessage myMessage = new OscMessage("/test");
myMessage.add(colourLocation); /* add an int to the osc message */
myMessage.add(colourLocation);
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
/* incoming osc message are forwarded to the oscEvent method. */
void oscEvent(OscMessage theOscMessage) {
/* print the address pattern and the typetag of the received OscMessage */
print("### received an osc message.");
print(" addrpattern: "+theOscMessage.addrPattern());
println(" typetag: "+theOscMessage.typetag());
}
}
void drawVideo()
{
for (int i = 0; i < coloursAssigned; i++)
{
fill(colours_);
rect(i * 10, vidH, 10, 10);
}
image(video, 0, 0);
noFill();
stroke(255, 0, 0);
strokeWeight(2);
rect(vidW - 4, vidH - 4, 4, 4);
}
void drawSquare(int
{
int sqX = squareCoords_[0];
int sqY = squareCoords_[1];
int sqW = squareCoords_[2];
int sqH = squareCoords_[3];
noFill();
stroke(0, 0, 255);
strokeWeight(3);
rect(sqX, sqY, sqW, sqH);
//stroke(0, 0, 255);
//strokeWeight(4);
rect(sqX * rectDivide, sqY * rectDivide, sqW * rectDivide, sqH * rectDivide);
line(sqX * rectDivide, sqY * rectDivide, ((sqX * rectDivide) + (sqW * rectDivide)), ((sqY * rectDivide) + (sqH * rectDivide)));
line(((sqX * rectDivide) + (sqW * rectDivide)), sqY * rectDivide, sqX * rectDivide, (sqY * rectDivide + sqH * rectDivide));
}
void keyPressed()
{
println("key pressed = " + key);
color currPixColor = video.pixels[numPixels - (vidW * 2) - 3];
int pixR = (currPixColor >> 16) & 0xFF;
int pixG = (currPixColor >> & 0xFF;
int pixB = currPixColor & 0xFF;
if (key == 'p')
{
isShowPixels = !isShowPixels;
}
if (key == '1')
{
coloursAssigned = 1;
colourCompareData[0][0] = pixR;
colourCompareData[0][1] = pixG;
colourCompareData[0][2] = pixB;
colours[0] = color(pixR, pixG, pixB);
}
if (colourMax < 2 || coloursAssigned < 1) return;
if (key == '2')
{
coloursAssigned = 2;
colourCompareData[1][0] = pixR;
colourCompareData[1][1] = pixG;
colourCompareData[1][2] = pixB;
colours[1] = color(pixR, pixG, pixB);
}
if (key == '0')
{
coloursAssigned = 0;
}
}_____
MIDI Drums
I am trying to use MIDI to trigger specific drum hits, attached best guess. I am trying use specific keys for different drum hits loaded into arrays. The values that seem to be comming out of my [== 36], to try and trigger specific hits, seem to be right but I am still get a drum hit no matter which key I press.
Any ideas thanks