-
dhk
Hello forum,
I am making patches which at the end are going to be used by normal people. Most normal people have forgotten, or never knew, that there once were problems with using spaces in file- and folder names.
For most occasions I get rid of this problem by using [to/fromsymbol]. Now, just by accident, I happen to have a folder with two consecutive spaces, and this breaks the [to/fromsymbol] fix. [coll] will not write to it.
Is there any way to make rock solid solution, allowing the use of all characters the system alows? I don't want the end users to have to worry about this. When something like this doesn't work, it's near impossible for them to know why.
All best,
Dag Henning -
dhk
Hello there,
Is there any way of grabbing error messages from the pd window, like [error] in Max/MSP?
(Reason in this particular case: when trying to load a aif into a table, nothing happens except a format-related error message in pd. I would like to take some action when this happens. Any other workaround suggestions?)
-
dhk
Hello,
Since nobody answered the "[wavinfo] equivalent for aiff files?" question, I suppose the answer is "no".
If so: what do people here do to determine whether a soundfile (which could be aiff) is mono or stereo? In other words: what's the most efficient way of querying an array for non-zero? Are there any useful command for this, or do I have to iterate through the array?
-
dhk
Hello dear list!
I would love to be able to check an atom for its data type - whether it is float or symbol, specifically. Can this be done, you think?
-
dhk
E.g., [gate 20] gets out ports which are impossible to find individually. Any solution to this? Or should I consider this a design flaw?
-
dhk
Hello,
I would very much like pd midi in (specifically, note in, for now) to behave like the MaxMSP default behaviour "All channels by device". Which means that the user of my patch doesn't need to set any MIDI settings to start playing - the patch takes note in messages from any connected MIDI device.
Is this possible?
-
dhk
Hi!
I'm making a simple vibrato/chorus effect in pd, using a vd~ modulated by an osc~. Unfortunately, the modulated sound is rather steppy. How do I achieve a smoother sound?
I suspect the osc~ is the issue here. From reading the help file, I don't know how the sine wave is made – whether it is mathematically computed, or read from a wavetable, like cycle~ in MaxMSP.
So, should I try and upsample in a subpatch (is that possible?), or make use of a higher resolution wavetable, e.g. in tabread~?
Thanks in advance!
-
dhk
Yes, that seems logical. But how do I add a filename to the folder path without leaving the symbol domain? I tried [sprintf %s/%s], but that needs another [tosymbol], and multiple consecutive spaces in folder names are lost.
Sorry for being a symbolic idiot.
-
dhk
Well, I'm not saving the paths in the message boxes, but storing them temporarily. As I said, the user choses a folder, and on later occasions a file must be written to this folder.
Where would you temporarily store paths?
-
dhk
@mod again: yes, this is the same way my patch is working (other than me using [prepend write] instead of [write $1( ). The problem is when you have two or more *consecutive* spaces, like this: [/path/my folder name with more spaces in it/filename.coll (
Does this work for you?
More observations from my "stupid user" research:
-
The only illegal character in OSX, the colon, is impossible to use in file- and folder names, whether you try from the Finder, or from a pd save dialog. Conclusion: no problem here. I suppose it's the same situation in Windows and Linux?
-
For folder and file names with slashes in them fetched from the file system, a slash gets converted to a colon while in pd, and converted back to slash going out of pd. This, of course, works just fine only because the colon is illegal in OSX files and folders. Conclusion: no problem.
-
If, however, you choose to save a file through the pd save dialog with a slash in its name, you're in trouble. Nothing gets saved. Conclusion: problem. (My end users will not be able to see the pd window warnings.)
Note that my stupid user is never editing or writing anything in the patch. He is only opening a folder, and later my patch will write a coll file to that folder. So the last example is not relevant for my specific use.
-
-
dhk
Thanks for the replies.
@mod:[list2symbol] does the same as [tosymbol] here, while [list-l2s] rids you of spaces altogether. Tried a bit with %20 with no success, but I have no idea how it should work if it ever will.
I think I found the problem, anyway: message boxes always truncates consecutive spaces to one when it sends the message.
Still: any way to solve this problem? I.e., the challenge is: any way to save, say, a coll file to a folder with two or more consecutive spaces, without going through a save dialog?
-
dhk
Thanks for the answers.
Although I'm in a project which is very restrictive wrt including externals, I would like to check out iem_tab. Where can I get it? I already use pd extended, but iem_tab is listed as "unsupported" on puredata.info.
I'm making a sampler for use with Macs, so excluding aiff is not something I will do with a light heart.
I've tried briefly an iteration method which is [counter]-driven, and it doesn't really work – it gives up after a few hundred iterations with a stack overflow message. Slowing the iteration down with a delay works, but has the side effects of either slowing the sampler usage down (for long samples) with using >= 1 ms delay, and/or risking a cpu usage burst by using, say, 0.001 ms delay. Sample loading is done by folder, so several hundred samples (including layers) may get loaded and iterated through at the same time...
I'm considering a dirty solution like combining a periodic sample check (100 for each sample, maybe, evenly distributed) with maybe 100 random checks. Not 100% waterproof, and still a potential cpu burst with many samples loading simultanuously. Any other ideas?
-
dhk
I would also be interested in this (yes, it's a bump:)
…For some other reasons, though: to get the number of channels in the file, and the bit rate (so I can reject any 24-bit aiff files from the sampler I'm building).
(…because there's still no way to make 24-bit aiffs to play nicely, is there?)
(EDIT: I managed to make a 24 bit aiff play by using the -raw flag for [soundfiler] and set byte size to 3. This still doesn't help much, since there's no way of knowing the right settings for -raw. Well, maybe this needs it's own thread, maybe I'll create one if this isn't addressed here (yes, that's a threat:))
-
dhk
Oh. I was looking at a bunch of objects, including [select], but forgot its nearest sibling. Case solved. Thanks very much, as usual! Always quick answers!
-
dhk
@KeithIrwin said:
… but users are still going to need to use the MIDI menu in the Pure Data preferences to tell it what devices to connect to in the first place.
Well, this is what I'm talking about. In MaxMSP, every connected MIDI device is "on" by default – as soon as you plug in any device, [notein] is going to receive MIDI from it (unless you tell it not to). In Pd, everything is off by default – and what's more: the program doesn't remember my settings after I shut it down (a bug?)
The important bit here: I don't want the user of my patch to need to set any preferences. If necessary, I will code the "omni devices" behaviour for her, in my patch. But is it possible? How? Some sort of "messages to Pd", to use MaxMSP parleur?
-
dhk
Thank you for the answer, quick as always!
I actually tried this, because I've seen it in some other people's work. Used in abstraction names, that is. Unfortunately, it doesn't work for me.
"error: Bad arguments for message 'gate' to object 'objectmaker'
gate 20 ----------------
... couldn't create"If it's important: I'm using the latest Mac OS, and Pd 0.42.5-extended.
-
dhk
Thanks a lot for the quick answer!
I found the reason for the stepping. The vd~ doesn't like going all the way down to 0 ms delay time, so I added one ms to the modulated delay time. Problem solved.
(Anyway, good to know how the osc~ works!)