i would like to share two abstractions which allow you to create and control many instances of the same oscillator voice. The [polyx] object has two creation arguments, the number of voices and the name of the voice abstraction. The [sweepOsc] abstraction contains a comlex oscillator with a frequency ramp and an envelope.
The polyx-help shows how you can address single voices with lists or i.e. generate a chord from 3 notes containing 10 harmonics each.
If you want the [polyx] to use any of your abstractions you need to take care of the send/receive arguments, since they are desgined for the [sweepOsc] abstraction.
This method can be used for any kind of abstraction from arrays to voices, filters or whatever you might need hundreds of (the loading of the objects though will definitely take a while).
Any comments appreciated.
this external is a very basic expansion of an [until] object. It can be used in any case where you would normally go for [until] plus any kind of counter (i.e. looping through arrays in logical time).
You can set the number of steps via upper and lower limit and finally multiply the output by any constant allowing for some flexibility. All values can be negative as well. You can't accidentally go in an infinite loop either.
I included the source and the makefile for linux or os x users. It's compiled as *.dll on a windows system.
Hope anyone finds it useful.
i created two C externals pretty close to the tutorial examples from the HOW-TO. Compiling worked but PD didn't recognize the class_setup. I searched a bit and found i had to insert the line "__declspec(dllexport) void classname_setup(void);". After that PD recognizes the object.
The only problem left is that my external isn't properly loaded every time i open a patch containing the object. Sometimes it gets changed to a simple comment. Its saying #X text 100 100 myexternal; in the .pd file, so it seems to happen while saving. It doesn't happen every time but often enough.
Is this related to the line i had to insert? I thought it just changes the way PD handles the setup routine.
In the running PD environment the externals work without any problems. Only the loading issue remains.
I used dev c++ with mingw to compile it. I'm not familiar with compiling using a makefile. Any help is appreciated.
i put together two abstractions which help shaping any ramp from objects like [line], [line~] and [vline~] or any numberstream between 0 to 1 and -1 to 1. You might be familiar with the quadratic or quartic methods to get non-linear ramps.
The idea is this: You choose one of six modes, set the first and second limit of the output range and feed the abstraction with a ramp from 0 to 1.
The modes are: three versions of the popular smoothstep, x^n, 1/(x^n), and a two point catmull-rom spline.
The shaping always gets done in the range of -1 to 1 and after that the ramp is scaled up or down depending on the limits set.
So to get quartic shaping you go for the x^n mode and set n=4. n=0.5 would be sqrt(2). You get all the possibilities from x^n to help shape any ramp from a to b. If you want to reverse the ramp simply switch the values of the limits.
You should start with the myline_ex.pd patch for control and audio examples.
Hope anyone finds it useful. I appreciate any comments.
i tried your patch but didn't get out the real values. It seems the [bytes2any] produces some weird ascii stuff.
You might want to check out the pdstring-help.pd in pd/extra/moocow and http://puredata.hurleur.com/sujet-2533-ascii-float .
Maybe you just need to delimit every value you are sending with " " (space?) or a 0 byte. My message in Blender looks like: <bytesfrom int/float/string>+" "+<anotherbyte>+" "+etc.
Otherwise i have no idea what could be wrong. But it seems your close to the real deal.
Hope you can figure it out, kq
i tried VS and Dev-C++ but got stuck also. I found a simpler way, you might want to take a look at my last post here: http://puredata.hurleur.com/sujet-8697-problem-external-windows-saved-object-loaded-text
For me this is the way to go. Basically take any program you like to create the *.c file and then use the template library including the makefile from the PD dev's.
Hope it helps, kq
thanks for the input. If you change the number of voices in [polyx] via numberbox on the right inlet, you can change the number of abstractions loaded without invoking a modification in any patch, but i'm not sure why actually. [polyx] itself doesn't get modified by changing the content of the [pd $0-voices].
Since you need to modify [polyx] for use with different abstractions, it should be possible to use it as a template and then stop worrying about the saving issue.
I thought about adding the possibility to change the abstraction you want to load also, but this won't work because the list in [polyx] is specifically designed for my [sweepOsc] abstraction.
greetings from a snowy alps lodge, kq
since nobody comments on my idea i would really like to get some advice on future posts.
Please help me to improve my presentation.
Is this idea to basic to post about it?
Was something like that posted already so it could be considered a double post?
I had the feeling it is a generic way to get an "array of objects" like it is used in any other programming language, but with way less effort than something like the [polysynth] object with the wrapper and several sub-patch levels.
i never heard of those functions, and obviously got lucky to get it working without any proper networking knowledge. If it helps, my python code uses (socket.AF_INET,socket.SOCK_DGRAM) which should be the standard udp socket. I read about AF_INET in the ntohl() function descripition. So if my python message is reversed then the bytes2any object is able to get it in the right order.
i hope this helps. My message from Blender consists of a bytestring (address, stuff you want to send, 0). The 0 is used to delimit the message which is spit out by the bytes2any object. After that you can route the list by the address you gave it. See the attachment.