Re: [PD] Add to documentation: makenote accepts lists in its leftmost inlet

2024-03-14 Thread Claude Heiland-Allen
Is there enough information available to the core, that could show in 
the GUI if the default list distribution method applies to a given 
(instance of) an object?  Can function pointers be compared for equality 
in C?


I'm thinking something like an underlined first inlet if the automatic 
list distribution applies (or the reverse), but of course other options 
are available, like tooltips or context menu etc


On 14/03/2024 17:19, Peter P. wrote:

Hi,

here is a reply from Miller that might have bypassed the list.

Peter

- Forwarded message from Miller Puckette  -

From: Miller Puckette 
To: "Peter P." 
Subject: Re: [PD] Add to documentation: makenote accepts lists in its
  leftmost inlet
Date: Thu, 14 Mar 2024 12:41:48 -0400

Certain objects (like spigot or list) don't work this way.  I don't think
there's a hard-and-fast rule.  Perhaps the ones that manage lists specially
should be flagged as not distributing lists among inlets.

cheers

Miller

On 3/14/24 17:36, Peter P. wrote:

* Roman Haefeli  [2024-03-14 15:57]:

On Thu, 2024-03-14 at 15:34 +0100, Peter P. wrote:

the help patch for [makenote] could mention that the object accepts a
list in its leftmost inlet as well, or is this behavior taken for
granted along all message-objects?


Yes, this my understanding. When list messages are received on the
left-most inlet, the atoms are spread over the inlets.

[9 7(
|
[- ]
|
[2 \

Thanks Roman!
I knew about this with the simple math objects, but can someone confirm
that it does work for all objects?

Best, P



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-list__;!!Mih3wA!DFAG-I-NncR_429ZtocLYUcfGCbzFdvV2uBIfWChVZ2mSnNd_6ePLJj_C19LwesUVmbwll-IufIzVSxXFVE$

- End forwarded message -



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list





___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] phase locked loop

2023-03-27 Thread Claude Heiland-Allen

Hi Charles, SImon, list,


On 27/03/2023 04:51, Charles Z Henry wrote:

My proposed scheme and patch are to have a low freq
2-pole bandpass filter L below the range and a high freq bandpass
filter H above it, so that over the 2 octave range of each bass
string, you get one signal +90 degrees out of phase and the other with
-90.  So, if you can find the ratio between their amplitudes, you can
find the frequency.



The [hilbert~] abstraction that comes with Pd has two all-pass biquad 
filters that give outputs approximately 90 degrees out of phase from 
each other, so calling its two outputs x and y, phase can be 
approximated with atan2(y, x) and amplitude with sqrt(x^2 + y^2).
I don't know whether it works as-is for bass frequencies though - maybe 
needs a [deephilbert~] version?



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Creating/editing patches on android?

2023-02-23 Thread Claude Heiland-Allen

On 23/02/2023 09:44, Matevz Leskovsek wrote:

Hi all, as I remember all those PD on Android platforms (mobmuplat,
pddroid) only allowed running patches and not editing those, meaning
that one needed a desktop computer to create and edit patches. Is this
still the case or is it possible now to use Android device for
creating and running pd patches. Thanks!
Here's what I have done once on my Android tablet (running Android 7 if 
I remember correctly) as an experiment:


1. install f-Droid app repository
2. from f-Droid, install UserLAnd and TSVNC
3. within UserLAnd, install Debian
4. within Debian in UserLAnd, install XFCE4, tigervncserver, and xvkbd, 
as well as puredata
5. within Debian, launch "vncserver -geometry (width)x(height)" where 
the dimensions match your screen in landscape orientation

6. in Android, launch TSVNC
7. in TSVNC, connect to localhost
8. in XFCE connected via VNC, launch xvkbd from the menu so you can type 
with the touchscreen

9. start a terminal and launch pd, so you can see error messages

this set up does NOT include sound, I did get sound working once by 
using PulseAudio RTMP streaming, and connecting to the localhost stream 
from VLC running on Android, but the latency was several seconds so I 
gave up on that idea, and I forgot the details.


I can't remember if Gem worked, maybe I needed to set the environment 
variable LIBGL_ALWAYS_SOFTWARE=1 , performance might suffer in that case.


to transfer files, the /storage/x/ folders in UserLAnd map to 
Android/data/tech.ula/data or something similar



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Noise in bp-filter

2023-02-18 Thread Claude Heiland-Allen

Hi,

I would do it by having multiple filters in parallel, one for each 
overtone, and mix between their outputs, instead of changing a single 
filter's parameters (which is problematic).


This would use more CPU power, but [bp~] is pretty cheap.

It would also make possible mixing overtones in different proportions, 
which may or may not be useful.



Claude

On 18/02/2023 18:42, William Brent wrote:
Did you smooth the frequency changes with a [line~] object or 
something else before sending to [vcf~]'s 2nd inlet? You can do the 
same to make gradual transitions for Q changes, but since the Q inlet 
doesn't take a signal you'll have to use [line] instead.


On Sat, Feb 18, 2023 at 8:19 AM Daniel Martin via Pd-list 
 wrote:


As you say, the problem is that I jump from a frequency to the
next non-continuosly. Is there a way to do that without
interrupting the signal and without noise?
El viernes, 17 de febrero de 2023, 23:52:22 GMT+1, Peter P.
 escribió:


Daniel, can you try the [vcf~] object instead of [bp~]? The noise you
hear most likely happens when you change the filter frequency
non-continuously.

* Daniel Martin via Pd-list  [2023-02-17 20:15]:
> Dear PD-Users, I'm having a problem with
a patch that filters overtones from a sample. I use for that a bp
filter. The center values for frecuency, Q and output volume are
changed according to which overtone one wishes to hear. It is so
configured, that one can select between overtones 3 to 17,
pressing keys d, r, f, t, g, y, h, u, j, i, k, o, l, p and ñ (I
have a spanish keyboard). The problem is when I want to change
between overtones: one hears a noise. I solved that partially by
reducing the output volume of the bp filter to 0, than changing
the filter parameters values and then raising up the volume again
to 1. That works only with adjacent overtones (for ex. overtone 3
to 4 or 3 to 5), but with larger jumps (for ex. 3 to 15), the
noise comes again, the larger the jump, the stronger the noise.



--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Vanilla way to output text 'emebedded' in patch or how a [text] object

2023-02-08 Thread Claude Heiland-Allen

On 08/02/2023 12:33, Lorenzo Sutton wrote:
Is there a way to output text (as if using [print]) 'embedded' in a 
patch?

Maybe: [list prepend set]--[list trim]--[message box(


Claude




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] pd 0.53-0test2 released

2022-10-23 Thread Claude Heiland-Allen



On 23/10/2022 15:27, Miller Puckette via Pd-list wrote:

On Sat, Oct 22, 2022 at 04:45:00PM -0300, Alexandre Torres Porres wrote:

all good, but mac binary comes out as "Pd-0.53-0test1-80-g20334410"



I think this is probably related to "git describe" getting into the 
version string somehow.


Best solution is probably to make a signed tag with the desired version 
string before building.


for a repository that is exactly at a signed tag (1.0), I get:

$ git describe
1.0

for a repository that is some commits after a signed tag (0), I get:

$ git describe
0-409-g8f1f7da

for a repository that has some signed tags (v1.62) and some (newer) 
unsigned tags (v1.88), compare:


$ git describe
v1.62-2505-ge99c4fc6

$ git describe --tags
v1.88-22-ge99c4fc6



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] filter stability

2022-04-27 Thread Claude Heiland-Allen

Hi Alexandre,

On 27/04/2022 06:01, Alexandre Torres Porres wrote:
hi list, I'm using a 2nd order lowpass resonant filter whose 
coefficients I'm getting from the famous Eq-cookbook and using it 
inside a feedback loop to implement karplus-strong.


I also have a coded object for that (pluck~) and the 'q' parameter is 
0.5, which is a "safe" setting, i.e. the filter doesn't get unstable 
and blows up.


The filter in isolation should be stable for any positive 'q', but its 
gain might get bigger than 1 making the larger feedback loop explode.


You can do some additional gain reduction if increasing the q factor 
increases the peak gain of the filter and makes the feedback loop explode.


I was now trying to find a higher 'q' coefficient but it's hard to 
know where I can go "exactly" just under it could blow up.


You want the total gain in the feedback loop for all frequencies to be 
less than 1, i.e. peak (over frequencies) gain less than 1.



Is there an easy way to know this other than trial and error?
The filter gain probably depends on cut-off frequency as well as q, so 
the filter peak gain is a function of 2 parameters.  Maybe gathering 
numerical data and surface-fitting a mathematical function could work, 
if the maths to do it analytically is too hard.


If you modulate the filter parameters, it could still explode (the 
filter theory as per eq cookbook is only valid for fixed parameters, afaik).


If you implement with insufficient accuracy inside the filter feedback 
(e.g. single precision floating point for 'y' in a biquad 
implementation), rounding errors can accumulate and can affect the 
actual gain (vs the theoretical gain you'd get from exact maths).



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [Gem] bit depth of display

2022-02-17 Thread Claude Heiland-Allen

On 17/02/2022 20:24, Roman Haefeli wrote:

Actually, since I'm already using a shader, I could try to add some
noise there. Not totally sure how this should be done, though.
Something like https://pippin.gimp.org/a_dither/ using gl_FragCoord.xy 
would be my first try.



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [Gem] bit depth of display

2022-02-17 Thread Claude Heiland-Allen

Hi Roman,

On 17/02/2022 17:59, Roman Haefeli wrote:

the gradients between the
pixels shows edges that look like low bit depth (and probably are due
low bit depth).
No clue about high bit depth output. Possible workaround: a shader that 
does dithering could help mask the problem, that is if the OpenGL 
texture interpolation is not the source of the problem (hopefully it's 
done with floats, if not maybe you can do interpolation in the shader 
too after reading the texels without interpolation).  Check the OpenGL 
specification for GL_LINEAR magnification filter details, maybe it says 
how much precision is guaranteed.


One thing you could do to diagnose is check pixel values of neighbouring 
bands to see if they are off by one (in which case suspect needing 
higher bit depth output) or more (in which case suspect OpenGL GL_LINEAR 
precision being insufficient).



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] -batch flag: using cases / examples?

2022-02-04 Thread Claude Heiland-Allen

Hi,

On 04/02/2022 17:16, padovani wrote:


Nonetheless, I just noticed now that there is a -batch flag.

The pd command help prints: "-batch           -- run off-line as a 
batch process". However, I could not really understand how this works 
(and also couldn't find any further tips in the docs/lists).


Historically I think batch came before fast-forward.  It runs the 
scheduler as fast as possible forever, until a quit message is sent to 
the pd receiver.


Example could be something like:

pd -noprefs -noaudio -r 44100 -batch -nrt -open main.pd -send "onload 
sine.wav 440 1000"


where main.pd has [r onload] and uses the incoming message to write an 
audio a file using [writesf~] (remember to send pd "dsp 1", too).


For a real-world example, see the render.sh in my project:
https://code.mathr.co.uk/dynamo


Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] simple dynamic instancing and connection of abstractions

2021-12-09 Thread Claude Heiland-Allen

On 09/12/2021 09:22, Scott R. Looney wrote:
if i use switch~ to turn off an inactive instrument's audio output, 
does the control data matter if it ends up in a 'dead letter office' 
so to speak?


There's an issue where messages sent to a switched off vline~ pile up 
and CPU usage goes up:


https://lists.puredata.info/pipermail/pd-list/2017-06/118982.html
https://lists.puredata.info/pipermail/pd-list/2007-06/050999.html


Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


[PD] exhibition in Folkestone UK from 2021-11-26 to 2021-12-11

2021-11-19 Thread Claude Heiland-Allen
some of my computer based art works (including a couple of Pd pieces) 
from 2008-2021 are exhibited soon


https://mathr.co.uk/smoltech/#exhibition 



CT20, 73 Tontine Street, Folkestone CT20 1JR, United Kingdom, 
http://ct-20.org 



opening Friday 26th November 2021, 7pm
artist talk Saturday 4th December 2021, 5pm
until Saturday 11th December 2021

the greenest technology is the one you already have

> ... One thing I've noticed when developing new work, is that the 
computational load performed by the piece has tendency to expand to fill 
the computational power available to it. ... So there is this temptation 
to buy a new, faster machine. I've fallen for it a few times. But now I 
think I have had enough of new technology, especially given the climate 
catastrophe that is approaching fast. We need to stop making and buying 
so much new hardware and use the hardware we have for much longer ...


curated by Laura Netz




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Ability to access error messages from patch

2021-06-17 Thread Claude Heiland-Allen

Hi all,

On 17/06/2021 12:25, IOhannes m zmoelnig wrote:
...
Pd is a data flow language and I thikn the per-canvas paradigm maps 
well to the idea of data "passing through a danger zone" - which it 
can also leave as well. 

...
however, I do like oliver's idea of hooking up such a [catch]-like 
object in the object-tree. 

...

Both have their merits, I suppose the depth first flow version could 
benefit from another object to uninstall the error handler, making it 
able to emulate the per-canvas mechanism.


A feature like "(re-)throw error/exception to parent" could be useful in 
both cases; with top-level unhandled errors getting printed in the 
console.  And a "throw error to current exception handler" would be 
useful too.


This proliferation of objects makes me think that it could be useful to 
have an [error foo] set of objects, like [list].



Something like this perhaps (swap outlet order if you like, doesn't 
bother me)


 |
[error begin  ]
 |           |
[foo]  recover from bar and baz errors (apart from error 42 from 
bar) as well as errors from foo

 |
[error begin      ]
 |    |
[bar]         [route 42        ]
 |        |                            |
[error end]  recover from bar error 42     [error throw]
 |
[baz]
  |


Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] ignore hidden files from hcs/folder_list

2021-05-04 Thread Claude Heiland-Allen

Hi Samuel,

On 04/05/2021 14:47, Samuel Burt wrote:

I figured it out on my own. For anyone searching here's a solution.


Does it work correctly when changing directories?  I would expect 
[splitfilename] to output from right to left, which means the previous 
file's directory is used for each file...



Voila! Hidden files are ignored. Is there a simpler solution?

maybe something like this (untested)

 |
[hcs/folder_list]
 |
[t a a]
 |   |
 |  [splitfilename]
 |    |
 |   [list fromsymbol]
 |    |
 |   [route 46]
 |    |  |
 |   [0( [1(
 | __/___/
 |    /
[spigot]
 |



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] inlet names (bad?) practice?

2021-03-02 Thread Claude Heiland-Allen

On 02/03/2021 17:45, Jonathan Wilkes via Pd-list wrote:
> On Tuesday, March 2, 2021, 11:10:36 AM EST, Alexandre Torres Porres 
 wrote:


> Hi, I was asking people on facebook where did they get the idea of 
putting names in inlets/outlets, like: [inlet 
this-inlet-controls-frequency].


Not sure. But A_DEFSYM and A_DEFFLOAT are implemented in a way that 
allows an arbitrary number of extra float/symbol arguments, so it 
could be `[inlet this inlet controls frequency]`. Or following the 
`[get]` and `[set]` pattern-- `[inlet - this inlet controls 
frequency]` to skip over the first arg that is currently used for 
up/downsampling.


Someone asked on the Purr Data list about this. It would be easy to 
implement, but it doesn't cover the case of setting a description for 
the object itself. Plus I'd much rather just leverage the 
documentation index in the GUI to look up tooltip data.


-Jonathan

https://download.puredata.info/dev/InletDescriptions




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] split number into digits

2021-01-17 Thread Claude Heiland-Allen

Hi Antoine,

On 17/01/2021 18:15, Antoine Rousseau wrote:

- transform "float 512" into "symbol 512" using [makefilename %d]
I would not recommend this, because symbols stick around forever and Pd 
gets slower the more symbols there are.  AKA "symbol table pollution".


Instead, better to use [mod 10] to get the least significant digit, and 
[div 10] to get the most significant digits (then repeat until you have 
all the digits).  This approach also works for bases other than 10.



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [semi-OT] binary nvidia drivers on Debian Linux for Gem

2020-06-10 Thread Claude Heiland-Allen

Hi,

On 10/06/2020 11:18, Peter P. wrote:

oliver and me have been struggling to get nvidia binary drivers to work
on his Debian stable laptop. Their intended use is with Gem, hence I
would like to know if in 2020 the preferred way to install them is with
Debians nvidia-legacy-390xx-kernel-dkms package
Sure, if that is the correct version supported by the hardware.  I think 
on my old laptop I needed the 340xx legacy version (EOL), I can check 
later but I think I installed nvidia-legacy-340xx-driver meta-package 
that pulled in the dkms package as a dependency, among other things.



or with some install
script downloaded from nvidia's webpage?
I prefer the Debian way.  But whatever you do, mixing them is a recipe 
for pain, so purge one completely before trying the other.



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] pd 0.51-0 released

2020-06-06 Thread Claude Heiland-Allen

Hi all,

On 06/06/2020 03:50, Miller Puckette via Pd-announce wrote:

Pd version 0.51-0 is available on http://msp.ucsd.edu/software.htm
or (source only) via github: https://github.com/pure-data/pure-data .

Great!

I updated my forks for compiling libpd with emscripten to run in web 
browsers, instructions and build scripts at:

https://mathr.co.uk/empd/

Note that the updated network stuff is not supported by emscripten 
afaict (or maybe it's just a missing link library flag?), I don't know 
if there is a better workaround than ignoring missing symbols at link 
time and just not using the networking objects:

https://github.com/claudeha/pure-data/issues/5
Or maybe using the WinXP fallback code (minus IPv6) might work?  To be 
investigated...


I haven't yet retouched the experimental Gem stuff, probably it 
works/fails better/worse than a year ago.



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] VU / Peak Meter ? - external or abstraction

2020-04-21 Thread Claude Heiland-Allen

Hi,

On 21/04/2020 12:20, Peter P. wrote:

* Ingo  [2020-04-21 13:10]:

Thanks, Peter!

At the moment I cannot change to 0.50 but I'll keep it in mind for the near
future when I will have to update my system.

Note that you could add entries for Debian testing in your
/etc/apt/sources list but have your system default to stable by creating
a file /etc/apt/preferences that reads something like this


Much better than to risk mixing stable+testing is to use the backports 
repository, which does have pd-0.50:


deb http://deb.debian.org/debian buster-backports main
deb-src http://deb.debian.org/debian buster-backports main

apt install -t buster-backports puredata

Documentation:

https://backports.debian.org/Instructions/


Claude
--
https://mathr.co..uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] bandpass makeup gain formula?

2020-03-04 Thread Claude Heiland-Allen

Hi again,

On 04/03/2020 12:58, Claude Heiland-Allen wrote:

On 2020-03-04 11:18, Peter P. wrote:

I am trying to calculate a makeup gain factor for white noise sent into
[bp~] and [vcf~] bandpass objects depending on the center frequency and
the Q (width) so that it measures the same in dBRMS before and after the
filter. I am currently measuring it but am wondering if
b.) if there is an analytical solution to it already
For an un-normalized 2-pole bandpass filter as depicted at [1], I think 
the overall gain of the filter for white noise input is


sqrt ( integral from 0 to pi of |1/((exp(it) - (1-b)exp(iw))(exp(it) - 
(1-b)exp(-iw)))|^2 dt )


I tried it on Wolfram Alpha but it didn't succeed (time limit 
exceeded).  Probably there is no simple closed-form solution?


Then you need to factor in how bp~ [2] and vcf~ [3] convert f and q into 
w and b, as well as their custom gain factors.


I attached an example with simple numerical integration (using Pd dsp 
with bang to switch~), seems to work ok (but may be unreliable if q is 
too high), you could combine with automation for -batch and use that to 
generate data for surface fitting software?  I may try that later...


I think I made a mistake though: I used vcf~'s f q -> w b calculations, 
but now realized that maybe vcf~ has 1 (complex) pole and bp~ has 2 (a 
conjugate pair)?


As a bonus, the patch includes a normalized log-log spectrum graph 
calculated in DSP using tabsend~/tabreceive~ and order forcing.


[1] http://msp.ucsd.edu/techniques/latest/book-html/node143.html
[2] 
https://github.com/pure-data/pure-data/blob/e2ef8158e83900734d263a3fda343a47ed0c9e3a/src/d_filter.c#L284-L301
[3] 
https://github.com/pure-data/pure-data/blob/e2ef8158e83900734d263a3fda343a47ed0c9e3a/src/d_osc.c#L386-L447



Claude
--
https://mathr.co.uk

#N canvas 3 61 450 488 10;
#N canvas 3 61 450 300 \$0-band-pass-filter 0;
#X obj 36 131 cpole~;
#X obj 48 179 cpole~;
#X obj 34 23 inlet~;
#X obj 47 208 outlet~;
#X text 189 22 b;
#X text 312 23 w;
#X obj 140 22 inlet;
#X obj 140 45 expr 1 - $f1;
#X obj 140 68 expr $f1 * cos($f2) \; $f1 * sin($f2);
#X obj 167 134 * -1;
#X obj 263 22 inlet;
#X text 46 261 http://msp.ucsd.edu/techniques/latest/book-html/node143.html
;
#X text 94 239 un-normalized 2-pole bandpass filter as described at
;
#X connect 0 0 1 0;
#X connect 0 1 1 1;
#X connect 1 0 3 0;
#X connect 2 0 0 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 8 0 1 2;
#X connect 8 0 0 2;
#X connect 8 1 9 0;
#X connect 9 0 1 3;
#X connect 10 0 8 1;
#X restore 68 351 pd \$0-band-pass-filter;
#N canvas 3 78 469 650 \$0-gain-calculation 0;
#X obj 37 85 inlet;
#X text 51 107 b;
#X obj 169 89 inlet;
#X text 185 109 w;
#X obj 288 132 switch~ 65536 1 1;
#X obj 289 82 loadbang;
#X msg 289 105 0;
#X obj 36 155 expr $f1 * cos($f2) \; $f1 * sin($f2);
#X obj 37 129 expr 1 - $f1;
#X obj 25 224 tabplay~ \$0-cos-table;
#X obj 45 250 tabplay~ \$0-sin-table;
#X obj 38 310 *~;
#X obj 81 311 *~;
#X obj 39 287 -~ 0;
#X obj 81 288 -~ 0;
#X obj 120 312 *~;
#X obj 120 289 -~ 0;
#X obj 154 277 * -1;
#X obj 48 356 +~;
#X obj 84 356 +~;
#X obj 50 384 *~;
#X obj 32 413 /~;
#X obj 5 389 sig~ 1;
#X obj 26 493 rpole~ 1;
#X msg 44 466 set 0;
#X obj 14 520 snapshot~;
#X obj 35 197 t b b b f;
#X obj 17 547 / 65536;
#X obj 19 605 outlet;
#X obj 277 491 table \$0-sin-table 65536;
#X obj 276 467 table \$0-cos-table 65536;
#X obj 278 205 loadbang;
#X msg 278 228 65536;
#X obj 278 251 until;
#X obj 278 274 f 0;
#X obj 332 271 + 1;
#X obj 332 294 mod 65536;
#X obj 279 323 / 65536;
#X obj 278 346 * 3.14159;
#X obj 278 370 expr cos($f1) \; sin($f1);
#X obj 278 297 t f f;
#X obj 278 406 tabwrite \$0-cos-table;
#X obj 277 436 tabwrite \$0-sin-table;
#X obj 17 577 sqrt;
#X text 28 29 sqrt(integral from 0 to pi of |1/((exp(it)-(1-b)exp(iw))*(exp(it)-(1-b)(exp(-iw)))|^2
dt);
#X text 28 9 calculate the gain of the two-pole un-normalized band
pass:;
#X text 258 179 precalculate trig tables;
#X text 27 62 also writes the normalized dB spectrum to a table;
#X obj 228 86 inlet;
#X text 243 108 sr;
#N canvas 3 61 701 358 \$0-plot-spectrum 0;
#X obj 132 25 inlet;
#X obj 278 23 inlet;
#X obj 278 46 t b f;
#X text 325 24 sr;
#X msg 273 80 65536;
#X obj 273 103 until;
#X obj 273 126 f 0;
#X obj 327 123 + 1;
#X obj 327 146 mod 65536;
#X obj 274 175 / 65536;
#X obj 273 149 t f f;
#X obj 273 256 tabwrite \$0-freq-table;
#X obj 273 208 expr exp(log(2 * 20 / $f2) * (1 - $f1) + $f1 * log(2
* 2 / $f2)) * 65536;
#X msg 384 48 44100;
#X obj 383 22 loadbang;
#X obj 44 300 tabsend~ \$0-spectrum;
#X obj 44 92 powtodb~;
#N canvas 3 61 450 300 \$0-order-forcing 0;
#X obj 42 27 inlet~;
#X obj 42 50 tabsend~ \$0-spectrum-linear;
#X obj 42 73 outlet~;
#X connect 0 0 1 0;
#X restore 44 126 pd \$0-order-forcing;
#X obj 44 173 tabread4~ \$0-spectrum-linear;
#X obj 57 149 tabplay~ \$0-freq-table;
#X obj 44 201 -~;
#X obj 44 250 *~ 2;
#N canvas 3 61 450 300 \$0-peak 0;
#X obj 38 97 fexpr~ max($x \, $y);
#X obj 39 18 inlet~;
#N canvas 3 61 

Re: [PD] bandpass makeup gain formula?

2020-03-04 Thread Claude Heiland-Allen

Hi Peter,

On 2020-03-04 11:18, Peter P. wrote:

I am trying to calculate a makeup gain factor for white noise sent into
[bp~] and [vcf~] bandpass objects depending on the center frequency and
the Q (width) so that it measures the same in dBRMS before and after 
the

filter. I am currently measuring it but am wondering if
a.) this has been done before


Not quite the same, but maybe useful:
https://lists.puredata.info/pipermail/pd-list/2010-08/082104.html


and
b.) if there is an analytical solution to it already


vcf~ code has a gain adjuster in it, but I don't know the theory behind 
it.



Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Delay circuit feedback DSP error-- only when signal path leaves abstraction

2020-02-25 Thread Claude Heiland-Allen

Hi William,

On 25/02/2020 10:36, William Huston wrote:


*The point is the last two patches have (or should have) an identical 
graph! *


Pd works with nested graphs - each whole abstraction/subpatch is treated 
as one atomic unit from the outside.  That's why in your original post 
your second diagram with the abstraction boundaries in blue is not so 
strange: the blue boxes are really black boxes so the DSP really does loop.



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] recent Pd versions on older ubuntu studio computers

2020-01-13 Thread Claude Heiland-Allen

Hi,

On 13/01/2020 14:13, i...@hansroels.be wrote:
Is an installation of a /recent/ version of Pd vanilla (0.49 or 0.50) 
possible on an older linux computer?


Should be possible.

I am trying to install Pd 0.50.2 on two older Ubuntu Studio laptops, one 
has Ubuntu 14.04, the other Ubuntu 16.04. 


When I try to install the deb 
package from https://deb.debian.org/debian/pool/main/p/puredata/  


Pd is atomised into many tiny debs, you'd need all of them...

I get 
a dependencies error, saying that I need a higher version of libc6.


The chances of random binaries from the internet working are smaller 
than with Windows I guess.


Is it a solution to try compiling the Pd source code on both machines? 


Yes I think so.  But it might be awkward with packaged Pd externals 
(you'd need to keep the old pd around and tell the new Pd where the 
externals are).


To solve that, you can compile the collection of debs locally.  First 
add the following two lines (only two lines, without leading space, 
email may have wrapped them) to `/etc/apt/sources.list`:


deb http://http.debian.net/debian unstable main contrib non-free
deb-src http://http.debian.net/debian unstable main contrib non-free

(Alternatively add `deb` + `deb-src` lines for a later version of Ubuntu 
Studio that has the version of Pd you want, then modify the below's `-t` 
accordingly.)


Then invoke something like the following as regular user, being careful 
to do it one line at a time and read the output so you can stop if apt 
decides to upgrade everything to unstable or remove key parts of your 
installation:


mkdir build
cd build
sudo apt update
sudo apt-get -t unstable build-dep puredata
apt-get -t unstable --build source puredata
sudo dpkg --auto-deconfigure --install ./*.deb

If the `sudo apt-get` is too risky and you decide not to run it after 
all, you could try again without `-t unstable` and hope that older 
versions of the build dependencies are ok.


Then you can edit your `sources.list` again and comment out the lines 
you added before.  Remember to run `sudo apt update` after changing it.


If you need to downgrade the packages later, `aptitude` works much 
better than `apt` or `apt-get` (it offers choices between different ways 
to resolve problems).



or is the only solution to upgrade the whole Ubuntu Studio version? > (...which 
isn't possible on one of these machines).


The above is roughly what "backports" repositories do, I don't know if 
there is one for Ubuntu Studio.  You can also compile the source from 
Miller's site "by hand".



Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] audio via HDMI output terminates Pd

2019-12-11 Thread Claude Heiland-Allen

On 2019-12-11 14:01, IOhannes m zmoelnig wrote:

On 11.12.19 13:18, Csaba Láng wrote:

Dear list,

I am trying to play video with synced audio on HDMI output, but after 
10-15

seconds Pd dies with an error:

pd: pcm.c:1168: snd_pcm_prepare: Assertion `pcm' failed.
Pd: signal 6
Can you help me to fix this issue?

Ubuntu 18.04 with ALSA


have you tried JACK?
and PulseAudio via portaudio?


Also Pulseaudio via JACK is possible:
https://mathr.co.uk/blog/2018-10-23_jack_on_top_of_pulseaudio.html


Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Pd double precision testing.

2019-12-07 Thread Claude Heiland-Allen

On 05/12/2019 21:55, Lucas Cordiviola wrote:

Tests should be done with "vanilla-only" patches. 99% of externals were
not compiled for double-precision so they don't work with this Pd.

If you find something not working write back here to the list or issue
it to github (prepend "double-precision: " on the name of the issue).


Success report: I tested my Dynamo[1] techno generator in live mode and 
it works without issues.  Uses 65% CPU vs 63% CPU for the single 
precision master branch, on Intel(R) Atom(TM) CPU N455 @ 1.66GHz in 
32bit mode using Linux 4.19.0-5-686-pae #1 SMP Debian 4.19.37-3.


It uses these objects:

* *~ + +~ - -~ / /~ == > >= b bang biquad~ bng bp~ change clip~ 
complex-mod~ cos~ dac~ dbtorms dbtorms~ del delay delwrite~ div env~ 
expr expr~ f hilbert~ hip~ iemguts/closebang inlet inlet~ list loadbang 
lop~ makefilename max metro mod moses mtof mtof~ noise~ osc~ outlet 
outlet~ pack phasor~ print quit-on-close r random rmstodb~ route s sel 
sig~ soundfiler spigot sqrt sqrt~ swap symbol t table tabread tabread4~ 
tabwrite textfile unpack until v value vcf~ vd~ vline~ vu wrap~ writesf~



Claude

[1] https://mathr.co.uk/dynamo

--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] pd for oscilloscopes

2019-11-29 Thread Claude Heiland-Allen

Hi,

On 29/11/2019 12:56, henry birdseye wrote:
what's a good vector oscilloscope app that I can somehow route those 
dac~ objects to

You can use JACK Audio Connection Kit to route audio signals betweeen apps.

I wrote a very simple XY oscilloscope using JACK and OpenGL:
https://mathr.co.uk/exwhyscope
(note: Fridays are strike days)
I only tested it on Linux, may need some adjustments for other OS.

I'd like to get my audio output into my DAW, Reaper, for recording as 
.wav files
You can either investigate if Reaper supports JACK, or use [writesf~] to 
write WAV files from Pd.



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] opening patch from pd message

2019-11-26 Thread Claude Heiland-Allen

Hi,

On 26/11/2019 14:12, Csaba Láng wrote:

Dear list,

I want to open from a pd patch a pd patch withe the message:

[;
pd open $1.pd /path-topatch;(

With simple naming of the patches such as numbers, works beautifully.
However if the name is a word, I cannot open them. What kind of 
command should I send to this message to make it work?


just to be clear, if I want to open cat.pd, a message [cat( will not 
make it happen.

try [symbol cat( or [list cat( instead of just [cat(

for more details read the fine manual, specifically about messages and 
selectors

https://puredata.info/docs/manuals/pd/x2.htm#s3.1


Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] pix_delay argument

2019-08-26 Thread Claude Heiland-Allen

Hi Peter,

On 2019-08-26 09:43, Peter P. wrote:
can it be that if pix_delay is being sent a "frame delay" into its 
right

inlet that is the same as its argument (max delay) it will not delay at
all?


Maybe.  The relevant code afaict is here, not yet deciphered the intent:

https://github.com/umlaeute/Gem/blob/8553d055b0a39acf02d31d8ae8cb6a0a2f732ef0/src/Pixes/pix_delay.cpp#L81-L84


Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] is GEM alive?

2019-08-17 Thread Claude Heiland-Allen

Hi Tim,

Uninstalling libftgl-dev (and libftgl2) I can reproduce your problem, I 
filed an issue:


https://github.com/umlaeute/Gem/issues/236


Claude

On 16/08/2019 21:58, tim vets wrote:



Op vr 16 aug. 2019 om 21:55 schreef Claude Heiland-Allen 
mailto:cla...@mathr.co.uk>>:


Hi Tim,

Which OS are you on?


Ubuntu 18.04

On 16/08/2019 19:21, tim vets wrote:
> It's been a while since I used Gem,
> but in the past weeks I tried running it a few times without
success.
> (Pd0.49 as well as the latest and greatest 0.5)
> Trying to compile from source I'm stuck at:
>
> In file included from TextBaseFTGL.cpp:24:0:
> TextBase.h:39:12: fatal error: FTFont.h: No such file or directory
>  #  include "FTFont.h"
>             ^~
> compilation terminated.
>
Debian package search reports an FTFont.h in libftgl-dev [1]
With this installed `./autogen.sh && ./configure` from [2] outputs:

```
  used optional libraries:

   font-rendering : FTGL
  default font    :
```

Maybe the configure check is broken when FTGL is not installed?  Try
installing libftgl-dev, and report back if this fixes it or otherwise.


alright, thanks for the tip, I got it working now!

Claude

[1]

https://packages.debian.org/search?searchon=contents=FTFont.h=path=stable=any
[2] https://github.com/umlaeute/Gem

-- 
https://mathr.co.uk







___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] is GEM alive?

2019-08-16 Thread Claude Heiland-Allen

Hi Tim,

Which OS are you on?

On 16/08/2019 19:21, tim vets wrote:

It's been a while since I used Gem,
but in the past weeks I tried running it a few times without success.
(Pd0.49 as well as the latest and greatest 0.5)
Trying to compile from source I'm stuck at:

In file included from TextBaseFTGL.cpp:24:0:
TextBase.h:39:12: fatal error: FTFont.h: No such file or directory
 #  include "FTFont.h"
            ^~
compilation terminated.


Debian package search reports an FTFont.h in libftgl-dev [1]
With this installed `./autogen.sh && ./configure` from [2] outputs:

```
 used optional libraries:

  font-rendering : FTGL
 default font    :
```

Maybe the configure check is broken when FTGL is not installed?  Try 
installing libftgl-dev, and report back if this fixes it or otherwise.



Claude

[1] 
https://packages.debian.org/search?searchon=contents=FTFont.h=path=stable=any

[2] https://github.com/umlaeute/Gem

--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Why does this cause stack overflow?

2019-05-28 Thread Claude Heiland-Allen

On 2019-05-27 22:06, Jonathan Wilkes wrote:

On Monday, May 27, 2019, 1:52:50 PM EDT, Claude Heiland-Allen
 wrote:


The default stack size limit I think is 1000 objects, recent Pd let

you
change it - search list archives or github issues for details.

Are you talking about setting the STACKITER macro in m_obj.c and
recompiling?


Nope, this: https://github.com/pure-data/pure-data/pull/486
which is still open so I guess not merged yet.


Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Why does this cause stack overflow?

2019-05-27 Thread Claude Heiland-Allen

On 2019-05-27 18:44, Claude Heiland-Allen wrote:

On 2019-05-27 18:23, Philip Stone wrote:

On my system, the stack over-flows at count 331.


But the simplest(*) way to get recursive calls to work is often to
break the recursion with a [delay 0] to start a new depth first
execution chain after the current one is finished, or to refactor it
to use [until](+) to iterate instead of recurse.


I attached an example of both techniques.


(*) but it can become unmaintainable in larger patches...
(+) but [bang(--[until] can take a while to finish, be careful...



Claude
--
https://mathr.co.uk
#N canvas 697 133 657 266 10;
#X obj 128 84 f;
#X obj 199 104 + 1;
#X msg 128 58 0;
#X obj 76 194 spigot 0;
#X obj 128 105 t b f f f;
#X obj 121 175 < 400;
#X obj 178 144 print count;
#X text 156 56 click here;
#X obj 379 78 t f b;
#X obj 379 101 until;
#X obj 379 124 f;
#X obj 379 147 t f f;
#X obj 379 170 print count;
#X obj 426 133 + 1;
#X msg 426 101 0;
#X obj 76 217 delay 0;
#X msg 379 55 401;
#X text 406 56 click here;
#X text 453 102 retriggers new chains from here;
#X text 133 217 starts a new chain later \, allows current one to finish
;
#X connect 0 0 4 0;
#X connect 1 0 0 1;
#X connect 2 0 0 0;
#X connect 3 0 15 0;
#X connect 4 0 3 0;
#X connect 4 1 6 0;
#X connect 4 2 1 0;
#X connect 4 3 5 0;
#X connect 5 0 3 1;
#X connect 8 0 9 0;
#X connect 8 1 14 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
#X connect 11 1 13 0;
#X connect 13 0 10 1;
#X connect 14 0 10 1;
#X connect 15 0 0 0;
#X connect 16 0 8 0;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Why does this cause stack overflow?

2019-05-27 Thread Claude Heiland-Allen

Hi Phil,

On 2019-05-27 18:23, Philip Stone wrote:

Hello, I’ve run into a situation that strains my understanding of
Pd’s strict determinacy – please see the attached patch of the
simplest case. On my system, the stack over-flows at count 331.

I don’t understand why this happens, as the bang that re-fires the
loop is not triggered until after the print. What is filling the
stack, exactly?


Control flow in Pd's message system is depth-first, usually 
right-to-left.  This means that control passes from first object to 
deepest object, then back up again:


in this small example

[bng]
[t b b]
 |   [print r]
[print l]

the control flow stack over time is like:

[bng]
[bng] [t b b]
[bng] [t b b] [print r]
[bng] [t b b]
[bng] [t b b] [print l]
[bng] [t b b]
[bng]

But in your example control is not yielded back to the caller before 400 
iterations, at which point the stack is filled with


... [f] [t] [spigot] [f] [t] [spigot] 

The default stack size limit I think is 1000 objects, recent Pd let you 
change it - search list archives or github issues for details.


But the simplest(*) way to get recursive calls to work is often to break 
the recursion with a [delay 0] to start a new depth first execution 
chain after the current one is finished, or to refactor it to use 
[until](+) to iterate instead of recurse.


(*) but it can become unmaintainable in larger patches...
(+) but [bang(--[until] can take a while to finish, be careful...


Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


[PD] [PD-announce] exhibition in London, April 2019

2019-03-28 Thread Claude Heiland-Allen

Hi all,

I have an exhibition opening soon in London, UK.

https://sonicelectronicsfestival.org/exhibition/

Featuring
- raytracing in curved space
- badly-played tetris
- generative techno
- audiovisual sliding tile puzzle
- interactive graph-directed IFS
- zooming hybrid fractals

Opening 11th April 2019 6pm, until 27th April, at Chalton Gallery,
96 Chalton Street, Camden, London NW1 1HJ, UK.  Check website for times.

Two of the works are realized with Pure-data, also using pdlua and Gem.
Thanks also to Andy Farnell for his CheeseBox/AnalogueDrumEngine patch.

Curated by Laura Netz.

Supported using public funding by the National Lottery through Arts 
Council England.



Claude
--
https://mathr.co.uk




___
Pd-announce mailing list
pd-annou...@lists.iem.at
https://lists.puredata.info/listinfo/pd-announce
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] bang on phasor~ wrap

2019-03-02 Thread Claude Heiland-Allen

On 2019-03-02 13:20, Orm Finnendahl wrote:

 is there some easy way in vanilla pd to get a bang on each phasor~
wraparound which doesn't involve polling with snapshot~?


https://lists.puredata.info/pipermail/pd-list/2006-12/044634.html

--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [soundfiler] - too many open files / bad file descriptor error (meaning?)

2019-02-08 Thread Claude Heiland-Allen

On 08/02/2019 09:55, Roman Haefeli wrote:

I see that your version of [conv~] uses [else/dir] internally and this
external of yours is still leaking file handles. I think I already
reported this, but can't find an open issue about it. Maybe you closed
them, despite them not being fixed.


https://github.com/porres/pd-else/blob/9b259f24569a13069c5842ec0f598e8fe96c8cbc/Classes/Source/dir.c#L75

the leak seems to be on this line.  you should keep the return value of 
opendir and be sure to close it when no longer necessary.



Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [soundfiler] - too many open files / bad file descriptor error (meaning?)

2019-02-08 Thread Claude Heiland-Allen

Hi Alexandre,

On 08/02/2019 05:57, Alexandre Torres Porres wrote:

First is "*/soundfiler_read: test.wav: Too many open files/*".


Something is almost certainly leaking file handles, when too many are 
open at once, you can't open any more (neither for reading nor writing), 
so all kinds of bad problems happen.  The default limit is usually 1000 
or so, on Linux you can check and change with the `ulimit` command.


It's probably not [soundfiler] or [clone] to blame, but more likely some 
external that isn't properly closing the files (or directories) that it 
opens.


On Windows I think you need to close with the right function w.r.t. 
DLL/EXE module boundaries.  There may be something in the list archives 
about this.



Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Background Color

2019-02-04 Thread Claude Heiland-Allen

Hi Antoine,

On 04/02/2019 14:00, Antoine Villeret wrote:

hi all,

I'm on Manjaro with i3wm and my Pd looks weird (#00 text over 
#2B2C2B background) :

https://ibb.co/MDqzr5s
which makes it difficult to use...
I'm sure it's due to a window manager theming because loading Pd from 
openbox display the usual white background.


Does anyone experience the same and know how to change the color ?


You can modify Pd patch window background colour in X11 or Xorg by using 
X resources:


$ cat ~/.Xresources
*PatchWindow*background: red
$ xrdb -merge ~/.Xresources
$ pd

Now all Pd patch windows have red background.  Easy to choose your 
preferred colour.


You need to restart Pd for xrdb changes to take effect.

You may need to add the xrdb -merge command to your login scripts.

I tested this with XFCE4 on Debian, hopefully it works on your window 
manager too.



Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] batch processing and event execution

2019-01-29 Thread Claude Heiland-Allen

Hi Federico,

On 29/01/2019 10:45, Federico Camara Halac wrote:
does Pd create a "list" of all the events that will take place before 
doing them?


No.

Pd has some objects that deal with logical time and scheduling events 
([delay], [metro], [qlist], [pipe]).  But mostly they enqueue only 1 
future event at a time into Pd's event list, e.g. [metro] adds the next 
event only when the previous event fires (which only happens when Pd's 
scheduler has advanced logical time far enough, computing other message 
chains and maybe dsp in between).


If you need to make a list of "all" events, you have to do that 
yourself, perhaps with [timer] and [textfile].



Claude
--
https://mathr.co.uk



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] loading Camomile plug-ins using vstplugin~

2019-01-20 Thread Claude Heiland-Allen

Hi,

On 20/01/2019 01:52, Miller Puckette wrote:

I don't think it works.  Unless I'm misreading things, once Camomile calls
pd_init(), that call doesn't go to the pd_init that's compiled into
Camomile (via libpd) but instead calls pd_init from the Pd that called
vstplugin~ that called Camomile.  This does nothing, and the next thing libpd
tries to access in the Pd instance fails.
Maybe static linking of libpd in Camomile would fix this?  But that 
would just postpone the issue until the first dynamically-linked 
external is loaded by the deeper Pd, which tries to access eg 
class_new(): does it get the one in Pd host or Camomile .pd_linux?


On GNU glibc systems, dlmopen() may be relevant?


Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [select 12 12] triggers only one bang

2019-01-17 Thread Claude Heiland-Allen

Hi Peter,

On 17/01/2019 21:04, Peter P. wrote:

I assumed there was a "return after first match" in the source code and
it is good to hear that it is non-trivial to changet it.
By not totally trivial I meant that it's +3-1 lines instead of a -1 line 
change.  So totally doable, but it might break old patches, and the gain 
is small, so I doubt it's worth it.


BTW to clarify my example patch:

 |
[t a a]
 |   |
 |  [select $1 $2]
 |  |
[t a a]
 |   |
 |  [select $2]
 |   |
 |
[select $1]
 |


to keep the output order right-to-left as is usual in Pd.

Some more keywords for mailing list archive: duplicate argument

Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [select 12 12] triggers only one bang

2019-01-17 Thread Claude Heiland-Allen

Hi Peter,

On 17/01/2019 17:04, Peter P. wrote:

Hi,

this is not terribly important, but it seems that
[select 12 12]
triggers only its leftmost outlet when it receives a 12 at its inlet. Is
this intentional?
Changing this behaviour in the C is not totally trivial, as you would 
need to keep track of matches, to not send to the last "reject" outlet 
at the end.  As it is now, it just "return"s after sending to a matching 
outlet.


https://github.com/pure-data/pure-data/blob/7c27aa0ad505bb4802eee3fc40886836c814353f/src/x_connective.c#L398

I suggest

 |
[t a a]
 |   |
 |  [select 12 12]
 |  |
[t a a] rejected
 |   |
 |  [select 12]
 |   |
 |   12 b
 |
[select 12]
 |
12 a

assuming your 12 is just a placeholder for your real problem (maybe $arg 
stuff?)



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Reset phase of phasor~ in DSP domain only?

2018-12-31 Thread Claude Heiland-Allen

Hi Nicolas,

On 31/12/2018 15:28, Nicolas Danet wrote:

Is there any clever trick to reset the phase of a [phasor~] in the DSP domain 
only (i.e. WITHOUT using the right inlet)?


You could maybe make something after the [phasor~]  using [samphold~] 
and [-~] and [wrap~]?


phasor~
|\
| \    falling edge to snapshot
|  |    /
|  samphold~
|  |
-~
|
wrap~
|

No time to check the details now.


Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] Pd 0.49-0 released

2018-09-26 Thread Claude Heiland-Allen

Hi,


Neither "apt-get remove puredata" nor "apt-get purge puredata" did uninstall
my Pd 0.47 version.
I'm on Debian Stretch 9.5 .


"puredata" is a meta package, that depends on the real components:

$ apt show puredata
...
Depends: puredata-core, puredata-gui, puredata-doc, puredata-extra, 
puredata-utils, puredata-dev

...

So you'd need to unsinstall them also, perhaps "apt autoremove" can do it?

Possibly it is a bug in Debian that "puredata" version X doesn't depend 
on "puredata-core" version X ?



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Some patches broken in 0.49test3

2018-09-22 Thread Claude Heiland-Allen

Hi Roman,

On 22/09/18 23:19, Roman Haefeli wrote:

Hi

Sorry, need to report something probably more serious. Some of my
patches trigger messages like the following:


(Tcl) INVALID COMMAND NAME: invalid command name ".x558795b0c400.c"
 while executing
".x558795b0c400.c itemconfigure 558795b682c0LABEL -font {{DejaVu Sans Mono} -11 
bold}"
 ("uplevel" body line 10)
 invoked from within
"uplevel #0 $docmds"


Side effects are that sometimes the label of [cnv] is not updated. Or
the canvas stays blank after dynamically creating stuff and objects are
only shown after closing the window and opening it again.
You might try my (unfortunately too slow for anything other than 
debugging) attempt here:

https://github.com/claudeha/pure-data/tree/gui-tcl-robustness

It may reduce the impact of the error, or perhaps show further errors...

I don't have a small patch yet that triggers the problem, but will try
to figure one out.

I reported something possibly-similar here:
https://github.com/pure-data/pure-data/issues/488

toplevel patch contains a
non-GOP abstraction which contains a
GOP abstraction which
sets iemgui properties on loadbang results in
invalid command name tcl error

BTW.: this is with  0ee284ecfb5215



Claude
--
https://mathr.co.uk




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] error compiling Gem on ubuntu 17.10

2018-08-06 Thread Claude Heiland-Allen

Hi,

On 06/08/18 18:31, Csaba Láng wrote:

E: You must put some 'source' URIs in your sources.list
Oh I forgot this step, sorry.  For Debian, I edit /etc/apt/sources.list 
and duplicate lines starting "deb" with copies starting "deb-src" 
instead.  Ubuntu maybe slightly different (perhaps it uses files in 
/etc/apt/sources.list.d/).


sudo nano /etc/apt/sources.list

make a backup first, if you are unsure.  after editing, run

sudo apt update

to refresh the package cache, and retry the build-dep command.


Can you send mi where can I find the dependecies to Gem?


https://salsa.debian.org/multimedia-team/pd/gem/blob/master/debian/control#L11

but the apt build-dep command gets all of that programmatically



On Mon, Aug 6, 2018 at 7:29 PM Claude Heiland-Allen 
mailto:cla...@mathr.co.uk>> wrote:


Hi,

On 06/08/18 18:12, Csaba Láng wrote:
> Dear list,
> i try to compile on a freshly installed system Gem from
> https://github.com/umlaeute/Gem
>
[...]
> I wuld gladly have all the options especially for pix_video to
have a
> choice (the real aim is to have videoPYLON get wrked on this system)
sudo apt build-dep gem

should get most (all?) of the dependencies needed

> but make stops at this point:
> *TextBase.h:38:12: fatal error: FTFont.h: No such file or directory
>  #  include "FTFont.h"*
>     ^~
> compilation terminated.
> What do I miss?

https://packages.ubuntu.com/search?searchon=contents=FTFont.h==artful=any
-> libftfl-dev has /usr/include/FTGL/FTFont.h

> installed Gem with aptitude together with puredata cannot even
create
> any Gem related objects.
did you load -lib Gem ?




Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] error compiling Gem on ubuntu 17.10

2018-08-06 Thread Claude Heiland-Allen

Hi,

On 06/08/18 18:12, Csaba Láng wrote:

Dear list,
i try to compile on a freshly installed system Gem from 
https://github.com/umlaeute/Gem



[...]
I wuld gladly have all the options especially for pix_video to have a 
choice (the real aim is to have videoPYLON get wrked on this system)

sudo apt build-dep gem

should get most (all?) of the dependencies needed


but make stops at this point:
*TextBase.h:38:12: fatal error: FTFont.h: No such file or directory
 #  include "FTFont.h"*
    ^~
compilation terminated.
What do I miss?

https://packages.ubuntu.com/search?searchon=contents=FTFont.h==artful=any
-> libftfl-dev has /usr/include/FTGL/FTFont.h

installed Gem with aptitude together with puredata cannot even create 
any Gem related objects.

did you load -lib Gem ?


Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] How to implement an @ argument in an external object?

2018-08-02 Thread Claude Heiland-Allen

Hi Alexandros

You can compare symbols for string equality by pointer equality (because 
symbols are interned in a table and never released - fast equality check 
is the whole point of symbols in Pd).


Something like this (untested):

static t_symbol *s_at_sync = 0;
extern void foo_setup(void)
{
  s_at_sync = gensym("@sync");
  ...
}

void *foo_new(int argc, t_atom *argv)
{
  if (atom_getsym(argv[3]) == s_at_sync)
  {
 sync();
  }
  ...
}

Or you can get the pointer to the symbol's string from the symbol 
struct, see m_pd.h for details.  You must not modify the string, but you 
could access it to see if it starts with '@' for example.



Claude

On 02/08/18 21:02, Alexandros wrote:


Coming back to this thread after some time.

I'm trying to check whether a given argument to an external I'm 
writing starts with "@" or if it is actually "@sync", but can't seem 
to make it work. Can't really understand how t_symbol works. I'm 
iterating though the arguments with int argc and t_atom *argv and if 
there are the right number of arguments, I'm retrieving the argument 
that's supposed to be "@sync" with atom_gensym(argv);


I don't know how to compare that to a hard-coded string, like "@", or 
"@sync". I tried comparing straight to these strings, tried strcmp(), 
but I don't know how to do this, and couldn't find examples online.


Any hints?


On 26/02/2018 07:36 μμ, IOhannes m zmölnig wrote:

On 02/26/2018 08:09 PM, Alexandros wrote:

Being informed about the mailing list archive correct link, I searched
for messages about this but didn't find something (it's possible I've
missed something though).

I'm writing an external and I want to use an @ argument (for example
"@sync hard"). How does one implement this in C code?


either use flext (but then you write C++) and it comes for free.

or simply iterate over the arguments, looking for symbols starting with
"@" (or simply search for symbols that are "@sync"), then check whether
there's another argument after that and see which value it has.

fgdamrs
IOhannes



___
Pd-list@lists.iem.at  mailing list
UNSUBSCRIBE and account-management 
->https://lists.puredata.info/listinfo/pd-list




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] iOS: writesf~ problem

2018-07-12 Thread Claude Heiland-Allen

Hi Artem,

On 12/07/18 13:28, ar...@katlenok.ru wrote:

Hello community,

I am having a problem when recording a soundfile using pure data in my 
iOS application.


Just like David’s message here: 
https://www.mail-archive.com/pd-list@lists.iem.at/msg08232.html

I am having same behaviour with endless recursion:

writesf waiting for disk write..
(head 524032, tail 0, room 256, want 256)
... done waiting.


I got floods of this message when using -batch with something like

[open /path/that/does/not/exist.wav, start(--[writesf~ 2]

so maybe check that you have a valid writeable path...

In my case it was a typo on desktop Linux and easy to fix.  I don't know 
where iOS lets you write files.



Claude



Pure Data is integrated in iOS app using cocoapods.

Maybe someone has some ideas? Maybe someone had this issue?

Many thanks,
Sincerely,

Artem


--
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] use gl_VertexID

2018-06-14 Thread Claude Heiland-Allen

Hi Philippe,

On 14/06/18 10:51, Philippe Boisnard wrote:

I continue to search to use gl_VertexID

when I want to declare a version in vertex shader script, I want to declare for 
example
#version 2.1 (it’s the openGL version when I check with print gemwin)
but I have this in the PD_Terminal
ERROR: 0:1: '' :  version '2' is not supported


The GL/GLSL version numbering is a bit obscure:

https://stackoverflow.com/questions/19021567/finding-supported-glsl-version#19022416

For OpenGL 2.1 you need this as first line of your shader:

#version 120

The good news is that gl_VertexID is supported in almost all GLSL versions:

http://docs.gl/sl4/gl_VertexID

For OpenGL ES (as found on embedded devices, eg mobile phones) you might 
not be so lucky:


http://docs.gl/el3/gl_VertexID

But I don't know if Gem supports attribute-less rendering (ie, just 
using gl_VertexID without any vertex data or element index buffers).



Claude

Can I  use a version 2 for a vertex shader ?

if I don’t declare a version
gl_VertexID is not recognized

Philippe




Le 14 juin 2018 à 06:27, Philippe Boisnard  a écrit :


Hello

I have a question about shader
I search to work with gl_VertexID in .vert script.
Some one have an example to implement this in .vert.
With gl_VertexID, you can have an array of vertex with no input array for VBO 
and you can detreminate in real time the size of VertexArray with no latencies.
I know that we can use this, but I have difficulties.

best regards

Philippe
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Random

2018-05-30 Thread Claude Heiland-Allen

On 30/05/18 15:17, Jean-Marie Adrien wrote:

Hi everyone,
trying to open a patch with a different text on screen each time random.
Used random object as always since 20 years with a loadbang.
Discovered that this loadbang/random seems to generate always the same result 
on opening
:)

It's a feature.  But not having non-determinism is a bit awkward sometimes.


What is the correct way to get a random digit on patch load within say 30 
choices ?


You can generate a random number before starting Pd and -send it to your 
patch on load.

(requires knowledge of shell/cmd scripting)
(this is the approach I took in my 'dynamo' project: 
https://code.mathr.co.uk/dynamo )


You can try to read raw binary data from /dev/urandom, perhaps with 
[soundfiler] or [readsf~]

(requires an OS with this device, and I have not tested it)

You could try reading from [adc~] or analogue sensor pins
(requires some unpredictable signal input, possibly special hardware)

You could try [delay] with [realtime]
(you might get one or two bits of randomness each time)

You could try an external
(maybe some function of calendar time will look random enough? I think 
zexy has date support)



Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] "too many open files" error in 0.48.1

2018-05-21 Thread Claude Heiland-Allen



On 21/05/18 19:35, ub@xdv wrote:

hello,

On 20.05.2018 06:50, Liam Goodacre wrote:

In 0.48.1 on Ubuntu, I'm getting a horrible scenario where PD refuses to
open patches or create any more abstractions for me. I get an error
message saying "too many open files". Granted I have a lot open, but
this is a serious problem as it means I can't access all of my old
performances. They worked fine in 0.47.

Any ideas?

this is not really a problem with pd


I disagree.  The most common cause of "too many open files" is a bug in 
closing files properly, because 1024 simultaneously-open files should be 
enough for most use cases.



Claude


, but with your shell- or system
configuration limiting the number of open file descriptors.

check your current shell-limit with
ulimit -Sn
-S is for soft limit (you can lower, but not raise, the hard limit).
raise the limit in your shell with
ulimit -n 65536
start pd from that shell and see if the situation improves.

if that doesn't help, you can check the kernel limits with
cat /proc/sys/fs/file-nr
which returns 3 numbers, the first of which is the number of open files,
the last of which is the limit.

increase the value of "nofile" in  /etc/security/limits.conf
do
sudo sysctl -p

additional steps are required to make these settings permanent, the
ulimit -n 65536 would have to go into your .bashrc so it's executed at
system startup. if you normally start pd from your GUI you'd have to
restart your system (actually just xorg) so your master shell knows
about the new value. there's other ways, one of which would be to start
pd from a wrapper script, or probably gnome provides that sort of
environmental setup for it's program shortcuts.

there's more information
-
https://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user
-
https://unix.stackexchange.com/questions/29577/ulimit-difference-between-hard-and-soft-limits

hope that helps ... cheers,
ub


Liam


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] PdLua for ARM

2018-05-12 Thread Claude Heiland-Allen

Hi Alexandros,

If you're on ARM, I guess you might be on a Linux, in which case maybe 
check your package manager instead of building from source - afaik 
Debian has a package for all architectures.


On 12/05/18 14:43, Alexandros wrote:

In deken there's no binary of PdLua for ARM. In the README for the Linux
binary I read this:


Binary distribution doesn't include sources I suppose...

You can get some recently updated (2 months ago, with Lua 5.3 
compatibility) sources here:


https://github.com/agraef/pd-lua
git clone https://github.com/agraef/pd-lua.git

It seems to have a new build system included there.

My original version (~2013 era) is still there if you want to use 
earlier Lua releases (not sure if it's 5.1 or 5.2 compatible):

https://code.mathr.co.uk/pdlua
git clone https://code.mathr.co.uk/pdlua.git

There is also mrpeach's version in sourceforge SVN, I think that is 
in-between in terms of freshness (it might have more bug fixes and 
features).  But I had trouble with it at some point because it didn't 
have a self-contained build system and I didn't feel like checking out 
the whole externals tree to get one.



Claude
--
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] PdLua on Mac OS X El Capitan not working

2018-05-07 Thread Claude Heiland-Allen

Hi Jens,

On 2018-05-07 14:37, Jens Ahrens wrote:

Pd lists that it is trying to unsuccessfully load a set of files

tried
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello.d_fat
and failed
tried
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello.pd_darwin
and failed
tried
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello/hello.d_fat
and failed
tried
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello/hello.pd_darwin
and failed
tried
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello.pd
and failed
tried
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello.pat
and failed
tried
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello/hello.pd
and failed

It repeats this pattern in many more folders. I don’t seem to have any
of these files. I only have the following:

/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello.pd_lua
/Applications/Pd-0.48-1.app/Contents/Resources/extra/pdlua/hello.pd_luax


If Pd is not outputting lines of the type "tried .../hello.pd_lua ..." 
then that means the Lua loader has not been registered with Pd.  Perhaps 
you are missing a "-lib pdlua" startup flag (adding just the "-path" is 
not enough).



Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Pitch correction abstraction based on I10.phase.bash.pd

2018-03-14 Thread Claude Heiland-Allen
On 14/03/18 22:18, jlistshit wrote:
> Would you mind sending the example patch again, or privately to me? Digest 
> mode scrubs attachments here.

You can download attachments from the list archives.  For example from:
https://lists.puredata.info/pipermail/pd-list/2018-03/121980.html

> Thanx a lot!

Hope this helps,


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Speech recognition on Pure Data

2018-02-28 Thread Claude Heiland-Allen
Hi,

On 28/02/18 16:53, Ariane stolfi wrote:
> I'm planning to work on a project that will use a microphone to query on
> freesound database, and we are planning to use speech recognition to
> send the queries.  We will use pure data installed in a Bella board and
> e-textile sensors to process the sound.
> 
> I'm considering send audio and do the speech recognition in a server
> using the Google API or use Sphynx to do the recognition in Pure data.
> Does anyone here has any experience with this recently and can make a
> suggestion?

I used pocket_sphinx from the command line in one project (that didn't
use Pd)[1] The key line for speech transcription in my shell script is:
utterance="$(pocketsphinx_continuous -infile utterance.wav 2>/dev/null)"
The input was synthetic sound, so rather noise-free ideal conditions.

I imagine that you could use Pd to do something like detect presence of
sound and save the segment to a wav file, calling out to Sphinx with a
scripting external.  The same process would be necessary for Google API
I suppose, unless you intend to be streaming everything there.


Claude

[1] https://mathr.co.uk/blog/2017-04-08_divergent_protocol.html
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Mailing list archive not being updated?

2018-02-26 Thread Claude Heiland-Allen
On 26/02/18 18:05, Alexandros wrote:
> Checking the mail archive found on Pd's website (puredata.info), which
> is this
> 
> https://www.mail-archive.com/pd-list@iem.at/maillist.html
> 
> and sorting the messages by date, the latest I get is from 2014/05/12.
> Should I be looking somewhere else to find more recent messages?

https://lists.puredata.info/listinfo is what I use, though it is a bit
hard to find what you want sometimes...  browse to whichever list you
want, then follow the archives link, then search or navigate by monthly
indices.

https://www.mail-archive.com/pd-list@lists.iem.at/maillist.html
also works (note the extra "lists." in the address).

maybe the link you found needs to be updated?


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] absolute values of a list of numbers?

2018-02-16 Thread Claude Heiland-Allen
Hi Peter,

On 16/02/18 13:43, Peter P. wrote:
> I am using William Brent's [cepstrum~] to calculate cepstral
> coefficients from a section of an audio signal. My object outputs 512
> the real-valued coefficients as pd message list, which I would like to
> convert to their absolute value. I can't seem to find an easy way to do
> this except for possibly sending the list to an array and using tabread
> to serialize, calculate the absolute value for every element and send it
> back to another array, then requesting it as a list again. Has anyone
> got a better idea? 

you could put it in a table of size 512, then trigger dsp in a switch~d
off subpatch with blocksize 512:

"0, bang"
 |
[switch~ 512]

[tabreceive~]
 |
[abs~]
 |
[tabsend~]

Order of execution means you can use the same table at both ends.

Then copy the table to a list ([array get] ? Not sure of the best way
these days).

If the list were longer or not a power of two you could use [tabplay~]
and [tabwrite~], with multiple bangs to the [switch~] if necessary.


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] resizing object in abstraction+subpatch 0.48.1 weirdness - anybody else?

2018-01-21 Thread Claude Heiland-Allen

Hi Derek,

On 2018-01-21 12:30, Derek Kwan wrote:
I've been making abstractions and putting subpatches in abstractions 
and
then resizing the subpatch as it appears in the abstraction (meaning 
the

[pd subpatch] box) to make it wider and then saving the abstraction. I
can't point to any consistent behavior, but at times when I reopen the
abstraction after saving I'm seeing the [pd subpatch] object at its
normal width and something in the subpatch possibly taking on the
resized width that I wanted for the [pd subpatch] object (even message 
boxes).


It's not just you, as it's already been reported:

#1306 subpatch object width moves to last created object in subpatch
https://sourceforge.net/p/pure-data/bugs/1306/

Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Can't load external I put together and want to test

2017-12-26 Thread Claude Heiland-Allen

On 26/12/17 16:33, Alexandros wrote:

load_object: Symbol "sync_phasor_tilde_setup" not found

There is a sync_phasor_tilde_setup() method in my code though. It's this:

void sync_phasor_tilde_setup(void)


Maybe this should be:

extern void sync_phasor_tilde_setup(void)

For Windows there may be other incantations necessary (?), but for your 
Linux it should be enough, if indeed the missing extern is the problem.



Claude
--
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] efficient approximation of trig functions for hi pass formula

2017-12-20 Thread Claude Heiland-Allen
Hi,

On 20/10/16 01:20, Jonathan Wilkes via Pd-list wrote:
>> I think a core commenting sprint would be *very* helpful, specially to
> those of us
>> (me) who would like help in understanding the black magic inside.
> 
> Does anyone know a tool that will display the line number of a vim
> session in
> a large rectangle next to the terminal window?

With X11 and ffmpeg (so, probably Linux):

ffplay -f x11grab -video_size 96x32 -framerate 10 -i :0.0+0,1048 -vf
scale=in_w*8:-1

will embiggen the bottom left pixels of a 1080p display.  Add some
swscaler flags to not make it blurry, perhaps, though youtube will
probably blur it for you again. Read `man ffmpeg-filters` for that.


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] initbang in vanilla (was Re: how to destroy/delete an object with dynamic patching?)

2017-10-19 Thread Claude Heiland-Allen
On 19/10/17 16:23, IOhannes m zmölnig wrote:
> On 10/19/2017 03:20 PM, Alexandre Torres Porres wrote:
>> If not, since I do not want dependancies to other external libraries, 

Why?

>> the
>> only way would be to "steal" it for my library, huh? What are the ethics on
>> that?
> 
> (you probably deserve eternal damnation for such a thing.)
> most likely you will discover another issue that has been neatly solved
> in iemguts in a week or two. and steal that.
> and then you discover that iemguts hsa other nifty things.
> and just steal all of them, until you have stolen it all. just for the
> sake of "not having a dependency".

And then original upstream iemguts gets some new bugfixes, and your copy
is still buggy.

> apart from that, iemguts is licensed under the GPL-2+.
> everybody is free to use it under this license (but note, that e.g. ELSE
> is currently not compatible with GPL)

Important point.


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Is Pd clip the audio output?

2017-10-19 Thread Claude Heiland-Allen
On 19/10/17 15:56, Christof Ressi wrote:
> -1 to 1 is the maximum range for floating point audio samples. there's 
> nothing else you can do than clipping if you exceed that range.

A simple test on Linux with JACK shows that Pd doesn't clip audio that
exceeds -1 to 1:

https://mathr.co.uk/tmp/jack-no-clip.png screenshot

Other API may be different, and the driver may clip (or do other
dynamics processing) before sending to the hardware.

>> Von: "Nicolas Danet" 
>> In the "A02.amplitude.pd" example it is claimed that:
>>
>> "Amplitudes of audio signals can have any reasonable range, but when you 
>> output a signal via the dac~ object, the samples should range between -1 and 
>> +1. Values out of that range will be clipped."
>>
>> Is that still true in current version (Pd-0.48-0)?
I tested with a less current version:

$ pd -version
Pd-0.47.1 ("") compiled for Debian (0.47.1-3) on 2016/11/28 at 20:56:10 UTC


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] PuREST JSON 1.4.2 "Argo in shipyard" released

2017-10-18 Thread Claude Heiland-Allen
Hi,

On 18/10/17 14:45, Jack wrote:
> Or, maybe, i can install puredata-core without deps. In this case, how i
> can do that ?

you can't install without deps, but you can install without recommends:

$ man apt-get
/recommends

gives:

   --no-install-recommends
   Do not consider recommended packages as a dependency for
   installing. Configuration Item: APT::Install-Recommends.

$ man aptitude
/recommends

gives:

   -R, --without-recommends
   Do not treat recommendations as dependencies when installing new
   packages (this overrides settings in /etc/apt/apt.conf and
   ~/.aptitude/config). Packages previously installed due to
   recommendations will not be removed.

   This corresponds to the pair of configuration options
   APT::Install-Recommends and APT::AutoRemove::RecommendsImportant.


but unfortunately:

$ man apt
/recommends

gives no results, same in man pages for apt.conf and apt_preferences

sorry for having suggested the manuals are all helpful,


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] PuREST JSON 1.4.2 "Argo in shipyard" released

2017-10-18 Thread Claude Heiland-Allen
On 18/10/17 12:07, Jack wrote:
> Le 18/10/2017 à 12:36, IOhannes m zmoelnig a écrit :
>> deken is not really meant for such use cases at all.
>>
>> however, other package management systems do provide means to track ABI
>> changes in libraries. e.g. "apt", the Debian package manager.
>> so if you have the option to use the Debian packages, please use them.
>> all these problems will be gone!
> Is there a reason that when I try to do :
> $ sudo apt install pd-purest-json
> 
> apt tries to download :
> gem gem-doc gem-extra gem-plugin-gmerlin gem-plugin-lqt
> gem-plugin-magick gem-plugin-v4l2 pd-libdir pd-purest-json puredata
> puredata-core puredata-doc puredata-extra puredata-gui puredata-utils

apt chases dependencies (which it must to keep your system functional),
and recommendations (though you can turn that off if you want, the
manual explains how)

here are the depends and recommends my install finds today:

$ apt-cache show pd-purest-json | grep -e ^Depends -e ^Recommends
Depends: libc6 (>= 2.4), libcurl3-gnutls (>= 7.16.2), libjson-c3 (>=
0.10), liboauth0 (>= 0.9.1), puredata-core | pd
Recommends: pd-libdir

$ apt-cache show puredata-core | grep -e ^Depends -e ^Recommends
Depends: libasound2 (>= 1.0.16), libc6 (>= 2.14), libportaudio2 (>=
19+svn20101113)
Recommends: puredata-gui

$ apt-cache show puredata-gui | grep -e ^Depends -e ^Recommends
Depends: python3:any, tk (>= 8.4), tcl8.5 | tclsh
Recommends: puredata

$ apt-cache show puredata | grep -e ^Depends -e ^RecommendsDepends:
puredata-core, puredata-gui, puredata-doc, puredata-extra,
puredata-utils, puredata-dev
Recommends: gem

$ apt-cache show gem | grep -e ^Depends -e ^Recommends
Depends: libc6 (>= 2.15), libftgl2 (>= 2.1.3~rc5), libgcc1 (>= 1:3.0),
libgl1-mesa-glx | libgl1, libglew2.0 (>= 1.12.0), libglu1-mesa |
libglu1, libice6 (>= 1:1.0.0), libsm6, libstdc++6 (>= 5.2), libxxf86vm1,
zlib1g (>= 1:1.1.4), puredata-core | pd
Recommends: gem-doc, gem-extra, gem-plugin-gmerlin | gem-plugin-film,
gem-plugin-magick | gem-plugin-image, gem-plugin-lqt |
gem-plugin-record, gem-plugin-v4l2 | gem-plugin-video

> I still have installed Pd from source (idem for Gem) ?

apt doesn't know or care about that


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] simple bypassing

2017-10-12 Thread Claude Heiland-Allen
On 12/10/17 21:43, Pagano, Patrick wrote:
> I know we are trying to avoid spigot~ but i have an old patch i am
> trying to convert and i would like to pass the signal through clean and
> or into an effect based on a simple bang can someone remind me what that
> looks like?
> 
> I don;t have access to my dropbox where i made a replacement with *~s

I created the attached for you, took about 10 mins, you may donate some
coins to Electronic Frontier Foundation (EFF) or Free Software
Foundation (FSF) as recompense for my efforts.


Claude
-- 
https://mathr.co.uk
#N canvas 3 63 450 445 10;
#X obj 111 141 select3~;
#X obj 121 58 osc~ 100;
#X obj 143 80 osc~ 200;
#X obj 158 109 osc~ 300;
#X obj 52 62 vradio 15 1 0 3 empty empty empty 0 -8 0 10 -262144 -1
-1 2;
#X text 200 56 0;
#X text 216 81 1;
#X text 231 110 2;
#X msg 60 22 -1;
#X text 89 25 select none of the inputs (silence \, 0);
#X obj 101 227 dac~;
#X obj 108 187 *~ 0.1;
#X msg 285 197 \; pd dsp \$1;
#X obj 283 166 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 27 256 exercise: use dynamic patching to create [inlet~] on
initbang \; so that you can write [select~ 3] or [select~ 17] \; this
is why the control inlet is left-most;
#X text 26 337 exercise: extend the implementation with [vline~] and
short ramps (perhaps with settable time as the second float in the
input control message) \, to avoid clicks;
#X connect 0 0 11 0;
#X connect 1 0 0 1;
#X connect 2 0 0 2;
#X connect 3 0 0 3;
#X connect 4 0 0 0;
#X connect 8 0 0 0;
#X connect 11 0 10 0;
#X connect 11 0 10 1;
#X connect 13 0 12 0;
#N canvas 3 58 450 300 10;
#X obj 21 29 inlet;
#X obj 112 33 inlet~;
#X obj 113 104 *~ 1;
#X obj 137 83 == 0;
#X obj 113 211 outlet~;
#X obj 182 33 inlet~;
#X obj 183 104 *~ 0;
#X obj 207 83 == 1;
#X obj 256 35 inlet~;
#X obj 257 106 *~ 0;
#X obj 281 85 == 2;
#X connect 0 0 3 0;
#X connect 0 0 7 0;
#X connect 0 0 10 0;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 3 0 2 1;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
#X connect 7 0 6 1;
#X connect 8 0 9 0;
#X connect 9 0 4 0;
#X connect 10 0 9 1;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] going from signals to events?

2017-09-03 Thread Claude Heiland-Allen

Hi Ali,

On 2017-09-03 15:36, Ali Momeni wrote:

what are your favorite objects for going from signals to events?

specifically, i'd like to make a sample accurate / audio-driven
sequencer.


Note that signal-to-event in Pd's architecture necessarily means the 
events occur up to 1 DSP block later than intended, and possibly not 
scheduled on Pd's logical clock (I haven't checked the source of eg 
[threshold~] to see if it schedules with constant 1-block latency vs 
variable as-soon-as-possible on the next block boundary latency, but I 
suspect the latter). So you'll get late events with up to 1.5ms jitter, 
with default settings.


If you want a sample-accurate audio-driven sequencer, you really need to 
keep everything in the signal domain.  See for example the 0xA expr~ 
tutorials at https://archive.bleu255.com/0xA/



Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] tanh~ (core dumped)

2017-09-01 Thread Claude Heiland-Allen
On 01/09/17 06:42, Claude Heiland-Allen wrote:
> On 15/08/17 23:46, Matt Davey wrote to <pd-list@lists.iem.at>:
>> I've always used:
>>
>> tanh(x) ~= x*(27+x*x) / (27+9*x*x)
>>
>> works well and is pretty CPU cheap
> 
> Nice.
I also see it's smooth if you clip the input to -3..3:
http://www.musicdsp.org/showone.php?id=238 found via a comment in
https://github.com/enzienaudio/heavylib/blob/master/hv.tanh.pd


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] tanh~ (core dumped)

2017-08-31 Thread Claude Heiland-Allen
On 15/08/17 23:46, Matt Davey wrote to :
> I've always used:
>
> tanh(x) ~= x*(27+x*x) / (27+9*x*x)
>
> works well and is pretty CPU cheap

Nice.

That seems accurate to about 5 or 6 bits in my tests (over the range -4
to 4). A slightly more accurate (about 7 or 8 bits) variant is:

x * (27.2837670294674 + 1.22070209109864 * x * x)
  / (27.2837670294674 + 9.86205301460732 * x * x)

A higher degree version is accurate to about 16 or 17 bits:

x * (44220389.1067293 + 4672204.74255456 * x * x
  + 34604.8550273853 * x * x * x * x)
  / (44220389.1067293 + 19409074.7654446 * x * x
  + 612890.122925575 * x * x * x * x)

(Though I realize now, later, that there is some redundancy and they
could be normalized to have a leading "1 +" instead of these large
values...)

I found these using gnuplot's fit functionality:

F(x) = x * (a + b * x * x) / (a + c * x * x)
fit F(x) 'tanh.dat' via a,b,c

and similarly for the higher degree version.  'tanh.dat' contains 1024
equally spaced samples of x,tanh(x) in [-4,4], calculated in double
precision with a small C program, similar to the input generation in the
help patches.

I evaluated the accuracy visually in gnuplot:

bits(x,y) = log(abs(y - tanh(x))+2**(-53)) / log(2.0)
plot [-4:4] bits(x,F(x))

I don't know if single-precision rounding will affect the results much.
 I put the full precision coefficients into the patches using a text
editor, so  double precision Pd can benefit just in case.

It's probably also best to use [clip~ -4 4] before these functions, to
avoid possible Inf or NaN explosions, or maybe [clip~ -1 1] afterwards
would  be enough to be safe?

I haven't benchmarked yet.

Consider the patches placed into the Public Domain.  Message-rate
versions are left as an exercise.


Claude
-- 
https://mathr.co.uk


tanh~.tar.gz
Description: application/gzip


signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] tri function in [expr~]

2017-08-13 Thread Claude Heiland-Allen

Hi Derek,

On 2017-08-13 17:33, Derek Holzer via Pd-list wrote:

Dear list,

I am transcribing some code from C to Pd expressions, and I am
wondering how I might best get the tri function working since it's not
native to expr.


My favourite triangle function is more expensive (division, branching) 
but has a variable shape:


[expr~ if ($v1 < $v2, $v1 / $v2, (1 - $v1) / (1 - $v2))]

all of $v1, $v2, output are in [0..1), with $v2=0.5 for symmetrical 
triangle



I have been using this expression as my triangle function:

(min($v1, 1- $v1) - 0.25) * 4

So for this example:

wave_x = .5-triangle((phasor-9/16)/(2/16))*.5;


here you have 0.5 - (... * 0.5)


I have tried the following, which doesn't function correctly compared
with the original C:

[phasor~ 200]
|
[expr~ ($v1-9./16.)/(2./16.)]
|
[expr~ (0.5 - (min($v1, 1.- $v1) - 0.25) * 4.) * 0.5]


here you have (0.5 - ...) * 0.5, which isn't the same


|
[s~ wave_x]

I am quite sure I have made some errors in the syntax somewhere, and I
did trial-and-error many other combinations before arriving at this
one. Would someone more math-literate than me care to help work this
out?

SIDENOTE: when is it necessary to force expr~ to consider a number as
a float by using a decimal?

(9/16) doesn't work but (9./16.) does.


I think int/int -> int with truncation is the most common occasion where 
it matters in practice (except possibly overflow/wrapping with large 
ints?).  If at least one argument is a float it should promote the other 
to float too and give a float result.



((min($v1, 1- $v1) - 0.25) * 4) works regardless of whether the 1 and
the 4 have a decimal point following them or not.


$v1 is a float so the 1 in 1-$v1 is promoted from int to float.
min(float, float) is a float so the 4 is promoted to float too.


Thanks much!
Derek


hth,


Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] shaders + erosion filter

2017-07-07 Thread Claude Heiland-Allen
On 07/07/17 12:00, hi via Pd-list wrote:
[...]
> step_w = 1.0 / 640.0;
> step_h = 1.0 / 480.0;
[...]
> tmp = texture2DRect(sourceTexture, vec2 ( pos.s + 
> float(i)*step_w, pos.t + float(j)*step_h ) ).rgb;

texture2DRect() expects integer-per-texel coordinates in the range
[0..size), so your step_w and step_h should be 1.0 to get neighbouring
texels.

See Matias Valdenegro's comment here:
https://stackoverflow.com/questions/6736531/where-can-i-find-documentation-on-the-opengl-shader-function-texture2drect#6737327


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] vline~ with switch~ off

2017-06-07 Thread Claude Heiland-Allen
On 08/06/17 03:21, Miller Puckette wrote:
> This isn't fixed (and I'm not sure it's fixable)... better use spigots to stop
> messages from gettingt o vline~s on switched-off windows.

what about this approach?  one issue of my implementation is that it
prunes segments too early if the block size is increased beyond 1second,
maybe it's possible to fix that...

https://lists.puredata.info/pipermail/pd-dev/2008-03/00.html
https://lists.puredata.info/pipermail/pd-list/2016-07/115757.html

> On Thu, Jun 08, 2017 at 03:28:36AM +0200, Matt Davey wrote:
>> Actuallyis there any way just to turn off all control messages in
>> patches that have [switch~] turned off?  I mean, how often do you want
>> those going through when the signal objects aren't being processed?

How would you switch it back on?


Claude
-- 
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Execute command from Pd

2017-05-29 Thread Claude Heiland-Allen
On 29/05/17 23:30, Peter P. wrote:
> In cases where pd is started from the command line one could write a
> wrapper script that gets the directory of the patch file that would have
> to be passed to pd as argument. The script could then relay this info to
> pd using pdsend probably.

pd has a -send command line argument that is useful for this kind of
thing.  Using pdsend from a startup script is prone to a race condition
(how do you know when pd is ready to recieve the message?).


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] nqpoly~ and dynamic object generation, loadbang issue?

2017-04-17 Thread Claude Heiland-Allen
On 17/04/17 19:56, Samuel Burt wrote:
> *[loadbang]
> doesn't trigger* when created *within a dynamically generated
> abstraction*. 

Send a [loadbang( message to the canvas after creating the abstraction
instances in it.


Claude
-- 
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] .pdrc?

2017-04-13 Thread Claude Heiland-Allen
Hi,

With no ~/.pdsettings, putting -noautopatch into my ~/.pdrc works as
expected. Tested with:

$ pd -version
Pd-0.47.1 ("") compiled for Debian (0.47.1-3) on 2016/11/28 at 20:56:10 UTC


On 13/04/17 23:58, Peter P. wrote:
> Strangely neither setting 
> 
> -noautopatch
> 
> nor 
> 
> noautopatch
> 
> in my ~/.pdsettings disables autopatching. Specifying it on the command
> line does work though. Can anyone else reproduce this?

~/.pdsettings has a strange format, more complex than ~/.pdrc - it's
meant to be edited and saved via the GUI.


Claude
-- 
https://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] test audio signals: Are there <~ and >~ objects?

2017-02-06 Thread Claude Heiland-Allen
On 06/02/17 12:45, Roman Haefeli wrote:
> On Mon, 2017-02-06 at 07:34 -0500, Peter P. wrote:
>> Are there <~ an >~ objects or
>> equivalents?
> 
> The zexy library comes with [<~] and [>~] (and a couple of other signal
> comparators).

You can also use [expr~] (built-in vanilla) for these.


Claude
-- 
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] Rotary controllers for finetuning data?

2017-01-10 Thread Claude Heiland-Allen
On 10/01/17 21:31, Esa Ruoho wrote:
> Any ideas how to go about it?

The [value] object will likely help you, along with [select] and
[trigger] (which can be abbreviated to [v], [sel] and [t]).  Remember to
use $0 in the name of the [v], if you want multiple instances of your
patch or abstraction to be independent.

A pattern you might find useful is:

control message
 |
[t b  a]
 ||
[value x] |
 ||
some process
 |
[t b f]
 | /
[value x]
 |
updated value


Claude
-- 
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] plans for Pd 0.48

2017-01-10 Thread Claude Heiland-Allen
On 10/01/17 14:46, oliver wrote:
> 4.) a position outlet for [readsf~], signal or message

You can use [timer] for this, as [readsf~] is constant speed.

(I tried a complicated [fexpr~]-based solution with integrated wrapping
to avoid getting stuck after some minutes, but it drifted badly from
clock time due to accumulated rounding errors - Pd's clocks are much
more accurate and simpler to use too.)


Claude
-- 
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] efficient approximation of trig functions for hi pass formula (was: could vanilla borrow iemlib's hi pass filter recipe?)

2016-10-21 Thread Claude Heiland-Allen
Hi,

On 19/10/16 15:25, Jonathan Wilkes via Pd-list wrote:
> When implemented in C, which approach takes the least amount of time 
> to read, reason about, and fully comprehend?

Agreed, as changing filter frequency at message rate is probably a
relatively cold code path, I vote for something like:

double w = 2 * pi * fmin(fmax(fc / SR, 0), 0.5);
double k = (1 - sin(w)) / cos(w);

Maybe t_sample would be better than double, but then you'd need C99
type-generic maths or other similar macro tricks (or C++) to call sin or
sinf as appropriate.

>  From: katja 
>  Sent: Wednesday, October 19, 2016 9:06 AM
>  Subject: [PD] efficient approximation of trig functions for hi pass formula 
> (was: could vanilla borrow iemlib's hi pass filter recipe?)
>
> Changing the thread title to reflect the new approach. Extract of the
> original thread;
> 
> - I suggested using iemlib's hi pass filter recipe to improve
> frequency response of [hip~]
> - Christof Ressi pointed to formula in
> http://www.arpchord.com/pdf/coeffs_first_order_filters_0p1.pdf
> - this formula calculates feedback coefficient k = (1 - sin(a)) /
> cos(a) where a = 2 * pi * fc / SR
> - the filter implementation is y[n] = (x[n] - x[n-1]) * (1 + k) / 2
> +  k * y[n-1]
> - following convention in d_filter.c (and pd tilde classes in
> general), trig functions should best be approximated
> - Cyrille provided libre office linear regression result for (1-sin(x))/cos(x)
> 
> Thanks for the useful infos and discussion. My 'math coach' suggested
> using odd powers of -(x-pi/2) in an approximation polynomial for
> (1-sin(x))/cos(x).

Yes that's sensible, due to the odd symmetry.

> The best accuracy/performance balance I could get
> is with this 5th degree polynomial:
> 
> (-(x-pi/2))*0.4908 - (x-pi/2)^3*0.04575 - (x-pi/2)^5*0.00541
> 
> Using this approximation in the filter formula, response at cutoff
> frequency is -3 dB with +/-0.06 dB accuracy in the required range 0 <
> x < pi. It can be efficiently implemented in C, analogous to an
> approximation Miller uses in [bp~]. So that is what I'll try next.

I went up to 9th degree polynomial in my graphical analysis below.

> Attached patch hip~-models.pd illustrates and compares filter recipes
> using vanilla objects:
> 
> - current implementation, most efficient, accuracy +/- 3 dB
> - implementation with trig functions, least efficient, accuracy +/- 0.01 dB
> - implementation with approximation for trig functions, efficient,
> accuracy +/- 0.06 dB
> 
> A note on efficiency: coefficients in [hip~] are only recalculated
> when cutoff frequency is changed. How important is performance for a
> function rarely called? I'm much aware of the motto 'never optimize
> early', yet I spent much time on finding a fast approximation, for
> several reasons: it's a nice math challenge, instructive for cases
> where performance matters more, and I want to respect Miller's code
> efficiency when proposing a change.

Yes a fun challenge.

Here's a graph, it shows that polynomial approximations do quite poorly
for this problem, even when increasing the degree:
https://mathr.co.uk/misc/2016-10-21_filter_coefficient_calculation_accuracy.png
(logarithmic frequency scale, if SR is 48kHz it's from ~11Hz to 24kHz)

I used this Haskell to generate the data file for curve fitting
https://mathr.co.uk/misc/2016-10-21_filter_coefficient_calculation_accuracy.hs
and this GNUPlot to fit the curves and plot the graph:
https://mathr.co.uk/misc/2016-10-21_filter_coefficient_calculation_accuracy.gnuplot

Having said that the polynomial approximations do poorly, they're
probably accurate enough in practice, I suspect more serious problems
would be likely to occur from using single precision in the recursive
feedback path in the filter, see for example:
https://lists.puredata.info/pipermail/pd-list/2010-08/082104.html

> Today pd is even deployed on
> embedded devices so the frugal coding approach is still relevant.
> After 20 years.

In my tests last year and revisited in July I found a 9th degreee odd
polynomial was both more accurate and more efficient than the tabfudge
stuff for linear interpolated cosine table lookup on every single
architecture I have available to me (from pentium-4 to raspberry pi 3
via amd64), when compiled with -march=native on the target machine:
https://mathr.co.uk/blog/2016-07-20_approximating_cosine_update.html
https://mathr.co.uk/blog/2015-04-21_approximating_cosine.html


Claude
-- 
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] sinesum inverse

2016-08-04 Thread Claude Heiland-Allen
Hi Simon, list,

On 04/08/16 22:51, Simon Iten wrote:
> hi claude,
> 
> your bandlimited project works/sounds great! very nice sounds from handdrawn 
> waves.

thanks!

> 
> however i am having trouble getting your example to work. probably just 
> stupidity from my side.
> 
> i suppose i don’t understand your:
> 
>> "set appropriate block size, turn off dsp, bang to execute 1 block”
> 
> message. if you find the time, can you have a look at it?

sure, just a [loadbang]--"0"--[switch~] - this turns off dsp for the
canvas (so you might want to put it all in a subpatch unless you're
using it as an abstraction).  see attached, works for me

> 
> do i not need to run a bang into tabplay in this special one block send 
> scenario?
> 
> with my patch i get “kind" of the right thing.
> 
> 1) the table “spectrum” only updates once i click into the table (after i hit 
> the bang).

mm, seems to be a Pd bug or other infelicity.  the attached includes a
workaround using [tabwrite] which updates the GUI

> 2) i get only 64 values, so i guess my blocksize is still 64?

no, it's that for real signals the second half of the rfft~ output is
symmetric to the first, so Pd sets it to 0 and ignores it in rifft~ to
avoid confusion.

> 3) if i send a bang to switch~ when dsp is off, i get an error on the console:
> 
> bang to block~ or on-state switch~ has no effect.

you have to switch it off with "0" first, and have global dsp on (afaik).

> 
> 
> 
> cheers

hth,


Claude
-- 
https://mathr.co.uk

> 
> 
> 
> 
> 
>> On 04 Aug 2016, at 18:01, Claude Heiland-Allen <cla...@mathr.co.uk 
>> <mailto:cla...@mathr.co.uk>> wrote:
>>
>> Hi Simon,
>>
>> On 04/08/16 09:54, Simon Iten wrote:
>>> ah sorry, yes
>>>
>>> i want to read a wavetable, say 128 steps and calculate the gain structure 
>>> to 
>>> aproximate this wavetable with sine waves.
>>> the idea behind this is to get a different sound from wavetables, use low 
>>> resolution wavetables to get nice sounds (waldorf microwave xt)
>>>
>>> so for a saw wave i would want the following numbers.
>>>
>>> 1 0.5 0. 0.25 0.2 and so on…
>>>
>>> how to do this for an arbitrary input wavetable?
>>>
>>> i looked at the fft examples but it is not clear to me how i would do this 
>>> with a single wavetable (of known size)
>>
>> You could do something like this with [rfft~], but you lose phase
>> information which might be important depending on what you are doing
>> (use fixed-width font to see diagram):
>>
>> "set appropriate block size, turn off dsp, bang to execute 1 block"
>> |
>> [switch~]
>>
>> [tabplay~ wavetable]
>> |
>> [rfft~ ]
>> ^^
>> [*~] [*~]
>>  \  /
>>  [+~]
>>   |
>>  [sqrt~]
>>   |
>>  [tabsend~ spectrum]
>>
>>> or if there is a “simpler” (without fft) possibility that would be great.
>>
>> I don't think you'll get simpler than FFT here.  As a bonus you can also
>> get phase information (sinesum has all phases 0, cosinesum all phases
>> pi/2, general wavetable can have arbitrary phases).
>>
>> You could use [rifft~] instead of sinesum to generate your wavetable,
>> too.  Note there may be some issues with normalization (fft->ifft has an
>> amplitude gain equal to the blocksize, iirc).
>>
>> For a more advanced use of oneshot FFT and IFFT for wave tables, see my
>> bandlimited project:
>> https://mathr.co.uk/blog/2015-02-12_bandlimited_wavetables.html
>>
>>
>> Claude
>> --
>> https://mathr.co.uk <https://mathr.co.uk/>
>>
>>
>> ___
>> Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at>mailing list
>> UNSUBSCRIBE and account-management 
>> ->https://lists.puredata.info/listinfo/pd-list
> 

#N canvas 19 83 686 620 10;
#X obj 142 176 tabplay~ wavetable;
#N canvas 0 50 450 278 (subpatch) 0;
#X array wavetable 131 float 2;
#X coords 0 1 131 -1 128 100 1 0 0;
#X restore 317 214 graph;
#X obj 143 220 rfft~;
#X obj 136 254 *~;
#X obj 162 254 *~;
#X obj 143 287 +~;
#X obj 143 310 sqrt~;
#N canvas 0 50 450 278 (subpatch) 0;
#X array spectrum 128 float 2;
#X coords 0 1 128 -1 128 100 1 0 0;
#X restore 315 343 graph;
#X obj 143 334 tabsend~ spectrum;
#X obj 57 60 switch~ 128 1 1;
#X obj 25 9 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 102 37 0;
#X obj 102 15 loadbang;
#X obj 25 29 t b b;
#X obj 26 393 tabread spectrum;
#X obj 26 415 tabwrite spectrum;
#X msg 25 345 0;
#X obj 25 367 t f f;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 2 1 4 0;
#X connect 2 1 4 1;
#X connect 3 0 5 0;
#X connect 4 0 5 1;
#X connect 5 0 6 0;
#X connect 6 0 8 0;
#X connect 10 0 13 0;
#X connect 11 0 9 0;
#X connect 12 0 11 0;
#X connect 13 0 16 0;
#X connect 13 1 0 0;
#X connect 13 1 9 0;
#X connect 14 0 15 0;
#X connect 16 0 17 0;
#X connect 17 0 14 0;
#X connect 17 1 15 1;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] pd-vanilla build error on Odroid c2 (linkage problem?)

2016-08-01 Thread Claude Heiland-Allen

On 02/08/16 00:56, angelo.arc...@virgilio.it wrote:

undefined reference to `glist_reloadingabstraction'


This is a bug introduced by the latest git commit.  I don't know what 
the correct fix is, but using the previous commit[1] allowed me to build 
Pd without issues.  Reading the log seems to indicate that without the 
commit [clone~] may fail to function correctly, but I haven't tried 
that.  A built Pd without [clone~] is at least better than a non-built Pd...


[1] git checkout HEAD~1


Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] vline~ in a patch with dsp off

2016-07-28 Thread Claude Heiland-Allen

Hi,

See: https://lists.puredata.info/pipermail/pd-dev/2008-03/00.html

Code is attached to this mail, the links in the mail above are broken..

On 28/07/16 17:48, i go bananas wrote:

Have noticed that vline~ still takes message inputs when the dsp in the
patch is switched off.  I can't really think of any situations where that
is useful.

The problem is, that new messages get added to the message list, making it
longer and longer as more messages are input.

Miller, would it be possible to disable message input when vline~ is in a
patch or subpatch where dsp is off?
At the moment, it needs to be done manually with spigots, etc.



Claude
--
https://mathr.co.uk



uline_tilde.tar.bz2
Description: application/bzip
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] vanilla solution for random float

2016-06-02 Thread Claude Heiland-Allen

On 02/06/16 08:09, IOhannes m zmölnig wrote:

On 05/31/2016 05:50 PM, IOhannes m zmoelnig wrote:

i really like the powers of the new [osc*] objects for these kind of things.


here's an updated example, that properly generates numbers in to 0..1 range.

it has full 24bit of (pseudo) randomness.


But the distribution is not uniform (lower third is twice as likely as 
the upper two thirds of the range).  See attached for a test.



Claude
--
https://mathr.co.uk

#N canvas 1 51 308 317 10;
#X obj 103 91 randF;
#X obj 103 113 * 1000;
#X obj 103 135 int;
#X obj 103 177 tabread \$0-hist;
#X obj 103 199 + 1;
#X obj 103 221 tabwrite \$0-hist;
#X obj 103 157 t f f;
#X obj 41 255 table \$0-hist 1000;
#X obj 76 23 t b b;
#X obj 103 68 until;
#X msg 10 48 normalize 1;
#X obj 10 70 s \$0-hist;
#X obj 78 5 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 106 46 1e+06;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 6 0 3 0;
#X connect 6 1 5 1;
#X connect 8 0 10 0;
#X connect 8 1 13 0;
#X connect 9 0 0 0;
#X connect 10 0 11 0;
#X connect 12 0 8 0;
#X connect 13 0 9 0;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] Oops, test3 bad, test4 up now

2016-05-03 Thread Claude Heiland-Allen

On 03/05/16 19:30, me.grimm wrote:

for example [makefilename %s%%s%%%s] the %%%s is
replaced with 000


I'm guessing %%%s is parsed as %% %s, and that you really need s to 
get %% %% s which becomes % % s (aka %% s) which finally becomes %s?


See also: https://www.xkcd.com/1638/


Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] pd 0.47-0 test 1 released

2016-04-25 Thread Claude Heiland-Allen

On 25/04/16 16:31, Miller Puckette wrote:

I'm not sure what to do about mixiung messages and signals in the same inlet


It would be cool if [inlet~] had an additional outlet for messages.


Claude
--
https://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] external with more than 6 inlets possible?

2016-03-20 Thread Claude Heiland-Allen

On 16/03/16 13:37, Claude Heiland-Allen wrote:

On 16/03/16 13:25, i go bananas wrote:

pd using the same address for inlets and outlets as an
optimisation?


Yes, Pd recycles signal vectors so your output vector could be the same
as the input vector, which means this code is unsafe because it could
trash the inputs:

   // loop through the 4 oscillators, adding the left to right:
   for (int osc = 0; osc < 4; osc++)
   {
 int n = (int)(w[14]);
 while (n--) *output[osc]++ = *left[osc]++ + *right[osc]++;
   }

The easiest fix would be to reverse the order of the loops:

   int n = (int)(w[14]);
   while (n--)
   {
 for (int osc = 0; osc < 4; osc++)
   *output[osc] = *left[osc] + *right[osc];
 output++;
 left++;
 right++;
   }


oops, this is wrong, I think

maybe *output[osc]++ = *left[osc]++ + *right[osc]++; would work in the 
inner loop in fact, I'm just not sure of the order of the C operations 
here...




Your alternative method of changing the iolet creation orders is not a
fix, it might "work" for one particular patch but another patch could
break it again.


Claude



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] external with more than 6 inlets possible?

2016-03-19 Thread Claude Heiland-Allen

On 16/03/16 13:25, i go bananas wrote:

pd using the same address for inlets and outlets as an
optimisation?


Yes, Pd recycles signal vectors so your output vector could be the same 
as the input vector, which means this code is unsafe because it could 
trash the inputs:


  // loop through the 4 oscillators, adding the left to right:
  for (int osc = 0; osc < 4; osc++)
  {
int n = (int)(w[14]);
while (n--) *output[osc]++ = *left[osc]++ + *right[osc]++;
  }

The easiest fix would be to reverse the order of the loops:

  int n = (int)(w[14]);
  while (n--)
  {
for (int osc = 0; osc < 4; osc++)
  *output[osc] = *left[osc] + *right[osc];
output++;
left++;
right++;
  }

Your alternative method of changing the iolet creation orders is not a 
fix, it might "work" for one particular patch but another patch could 
break it again.



Claude
--
http://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] vanilla / iterate through audio in array

2016-03-08 Thread Claude Heiland-Allen

Hi,

On 08/03/16 16:25, jlistshit wrote:

Hi everyone, this is my first post here. I'm a composer from Berlin.

This question might have been asked before:
In PD vanilla: How can i detect jumps from negative to positive values in an 
array?

I am using until with tabread, and just that little bit of porcessing, which 
gives me a bang or a 1, when the phase changes, is missing.

Any insight appreciated and thank you in advance.


If you want the challenge and satisfaction of working it out for 
yourself, don't look at the attached solution.  A few hints:


a binary 0/1 message stream makes detecting transitions easier

[t f f] with crossed wires can act as a one-float-message delay line

you can use the cold right inlet of an object to store a value for later


Claude
--
http://mathr.co.uk

#N canvas 1 51 623 419 10;
#X obj 67 29 table \$0-tab;
#X obj 68 57 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 68 102 100;
#X obj 68 124 until;
#X obj 68 165 f 0;
#X obj 105 164 + 1;
#X obj 68 77 t b b b;
#X msg 113 141 0;
#X obj 68 187 t f f;
#X obj 98 210 tabread \$0-tab;
#X obj 106 311 >;
#X obj 99 233 >= 0;
#X obj 99 255 t f f;
#X msg 211 286 1;
#X obj 68 339 spigot;
#X obj 68 366 print crossing-to-positive;
#X text 243 298 assumes value before table starts is 0;
#X text 243 280 reset accumulator (previous value);
#X text 144 233 convert signal to binary 0 1;
#X text 143 255 crossed wires from trigger act as a 1-message delay
;
#X text 137 317 keep only crossings from negative \, try != for both
ways;
#X text 110 115 generate table-size bangs;
#X text 146 141 reset counter;
#X text 138 166 counter idiom;
#X text 168 29 draw some wiggles in this table;
#X text 93 56 then detect zero-crossings;
#X connect 1 0 6 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 4 0 8 0;
#X connect 5 0 4 1;
#X connect 6 0 2 0;
#X connect 6 1 7 0;
#X connect 6 2 13 0;
#X connect 7 0 4 1;
#X connect 8 0 14 0;
#X connect 8 1 9 0;
#X connect 9 0 11 0;
#X connect 10 0 14 1;
#X connect 11 0 12 0;
#X connect 12 0 10 1;
#X connect 12 1 10 0;
#X connect 13 0 10 1;
#X connect 14 0 15 0;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] s~ & r~ with block size other than 64?

2016-02-25 Thread Claude Heiland-Allen

On 26/02/16 03:21, Alexandre Torres Porres wrote:

howdy, is there any particularly good reason why [s~]/[r~] must run at only
64 block sizes?

if the issue is that they may have conflicting/different sizes between
them, why not give the same error as you get now for blocks other than 64?

"receive~ x: vector size mismatch
sigsend x: unexpected vector size"

It'd be really convenient for feedback loops


if you want something that works right now, tabsend~ and tabreceive~ 
don't have any restriction about table size must be equal to block size 
must be equal to 64


see attached example of a single self-modulating fm oscillator with 
single sample feedback (block~ 1)



Claude
--
http://mathr.co.uk

#N canvas 1 51 450 300 10;
#X obj 98 171 dac~;
#N canvas 1 51 450 300 single-sample-feedback 0;
#X obj 186 41 block~ 1;
#X obj 52 214 osc~;
#X obj 51 259 outlet~;
#X obj 129 250 tabsend~ \$0-feedback;
#X obj 114 104 tabreceive~ \$0-feedback;
#X obj 49 187 mtof~;
#X obj 50 137 *~;
#X obj 69 65 inlet~;
#X obj 50 159 +~ 60;
#X obj 119 178 table \$0-feedback 1;
#X connect 1 0 2 0;
#X connect 1 0 3 0;
#X connect 4 0 6 0;
#X connect 5 0 1 0;
#X connect 6 0 8 0;
#X connect 7 0 6 1;
#X connect 8 0 5 0;
#X restore 107 85 pd single-sample-feedback;
#X obj 110 138 *~ 0.5;
#X obj 107 35 osc~ 0.1;
#X obj 205 179 table \$0-scope 1024;
#X obj 206 155 tabwrite~ \$0-scope;
#X obj 208 133 metro 300;
#X obj 211 112 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 107 57 *~ 48;
#X connect 1 0 2 0;
#X connect 1 0 5 0;
#X connect 2 0 0 0;
#X connect 2 0 0 1;
#X connect 3 0 8 0;
#X connect 6 0 5 0;
#X connect 7 0 6 0;
#X connect 8 0 1 0;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] How's Pd limited?

2016-02-25 Thread Claude Heiland-Allen

On 25/02/16 02:22, Alexandre Torres Porres wrote:

easy have hard synced oscillators


phasor~ 100
 |
*~ 2.666
 |
wrap~
 |
dac~


doing it bandlimited so it doesn't sound like poop is a lot harder
(you can get part of the way there by oversampling with filtering)


Claude
--
http://mathr.co.uk

#N canvas 1 51 335 291 10;
#X obj 72 102 mtof;
#X obj 72 124 vline~;
#X obj 72 146 lop~ 15;
#X obj 72 168 phasor~;
#X obj 72 190 *~;
#X obj 72 212 wrap~;
#X obj 72 234 hip~ 1;
#X obj 62 264 dac~;
#X obj 70 37 metro 444;
#X obj 70 59 random 25;
#X obj 70 81 + 29;
#X msg 166 131 8 \, 1 444;
#X obj 166 153 vline~;
#X obj 71 17 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X msg 199 215 \; pd dsp 1;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 6 0 7 1;
#X connect 8 0 9 0;
#X connect 8 0 11 0;
#X connect 9 0 10 0;
#X connect 10 0 0 0;
#X connect 11 0 12 0;
#X connect 12 0 4 1;
#X connect 13 0 8 0;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] [pix_image] available image format on linux?

2016-02-20 Thread Claude Heiland-Allen

Thanks for the additional information.

On 20/02/16 15:51, Jonghyun Kim wrote:

Sure I already restarted Pd. I compiled Pd(0.46-7) myself, and Gem is
installed by Pd-DEKEN(https://github.com/pure-data/deken). Here is my
information.

Installed Pd ver on my ubuntu 14.04-3
Pd-0.46-7 (compiled myself)
Pd-0.45-4 (by Ubuntu Repo)
Pd-extended 0.43.4 (manually installed by .deb)
Pd-l2ork 20151230 (manually installed by .deb)
Result with Pd-0.46-7 (compiled myself)
1. $ which pd
/usr/local/bin/pd

2. $ pd -stderr -verbose your-patch.pd 2>log.txt
attatched



The log contains:

verbose(6): backend 'magick' unavailable

As far as I can tell, this means it detected ImageMagick plugin, but 
couldn't proceed - I don't know why, and the code is a maze of twisty 
plugin factories that I don't yet understand.  Maybe one of the GEM devs 
can help you debug this - it might be a problem with how it is packaged 
in Deken, or a missing library dependency on your system, or something else.


Sorry, and good luck,


Claude



many thanks,
jonghyun



On Sun, Feb 21, 2016 at 12:31 AM, Claude Heiland-Allen <cla...@mathr.co.uk>
wrote:


You have to restart Pd for GEM to notice the new plugins.  If you did that
already, maybe there is a conflict between self-compiled Pd GEM and
system-installed Pd GEM?  Please send more information:

$ which pd # should be /usr/bin/pd
$ pd -stderr -verbose your-patch.pd 2>log.txt  # attach log.txt to mail



On 20/02/16 15:20, Jonghyun Kim wrote:


thanks claude, I installed it by "sudo apt-get install gem-plugin-magick",
but it still can't load PNG. Pd says same as before: only "Image loading
support: SGI jpeg". how to solve it?

thanks,
jonghyun


On Sun, Feb 21, 2016 at 12:05 AM, Claude Heiland-Allen <
cla...@mathr.co.uk>
wrote:

On 20/02/16 14:49, Jonghyun Kim wrote:


on ubuntu 14.04 linux, [pix_image] handles only JPEG files. No PNG, No

others. How to load PNG or TIFF files? when I make [pix_image], Pd says
"Image loading support: SGI jpeg"

FYI, on Mac OS X, it handles PNG files, but on linux doesn't. Why
linux can't do that?



Linux can do that, don't worry.  GEM uses a plugin system for image
loaders/savers - probably GEM is distributed with them split out into
multiple packages. Try:

$ aptitude search gem-plugin-

which lists many available to my Debian system, not all of which I have
installed.  I think gem-plugin-magick should be enough to load PNG and
other common formats.


Claude
--
http://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list






___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list






___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] [pix_image] available image format on linux?

2016-02-20 Thread Claude Heiland-Allen
You have to restart Pd for GEM to notice the new plugins.  If you did 
that already, maybe there is a conflict between self-compiled Pd GEM and 
system-installed Pd GEM?  Please send more information:


$ which pd # should be /usr/bin/pd
$ pd -stderr -verbose your-patch.pd 2>log.txt  # attach log.txt to mail


On 20/02/16 15:20, Jonghyun Kim wrote:

thanks claude, I installed it by "sudo apt-get install gem-plugin-magick",
but it still can't load PNG. Pd says same as before: only "Image loading
support: SGI jpeg". how to solve it?

thanks,
jonghyun


On Sun, Feb 21, 2016 at 12:05 AM, Claude Heiland-Allen <cla...@mathr.co.uk>
wrote:


On 20/02/16 14:49, Jonghyun Kim wrote:


on ubuntu 14.04 linux, [pix_image] handles only JPEG files. No PNG, No
others. How to load PNG or TIFF files? when I make [pix_image], Pd says
"Image loading support: SGI jpeg"

FYI, on Mac OS X, it handles PNG files, but on linux doesn't. Why
linux can't do that?



Linux can do that, don't worry.  GEM uses a plugin system for image
loaders/savers - probably GEM is distributed with them split out into
multiple packages. Try:

$ aptitude search gem-plugin-

which lists many available to my Debian system, not all of which I have
installed.  I think gem-plugin-magick should be enough to load PNG and
other common formats.


Claude
--
http://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list






___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] [pix_image] available image format on linux?

2016-02-20 Thread Claude Heiland-Allen

On 20/02/16 14:49, Jonghyun Kim wrote:

on ubuntu 14.04 linux, [pix_image] handles only JPEG files. No PNG, No
others. How to load PNG or TIFF files? when I make [pix_image], Pd says
"Image loading support: SGI jpeg"

FYI, on Mac OS X, it handles PNG files, but on linux doesn't. Why
linux can't do that?


Linux can do that, don't worry.  GEM uses a plugin system for image 
loaders/savers - probably GEM is distributed with them split out into 
multiple packages. Try:


$ aptitude search gem-plugin-

which lists many available to my Debian system, not all of which I have 
installed.  I think gem-plugin-magick should be enough to load PNG and 
other common formats.



Claude
--
http://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Does Pd have a "sound"?

2016-02-15 Thread Claude Heiland-Allen

On 14/02/16 22:27, Matti Viljamaa wrote:

Do you think Pd has a characteristic sound to it? Or whether
discussion board threads claiming Pd (and Max) have a distinct (and
not good) sound just have people who haven’t listened to good
patches?


Some issues with Pd that affect sound character:

1. cos~ (and osc~) use a small table with linear interpolation, which 
means there is quite a lot of interpolation noise - I wrote about it 
here: http://mathr.co.uk/blog/2015-04-21_approximating_cosine.html


2. vcf~ (and probably other recursive filters) use single precision 
floating point in the feedback loop (pd-double might be different) which 
causes weird rounding artifacts - I wrote about it here: 
http://lists.puredata.info/pipermail/pd-list/2010-08/082104.html


3. cubic interpolation (tabread4~ etc) in Pd uses an (imho) incorrect 
algorithm - it makes a curve that goes through 4 points instead of 
matching the derivatives at the nearest 2 points, which leads to sharp 
corners at the original sample points with associated aliasing artifacts 
- this has been discussed on the lists many times in the past, for 
example here: 
http://lists.puredata.info/pipermail/pd-list/2008-06/062864.html and: 
http://lists.puredata.info/pipermail/pd-list/2010-03/077278.html


4. sig~ (and implicit sig~ from float messages to signal inlets) is 
steppy and only takes effect at block boundaries - compare with .kr in 
SC3 which is (afaik) linearly interpolated between each block boundary


5. Pd doesn't print enough digits to perfectly reconstruct floating 
point values when round-tripping through files, so (eg) biquad~ 
coefficients can become imprecise if you don't write them outside Pd in 
a text editor


6. other systems tend to come bundled with more nice-sounding stuff like 
bandlimited oscillators etc, with Pd you tend to have to find externals 
yourself (deken should make that easier now)



Claude
--
http://mathr.co.uk

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] loading random samples

2016-02-12 Thread Claude Heiland-Allen

On 12/02/16 16:04, Alexandros Drymonitis wrote:

[readsf~] outputs a bang out its right outlet when the current sample it's
playing has finished. You can send that bang to [random] (the argument of
which will be the number of your samples) and the output of [random] to a
message [open ./samples/P$1.wav, 1(
I don't think that you can use 01, 02, etc., but 1, 2, etc. If you really
want to name your samples like that, your message could be [open
./samples/P0$1.wav, 1(, but any sample greater than 9 would have to be
named P010.wav. There should be a work around that though.


Easiest to have files that are named with numbers rather than a number 
plus some extra sample-specific name.  Otherwise you really do need a 
way to get a list of existing filenames into Pd somehow, either by a 
text file that you prepare beforehand, or a more complicated system with 
externals.


For leading 0 with fixed number of digits (here 2):

[nbx\
 |
[makefilename P%02d.wav]
 |
[open $1, 1(


In this example there's a directory called "samples" in the directory of
the patch.

On Fri, Feb 12, 2016 at 5:31 PM, Pagano, Patrick 
wrote:


​you need a folder playlist object attached to a file player

i suggest the browser/folder from the MTL abstractions and the player~
external from Eric lyon Potpourri




*Patrick Pagano B.S, M.F.A*
Audio and Projection Design Faculty
Digital Worlds Institute
University of Florida, USA
(352)294-2020
--
*From:* Pd-list  on behalf of Spyros
Polychronopoulos 
*Sent:* Thursday, February 11, 2016 6:50 PM
*To:* pd-l...@mail.iem.at
*Subject:* [PD] loading random samples

Hi list,

I have a question if you could enlighten me:

I would like to make a patch that loads randomly a sample from a folder
(if I can make it open randomly any file begging with P01 ie. P01*.wav) and
when the sample ends loads automatically another sample randomly (ie.
P02*.wav).

thank you in advance
--
Spyros Polychronopoulos
Music Composer / BSc / PhD
www.spyweirdos.com

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list






___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Pd can't find its help files

2016-02-09 Thread Claude Heiland-Allen

On 09/02/16 20:55, Andrea wrote:

Pd-0.43.0 on Linux/x86_64 can't seem to find its help files.


How did you install it?  (Works fine for me on Debian Wheezy, both from 
packages and compiled from source, so I think this is more likely to be 
a packaging problem rather than a Pd bug.)



I have the
path in ~/.pdsettings :

path1: /opt/pkg/share/doc/pd/doc

while Pd is installed in /opt/pkg/bin/ . Here's what I see in Pd's
console when trying to get help - for example - on a "float":


[snip]


So, Pd isn't even looking in /opt/pkg/share/... - path1 notwithstanding.


Pd has a separate help path.


What else does Pd need to be able to find its own help files?


From the command line (or ~/.pdrc) you can use -helppath instead of 
-path, not sure what the syntax is for ~/.pdsettings (sorry).


$ pd -helppath /opt/ -verbose -stderr
[...snip...]
tried ./osc~-help.pd and failed
tried /opt/osc~-help.pd and failed
tried /home/claude/opt/lib/pd/doc/5.reference/osc~-help.pd and succeeded

(2nd line shows it looking in the argument directory, 3rd line is from 
'make install' into my preferred prefix)


You could maybe create a symlink to the correct location, as the 
puredata(-doc) Debian package seems to do.



Claude
--
http://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] free C lesson

2015-08-17 Thread Claude Heiland-Allen

On 17/08/15 15:36, Jonathan Wilkes via Pd-list wrote:

Hi list,Wondering if someone will give me a free lesson in C programming.
In g_traversal.c, there's some code to retrieve a float from a t_word* vec.  It 
looks like this:
*(t_float *)(((char *)vec) + onset));
Why does vec need to be cast to char*?  t_word has to be as big as the largest 
member of the union, and the largest member has to be the same size as char*, 
right?  (Otherwise we'd have big problems...)


aiui pointer arithmetic is in increments of sizeof(pointee)
if onset is measured in bytes (I don't know if it is in this case, but 
it looks likely), then you need to have a pointer to bytes for the 
addition to be meaningful.  vec is already a pointer, but adding onset 
to a t_word* would offset the address by onset*sizeof(t_word) bytes



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] cannot create moonlib/absolutepath on Windows

2015-08-16 Thread Claude Heiland-Allen
Windows has a different notion of paths to unix-like systems, including 
drive specifiers.


The first line of moonlib/absolutepath.c[1] is

#ifndef _WIN32

so the file is empty when compiling for Windows.  (Perhaps it could 
contain an alternative implementation that prints a more useful error 
message.)


The non-Windows implementation uses dirname() from libgen.h, which isn't 
available on Windows as far as I can tell.  A suggested alternative is 
_splitpath_s[2].


[1] 
http://sourceforge.net/p/pure-data/svn/HEAD/tree/trunk/externals/moonlib/absolutepath.c#l1

[2] https://msdn.microsoft.com/en-us/library/8e46eyt7.aspx

On 16/08/15 14:11, Gilberto Agostinho via Pd-list wrote:

Hello all,

I had previously released a small abstraction of a visual keyboard for
Pd (see:
http://forum.pdpatchrepo.info/topic/8584/keyboards-gui-for-midi/1 ), but
I had tested it only on Linux. Now, I got some reports from Windows
users that they can't create [moonlib/absolutepath] on their system,
which I used in that abstraction. They get the following error message:

...couln't create {new line} load_object: Symbol absolutepath_setup
not found.

We did some troubleshooting, and here is what we found:

- [import moonlib] does not make any difference
- nor does using [moonlib/absolutepath] instead of [absolutepath]
- they are able to create other moonlib externals, such as [image],
[mknob], etc.
- the last line of the source code for absolutepath says /* NOT _WIN32
*/ but the problem is present on Windows 64-bit

Has anyone else encountered this problem? And does anyone know a
solution to it?

Cheers,
Gilberto Agostinho

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -
http://lists.puredata.info/listinfo/pd-list



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] externals in lua

2015-07-04 Thread Claude Heiland-Allen

Hi Forrest,

On 04/07/15 17:43, Forrest Curo wrote:

When I use the example lreceive.pd_lua to produce [lreceive poo], it won't
receive.

Messages from [lsend poo] and [send poo] are both picked up by [r poo], but
the lreceive just sits there.

Anyone have a guess what's going on?


[lreceive] actually binds a number of receives, named with a prefix. 
For example:


[lreceive poo 42 3]

is more like

[r poo42] [r poo43] [r poo44]
 | | |
[t a b]   [t a b]   [t a b]
 | [42(| [43(| [44(
 |  |  |  |  |  |
(each pair is sent out from the 2 outlets of [lreceive])


The start (here 42) and count (here 3) both default to 1, so just to 
test that it's working try [s poo1].


Anyway, the examples I wrote weren't originally meant to be used as 
standalone objects (perhaps that was a mistake), but more as examples of 
how to use different parts of the pdlua API - you can read the source 
code of the .pd_lua examples (which are plain text) to guide you when 
writing your own objects, or just to see how they work.



Claude
--
http://mathr.co.uk


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] pow with negative numbers

2015-06-06 Thread Claude Heiland-Allen

On 07/06/15 01:38, Chris McCormick wrote:

So the ** operator behaves differently from pow(x, 2).


It's more likely that:

- x ** 2

means:

- (x ** 2)

not:

(- x) ** 2

See: https://en.wikipedia.org/wiki/Order_of_operations


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


  1   2   >