-
happilylazy
@toxonic Thank you very much for your help. Indeed you helped me out a lot with your suggestions, especially to use [bonk~].
[bonk~] is really good, since it allows me to learn specific signal patters (i.e., in my case the hit with the hand on guitar strings), and it is able to detect it in the followup microphone coming from the guitar.
This hit detection got really messy using the [fiddle~] or [sigmund~] since there was a need to filter the power in specific frequency ranges and the amplitude of certain frequencies when the very percussive hit on the guitar strings happens. The problem is really complex if one wants to discern the guitar strings hit during a regular guitar playing with many events happening at the same time.
-
happilylazy
Greetings.
I frequently use a live guitar in my PD patches, I route it through the mic input [adc~]. But now I am facing a problem, that you might help me with.I am interested in detecting in PD the moment of hitting the guitar strings with the hand, e.g. like using a hand to drum on the strings.
It is a very percussing sound, similar to a snare hit.I would like to detect this hit on the guitar strings in PD (coming through [adc~]) and use it as a simple bang trigger.
It would be easy to use the [fiddle~] attack output, but I don't want the trigger on any other guitar playing event (e.g., chords, notes ...) except on this percussive hit on the strings.Do you have any guidance on where to start to tackle this problem?
I don't have the slightest idea where to search for information regarding this topic. -
happilylazy
Wow, thanks a lot for these specific implementation. They look like exactly what I need.
I will try to use them and see how far I can get.But, I was still wondering if masking, or pixel analysis could solve my problem using pure GEM. Simply.
-
happilylazy
Greetings, I have been using PD for audio for a number of years, but now I am boldly exploring the multimedia side of it. So I need a bit of help with my patch.
I am interested in using GEM with live camera to get the information on the moving object on the camera.
More specifically, are the moving objects (changes) present in four quadrants of the image, and what is the minimal distance from the center of the image 'r', as depicted in the image below.Using the pix_background it is easy to extract only the changes on an image and extract moving objects, but how do I detect in which quadrant of the image are these objects present, and what is the minimum distance from the center of the image?
In the case of the illustration, the objects are in the quadrant 1 & 4, and the minimum distance from the center is 'r'.
-
happilylazy
Wow, I actually got this working perfectly, for both of your answers. My external devices are reacting as expected, no glitches or problems.
@NoDSP: That was a good demonstration of how to implement it on low level, definitely useful to implement in patches.
@rjp9: A great patch, thank you. This is a clean robust solution. -
happilylazy
I am trying to sync through MIDI my PD patches and some hardware equipment. The reason is that PD generates music and I jam to it with instruments connected to effects and samplers. The problem is that those samplers and effects are BMP dependent and need this information to perform.
How can I send MIDI clock messages from PD?
I can't seam to find a way of doing this with [midiout] and [noteout].
I am using Win7.p.s. I believe I found some hints that on linux using [midiout] it is possible to do this, but is this exclusive for linux or possible on Win too?
-
happilylazy
To make it more simple.
How to read a complete line of text till carriage return, regardless of symbols present?
I use [ read ecg_data.txt cr ( command to [ textfile ].
-
happilylazy
I need to read a whole line of text (till carriage return) from a file. My text file looks like this
0.000000,16408.875931,106.666691,5251.990296
0.000488,16412.438424,106.666691,5251.990296
0.000977,16412.157174,106.666691,5251.990296
0.001465,16406.750934,106.666691,5251.990296
0.001953,16406.032186,106.666691,5251.990296
0.002441,16402.000943,106.666691,5251.990296
0.002930,16397.688451,106.666691,5251.990296Unfortunately, I can only read one atom at a time with textfile object and bang, as you can see in the attached patch.
I actually need the whole line, but PD stops after comma. How do I do this?
-
happilylazy
I have a set of images i want to make into a stop animation.
I use [pix_image] and [pix_draw] to draw random images, from which I stream into [pix_record].[pix_image]
|
[pix_draw]
|
[pix_record]I am unable to produce video, I breaks after second image.
I was able to create video if using just a static image on Win 7 and up to 4 seconds mjpeg codec 3 video on Ubuntu. I tried pictures of same format, larger-smaller GEM window, all codecs on both systems, and nothing works.
Can you please help out, help me find some setting that would successfully produce video.
Here's my test patch, need ch_gemwin.pd and gemwin_control.pd
-
happilylazy
I am having a problem on setting up timing of events in my PD patch.
What I need is to play "Sine osc~" for 5 seconds, and then a "Saw osc~" for 5 seconds, not playing them both at the same time but interchangeably.
It would be nice if I could repeat this for ever too.Can anyone help to make this in my patch?
I am stuck and it seams like a simple problem. -
happilylazy
Hi everyone,
I am interested in TCP/IP communication from the Unix server to the Pure Data. I have it realized using sockets on the Unix server side, and netclient on the Pure Data side. I exploited the chat-server tutorial for this.
Now the problem lies that the server is streaming the data out as a "string" message delimited with ";"
My question is, is there a way to send something other than string message to Pure Data, like byte-stream or serialized number stream? Can Pure Data receive such messages?
Since string takes too many bytes to transfer, for example number "1024;" is already 5 bytes, while any integer number is just 4 bytes.
-
happilylazy
I need help to build a patch that would change the timbre of a played/recorded instrument, in such a way to match the timbre of another one.
This is to make one instrument sound like another one (both instrument timbres are known).Can you please help me get started and point me to the right direction.
How would one start to create such a patch in Pure Data? -
happilylazy
Thank you very much, [metroplus] was exactly what I needed.
-
happilylazy
Thank you very much, this help a lot. I can see the pattern here.
I created a small patch simulating the proposed behavior.Now the last problem is that I don't want to always play the [osc~] for n milliseconds, but as a composition, first part 500 ms, than 2000 ms, than 200 ms, and so on.
How can I specify a list of intervals (e.g. 500, 2000, 200, ...), which will control the [metro], which actually controls the [osc~]'s?
-
happilylazy
[solved]
BUT BEFORE FOLLOWING THIS, NOTE THAT FLOATING POINT NUMBER IS SOMETHING THAT YOU DON'T WANT TO PARSE, IF YOU LIKE YOUR NERVES.The first problem is
1. Error was in using on the server side an ntohl() on a float number, which corrupts it heavily. Mark my words, ntohl() is an enemy of the float.
Just receive it reversed and manually work out the conversion, you HAVE to do it manually anyways2. Float is a complex standard, even more complex when Pure Data converts everything to decimal partially per byte. Separate Mantissa, Exponent and Sign using bitwise operators [<<][>>], and work out the float conversion.
Follow this thread for Mantissa, that one is the hardest Convert floating point number from binary to a decimal numberGood luck ^^
-
happilylazy
Thank you for your input and your code [kompaqt.core], looking at (socket.AF_INET,socket.SOCK_DGRAM) I realized that I was using the wrong endian method on my UNIX server, it has to be ntohl().
Now I got it correct, and I am receiving data (bytes) in the correct order.>>>: 0 0 0 2 0 10 114 26 0 0 0 51 0 16 242 78
Sample data might be 2 1000000 51 2000.56, which could be read in the data ... somewhat
xxx---------------------------------xxx
which is exactly the opposite of the wrong initial condition
>>>: 2 0 0 0 104 34 9 0 51 0 0 0 235 50 48 69
xxx-----------------------------------------------xxxNow my question is, how do I get four compact numbers to work with?
Now I have a series of bytes, at least in the correct order.I haven't been able to extract the data using [bytes2any] and [route], so I prepared a small patch to demonstrate the problem, maybe you can show me by modifying it?
-
happilylazy
Apparently, I was right about the inverted data in network communications.
Is there a method for correct endianness in Pure Data, like these C functions:ntohs()--"Network to Host Short"
ntohl()--"Network to Host Long"UPDATE:
Thanks for the code kompaqt.core, I'll test it immediately. -
happilylazy
Can you explain how did you do the conversion using [moocow/bytes2any] and [route], or post a sample patch.
I am stuck heavily on this. -
happilylazy
Thank you for the suggestion, I did as you proposed.
I will post the answer here once resolved. -
happilylazy
UPDATE: For everyone that stumbles upon this post in search for the answer.
Apparently [netclient] on the Pure Data side cannot receive nothing else than ; delimited messages.
So the solution for the problem posed above:
My question is, is there a way to send something other than string message to Pure Data, like byte-stream or serialized number stream? Can Pure Data receive such messages?The solution is to use [tcpclient], it can receive byte-stream data.
Now I have another problem regarding the data read, on how to convert it back to usable numbers.
From my UNIX server I am sending a structure
typedef struct {
int var_code;
int sample_time;
int hr;
float hs;
} phy_data;Sample data might be 2 1000000 51 2000.56
When recieved and printed in Pure Data I get output like this:
>>>: 2 0 0 0 104 34 9 0 51 0 0 0 235 50 48 69
You can notice number 2 and number 51 clearly, I guess the others are correct as well. Might be some network inversion of LSB/MSB.
How can I get these numbers back to a usable format?