-
Hasselbalch
I opened up this thread on a complete whim, how lovely to see a response after so many months.
I tried out your code, alexandros - and it works just fine. I tried to add the rest of the pwm pins to the array and it worked just fine.
Can you explain why the message needs to start with "print" to work?Also, I've found it can only take integers, so it will misread floating point numbers and read the decimal numbers as the PWM value.
Of course I can just pass whatever number box or slider through a [i] object beforehand, but just out of curiosity, how would one allow floating point numbers in that code example?Thank you.
-
Hasselbalch
[line~] seems to work just great. Thank you so much, weightless and, as always, whale-av.
-
Hasselbalch
Great, just what I need. I just played around with it, I seem to get some crashes with that, I haven't tested it enough to be more specific than that right now.
And the age old question: what's the best way to get a clickless amp envelope? Any sort of quick ramp sent to
[*~]
will create clicks, no matter what. It needs to be a very, very slow ramp before the clicks are not a problem. -
Hasselbalch
Wonderful, thank you. I misunderstood the order of the variables for the bounds message. I guess I could simplify it with an
expr
conditional.Is there a Pd equivalent to Max's
function
object? Just a breakpoint editor capable of making smooth envelopes.
And is there a way to make avoid drawing outside of the array? When I draw, it will allow me to go beyond the bounds of the visible square. I just useclip
to avoid it spitting out the values, but it would be nice to have it within the actual array window. -
Hasselbalch
Maybe that's it. I'm not too well-versed in reading the verbose error messages.
Here is the patch. I can't say for certain, but it seems to be the "y max" numbox that causes the problem.#N canvas 0 22 450 300 10; #N canvas 426 51 662 508 \$0ampenv 0; #N canvas 651 72 450 278 (subpatch) 0; #X array \$0array 99 float 1; #A 0 0.971429 0.971429 0.785714 0.785714 0.790476 0.795238 0.8 0.802857 0.805714 0.808571 0.892857 0.892857 0.892857 0.892857 0.892857 0.892857 0.892857 0.886905 0.880952 0.875 0.869048 0.863096 0.857143 0.844643 0.832143 0.819644 0.807144 0.791072 0.775001 0.75893 0.849995 0.842852 0.828567 0.814281 0.79821 0.782139 0.766068 0.749996 0.728568 0.70714 0.685711 0.666069 0.646426 0.626783 0.607141 0.589998 0.572855 0.555713 0.53857 0.521427 0.50357 0.485713 0.467856 0.449999 0.435714 0.421428 0.407143 0.4 0.364292 0.350007 0.328578 0.314293 0.278579 0.264293 0.25715 0.250008 0.242865 0.235722 0.228579 0.221436 0.214294 0.207151 0.200008 0.192865 0.17858 0.171437 0.164294 0.160723 0.157151 0.150009 0.135723 0.12858 0.107152 0.0928664 0.0785808 0.0571525 0.0571525 0.0428669 0.0357241 0.0357241 0.0357241 0.0285813 0.0357241 0.071438 0.0857236 0 0 0 0; #X coords 0 1 98 0 200 140 2 0 0; #X restore 102 121 graph; #X floatatom 388 265 5 0 0 0 - - -, f 5; #X obj 388 294 tabread \$0array; #X msg 372 108 resize \$1; #X obj 372 130 s \$0array; #X floatatom 372 80 5 0 0 0 - - -, f 5; #X obj 372 -13 loadbang; #X msg 372 49 99; #X msg 452 190 bounds \$1 \$2 \$3 \$4; #X floatatom 452 88 5 0 0 2 x_min - -, f 5; #X floatatom 492 88 5 0 0 2 x_max - -, f 5; #X floatatom 532 88 5 0 0 2 y_min - -, f 5; #X floatatom 572 88 5 0 0 2 y_max - -, f 5; #X obj 452 157 pack f f f f, f 20; #X obj 452 212 s \$0array; #X msg 451 16 0; #X msg 481 16 98; #X msg 511 16 1; #X msg 541 16 0; #X obj 388 338 outlet; #X floatatom 307 131 5 0 0 2 xmin - -, f 5; #X floatatom 307 161 5 0 0 2 xmax - -, f 5; #X floatatom 307 191 5 0 0 2 ymin - -, f 5; #X floatatom 307 221 5 0 0 2 ymax - -, f 5; #X floatatom 388 316 5 0 0 0 - - -, f 5; #X obj 588 17 bang; #X connect 1 0 2 0; #X connect 2 0 24 0; #X connect 3 0 4 0; #X connect 5 0 3 0; #X connect 6 0 7 0; #X connect 6 0 15 0; #X connect 6 0 16 0; #X connect 6 0 17 0; #X connect 6 0 18 0; #X connect 7 0 5 0; #X connect 8 0 14 0; #X connect 9 0 13 0; #X connect 10 0 13 2; #X connect 10 0 25 0; #X connect 11 0 13 1; #X connect 11 0 25 0; #X connect 12 0 13 3; #X connect 12 0 25 0; #X connect 13 0 8 0; #X connect 15 0 9 0; #X connect 16 0 10 0; #X connect 17 0 11 0; #X connect 18 0 12 0; #X connect 20 0 9 0; #X connect 21 0 10 0; #X connect 22 0 11 0; #X connect 23 0 12 0; #X connect 24 0 19 0; #X connect 25 0 9 0; #X coords 0 -1 1 1 260 175 2 100 100; #X restore 31 32 pd \$0ampenv;
-
Hasselbalch
Hello. I'm messing about with creating envelope generators in Pd using arrays.
I've tried to make the array's settings easily changeable to allow it to work for amplitude, pitches and other uses, using variables sent to a message for the array.
But I've found that most of the time with this setup I just patched up I will, with a lack of better words, break Pd, get a bunch of error messages in the terminal and number boxes will stop showing changes, alongside dragging in values on the array.The patch in questions and the error message is shown here:
The values shown in the picture work fine, those are set up as an amp envelope. Changing certain parameters will break it, I can't quite be sure which. Sometimes I will just get the "graph: empty bounds rectangle" message, which will usually be followed by the more verbose error message.
The changes seem to be made, but it just won't show it. I have to completely quit Pd and open it again for it to return to normal.
As soon as the error message occurs, the number boxes will freeze and add "..." to the end, as if the number shown exceeds the width of the box, which is not the case.
I assume I'm running Pd into a wall, placing values that are out of bounds for the given array, but I can't tell how and why. It's my first venture into using graphical envelopes, I've usually just used the more primitive version of line ramps and delayed signals to get regular adsr envelopes.
Can anyone tell me what I might be doing wrong here?
I'm running vanilla 0.47.1 on a Macbook Pro running El Capitan.
Thank you.
-
Hasselbalch
@whale-av, ah. Thank you. The [echo message] prefix seem to give a readout with [print STDOUT] in Pd's own log/terminal, but nothing happens in osx terminal. Nothing is printed in there nor is it executed.
The format I need to use for the app, cliclick is [cliclick c:x,y] which will execute a button press on a specific point. But a comma seems to divide the messages sent to [shell] as it prints out [shell: old process still running]. So if [shell] interprets a comma as a command divisor, I might not be able to use without a workaround.
I read through the second thread as well, but I couldn't really find the answer. I might be way in over my head with this.
-
Hasselbalch
@youaresound, I tried that, but with no result. And [system] has got no outlet for me to print out any possible error messages.
If anyone has successfully used [shell] to send commands to the osx terminal, I'd like to hear how.
-
Hasselbalch
That seems to work as well, thanks.
Is there a simple way to send commands to the osx terminal using the [shell] object? I can't get it to pass anything usable through [shell], I can't figure out if I have to use a certain prefix or not.
All the examples I've found online are to do with specifying a directory, moving or creating files - all I want to do is pass a command as if I had typed into the terminal window itself. -
Hasselbalch
Thanks, @macrogmittrei.
I checked to see what I could do about using xdotool with Mac, and found another shell app, Cliclick (https://www.bluem.net/en/projects/cliclick/). It seems fairly simple and I can get it to click at specific points.
I have never used [shell] before and I'm not well-versed in shell/terminal use, so I'll have to see what I can do. The help documentation for [shell] is not a lot, but I suppose it assumes I know what I'm doing.
I just need to get pd to send some single lines of text to the terminal. -
Hasselbalch
It's Mac. Webdriver might be useful! Is there a way to have pure data communicating with webdriver?
Thank you. If there's any other suggestion, please let me know.
-
Hasselbalch
Hello.
I'm trying to control the curser position and click of the mouse through pd, but outside of a pd window. Specifically in a browser.
There's a button a website that makes a particular sound when clicked, and I would like to sequence some clicks if possible. Of course it would be easier to sample it, but I would like to see if it's possible using pd.Is there a way to do this? Position the mouse, bang a click? Or perhaps there is a way to communicate with some kind of browser command line? When you receive this, click this button in the browser window.
Looking through other recent threads I've found it's possible through the use of this solution: https://forum.pdpatchrepo.info/topic/11291/mouse-control-objects
But it is, as far as I can see, limited to the pd window itself.Any ideas?
Thank you.
Mh. -
Hasselbalch
Hello. I'm working on an Arduino code and accompanying Pd patch, sending values from Pd to Arduino to control the PWM value sent to certain digital pins.
As of now, the code parses incoming strings in the format int,int and ends with a carriage return. This works just fine when sending the string from the Arduino software's own serial monitor, but I cannot seem to get it work when sending messages to the [comport] object. Right now I'm just using a single banged message box (ex. [3,80]) sent to [comport], so I suspect that I need to end the message with a carriage return in some format.
How would I go about doing this? I know \ is not allowed in Pd messages. What format does the Arduino understand in this situation? Ascii?
In the code below, I suppose I could change the string terminating character to something other than a carriage return, but I would be unsure of how to execute it properly.
I'm quite new to the Arduino platform, so if anything looks and sounds completely off, please do tell me.
void setup() { Serial.begin(9600); } String command; void loop() { if (Serial.available() > 0) { char c = Serial.read(); if(c == '\n') { parseCommand(command); command = ""; } else { command += c; } } } void parseCommand(String com) { String part1; String part2; //int SPACE int part1 = com.substring(0, com.indexOf(",")); part2 = com.substring(com.indexOf(",") + 1); int pin = part1.toInt(); int pwmval = part2.toInt(); analogWrite(pin, pwmval); }
Thank you.
-
Hasselbalch
Hello there.
I haven't done a lot of pd systems involving visuals, so I'm unsure of how evolved and documented the video-oriented side of PD is.
I'm in the very early stages of experimenting with what will eventually be an interactive system controlling physical parameters.Right now, the idea in its core is this: A pd patch reads/scans a pre-recorded or live-input video source and based on what values can be extracted in realtime (or offline), these values will control various stages of the system.
At this stage I am not interested in synthesising visuals with GEM, but to "read" the information of a real-time video source. Something along the lines of movement, colour, contrasts, the ratio of light versus dark in the video, maybe scans of grain, framerate and so forth.Are there any places I can find documentation on similar systems? I imagine I would have to incorporate a second application of sorts, a program to analyse and output the video data that I could then patch into PD and use as control-values.
Any and all information and suggestions will be appreciated.
Thank you.
Mh.
-
Hasselbalch
That did the trick. Does it just revert the settings back to 'factory' settings? I never changed the values in the window since I never could. So the settings it reverts back to is what it already was set to. Either ways, thank you very, very much.
M
-
Hasselbalch
Hello.
I've run into an odd issue. I recently started using Pd vanilla (0.47-1 on OSX El Capitan) instead of Pd-extended.I've found that if I open the 'audio settings' window found under the 'media' tab, I can't for the life of me close it again, no matter what I do.
At first I thought it was because I changed the settings to something PD wouldn't accept, but I've found that I just have to open the window, even if I don't do anything, I still can't close it. The window itself is not frozen, it's just unresponsive. Pressing 'x' in the window does nothing, pressing 'cancel' or 'ok' does nothing.
When the window is open I can't do anything on the open patch. I can navigate the menus and turn dsp on and off in the console, but pressing anything in the menus does nothing. I've tried to set the console to show all messages, but there is nothing to show, no useful error messages or anything alike.
The only thing I can do is force quit the application and open it again.
It isn't connected to any audio interface at this point, just the Macbook's built-in outputs. I haven't had it set up to any external interface since I made the jump to vanilla.
Has anyone run into this before?
Thank you in advance.M
-
Hasselbalch
Hello Dxk,
Yours are the exact instructions I tried to follow a few days ago.As of now, I'm still a whole lot wiser. As far as I've understood, libraries that are contained in a single file are to be added to the "startup" for load at start-up. Libraries consisting of a folder with multiple, separate files should be added to "path".
First off, the Deken manager downloads the libraries to a folder called "extra", not "pd-externals" or something similar. I've got no folder called that. I couldn't access the folder through the "choose folder"-prompt, since I have to access the contents of the Pure Data application, so I had to create a desktop shortcut to which I could easily choose the "extra"-folder when adding paths to "path".
This is what I am greeted with on start-up.
And it just keeps going all the way down. It seems to go through the contents of the libraries, but gives me a failed message. I now see that it looks for the contents of the zexy library in the folder of cyclone and tries to look for the files in neighbouring folders. Why would it do that?
But, say I call up an object I know only exists in an external library, say, cyclone's [cycle~] object, I will get this:
The first few lines show that it's trying to look for the library contents in my main folder (users/marc). I can't see why it would try that. It then tries the paths, fails, but then succeeds.
This is what my "startup" and "path" folders look like, respectively:
And the contents of the "extra" folder:
Thank you, in advance.
-
Hasselbalch
Hello,
I migrated from Pd Extended to Vanilla (0.47-1) a few days ago. I've tried to familiarize myself with the handling of externals and the Deken manager, which seems to slowly become more understandable the more I work with it.
But today I've run into some odd issues I never experienced with Pd-extended.
– First of all, the console is a mess of "tried to load, failed" and "tried to load, succeeded" at every start up, which is understandable, but I can't seem to figure out what to take from it. Sometimes I get both the "failed" and "succeeded" version of a message one after the other, regarding the same library/external. Sometimes it will claim to have failed trying to load a given external, but I can call up the objects just fine without having to [declare] or use the [name/*object] initialization.
I would assume that I have made too much of a mess trying to add the paths to "path" and "start up". So I guess it's trying to look for certain things in subfolders where it's not? The issue is that everything seems to load up correctly, but I still get a ton of misleading console messages.
– This one is odd. After having loaded up Pd and scrolling up through the console's many, many messages, I will get to the "credits" message of the zexy external, but it will lag and freeze for a moment before reaching it, sometimes multiple times before allowing me to scroll by it smoothly.
– I tried to continue work on a patch, a 4 channel random sample player. The gui elements will sometimes freeze after pressing play and running everything, which renders all gui elements unresponsive, though I can still operate the patch, but just with no update. From here on out I can't close any patches or windows, nor can I go into patch mode, I simply have to close down Pd and open it again.
I understand that many gui elements can be taxing, but I really haven't got a lot of them going on. I have worked on patches far more graphically taxing in Pd-extended without any problems what so ever. In fact, I've never had any issues like this with Pd-extended.
There is some [metro] objects banging at 100 ms intervals to update the 4 individual audio arrays, but stopping those didn't seem to help a whole lot.
Everytime a sample has ended, it will bang and choose a new sample for immediate playback, sometimes the whole patch system seemed to stop, seemingly as if not being able to handle the stream of information. Again, no issues in Pd-extended.I hope you'll be willing to help me out here. I suspect that the first order of business is to clean up the "path" and "startup" menus to clear up the system, but I'm unsure about how I would go about that.
Thank you
M. -
Hasselbalch
Sure, that's understandable. Thank you very much, that's just what I needed.
M.