-
percy
Hi folks,
quick query,Basically, I am wanting to play a film at various points on a midi keyboard, having each key play a different part of the film. A person will then be able to 'make music' with the sound of the film which happens to be a sine tone.
It is fairly simple i guess and I am sure not too difficult to implement right?
I have loaded the video with Gem using pix_movie thing. Only it is just flashing green and not playing the whole film.
I have the sound as a separate file which I will call up using a load bang into an array. Somehow i need to split this so at different points it can be played on a midi keyboard. Would I have to actually split up the audio file in Logic or whatever or is there some kind of array function where it could just cut to the desired point corresponding with a midi note pressed.
Anyone have any help for this it would be amazing. Just some pointers.
Thanks in advance guys.HP
-
percy
Hi there folks,
I am trying to get Pd to control certain effects in Logic using the ctlout object. Data is coming into Logic from Pd which I can see in the bottom of the transport bar. I just need to route that data in Logic so that Pd is controlling a filter.
I guess this is a question for Logic but I figured that maybe one of you guys would know.
Hope someone could please help me with this - haven't been able to find solution anywhereta,
P -
percy
Hi, i know this is maybe more of a Processing problem than a Pd one, but I figured i would try posting on here too -
I really need my Processing color detection patch to hook up to Pd via Osc. I already have the P5 library in my Processing folder.
I have my Pd patch ready to go - I think all I need is to enter some code into Processing and frankly, I do not know where to begin with this stuff.if anyone could help or point me in the right direction that would be swell. i have already looked for help all day over the net and on Processing.org. Worth a shot though...
thanks!H
-
percy
Hello, I am in need of some help in this matter if anyone could oblige...
I have OSC data of X and Y axis (numbers from 0 - 500) coming out of my webcam via Processing and into Pd. I have some midi notes set out at the bottom which i want to be triggered from the OSC data at specific points.
I tried using moses to play a note - ie if number is less than 60 then play C or such and such - but the data is so fast that the note does not sound properly.Also I tried using moses to say if number = 60 then play C - but again the data was too fast.
Is there any way I can slow it down or use some other function - I tried the 'sel' object but I it did not work for me and I'm not sure I understood its function properly. Perhaps a spigot but then I don't think that worked either.
I have included my patch to clarify things. I am sorry if this message is confusing in its wording, ive been working on this all day and evening and my brains are scrambled....
many thanks if you can help
H -
percy
Hi there, can anyone please help me with this?
Can someone please explain every step of using the writesf function? It is so confusing and have not been able to find any info on it.Okay here is my patch:
[open blablabla.wav(
[start(
[stop(
[writesf~]
I have compute audio on already before I do anything. I then press open blabla, then I'm pressing start, then after one minute which is the length i need i press stop.
The file is in there but I hear nothing.some help would be greatly appreciated!
argh!P
-
percy
Hi all, i know this is probably an annoying question but Im trying to record a minute long sample of my patch using writesf. I think Ive got the patch hooked up correctly and it drops the wav file in my folder only there is nothing on the wav file. Its always 4kb and does not play anything.
Ive looked in this forum and gogled the problem for the last few hours to no avail. Any help would be greatly appreciated!
cheers
H -
percy
Hi all I'm rather new to pd just getting to grips with it.
My problem is that pd keeps quitting by itself every time i switch off 'compute audio'
its driving me crazy.
I went into preferences, audio device, changed input audio from 'built in microphone' to 'built in input' - then when i click OK or apply it quits unexpectedly again.Ive tried uninstalling pd then reinstalling, and also restarting the machine, switching on and off as well.
I'm using a few weeks old mac with Leopard. I'm new to mac so am still getting to grips with it...
I really hope i can get this sorted as I really want to start using pd! It worked on my machine before for the last 2 weeks.
any help in this matter would be greatly appreciated!thanks in advance
P
-
percy
Not sure if you have this sorted but I have this cool patch which sounds like it could be useful. There is a playback speed slider where you can ffwd and rewind a loaded sample.
http://www.pdpatchrepo.info/hurleur/22_Reading_Audio-files_[tabread]_.pd
-
percy
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;
}
}_____ -
percy
excellent thanks! yeah, I got it in the end. Change object was what I was looking for! For this project I'm going to be using a webcam looking at some fish which will control the pitch and velocity of a note on the x and y axis.
Thanks again for the reply!