Orac : module developers guide


#126

hi guys
can anyone take a look in here and tell me why the sampler-voice.pd isn’t hearing any knob, note messages or signals?
still got other things to do but scratching my head on this.
S-samplerstyleREC.zip (1.5 MB)

Getting a lot of ‘multiply defined’ and ‘stack overflow’ errors as I try to find ways to send values from the abstraction in module.pd to sampler-voice.pd


#127

@thetechnobear @chrisk @oweno
What dya think? If you have time.


#128

are you getting stack overflow on this one (that you uploaded), or in trying other things? I haven’t loaded it, but I opened on my computer and I didn’t see anything right away. stack overflow is usually when an object output gets connected to its input (either directly or by way of send / receives) causing an infinite loop, so you might want to double check naming of send / receives.


#129

SamplerstyleREC Module:

I started again trying to convert this, thinking i would find it easy after a bit of practice. Nope!

I am getting ‘multiply defined’ errors for the object [throw~ samp_voice_out]

Dont understand this, as i thought the whole point of the throw~ object was to sum signals. Its not problematic in the original patch.

Also, the [loadbang-$1] object doesnt seem to do anything to initiate the samples into the read tables on module load.

Are there some special differences when it comes to abstraction when converting patches using Orac?


#130

I use loadbang-$1 all over the place, so definitely works ;). If your in an abstraction and have passed extra parameters you might have offset it?

Throw should sum, Orac won’t change that behavior- again I think it’s in a couple of modules , but honestly I prefer adding outlets so I can scale the audio on summing

Generally, no Orac doesn’t/cannot change Pd behavior at all - all the $1 stuff is about making sure parameters are unique to the module.
(And loadbang-$1 is due to Pd having a bug where loadbangs are not sent when modules are dynamically loaded - you can see this also in the IDE )


#131

Hmm, I’m stumped then! When I was converting constant gardener I tried using loadbang-global to get the tables working as they didn’t seem to respond to r loadbang-1$ and it worked in that conversion. Not in this one though. I’m kinda patching in dark though, still missing some basic knowledge hence the constant questions (sorry folks).


#132

Can you elaborate on this at all? Not sure I understand what you mean.


#133

post what you have, (and a description of what’s not working) , and I’ll see if I can spot anything obvious.
don’t really have time to run it, but sometimes a fresh set of eyes can spot things.

yeah, unfortunately with coding (and i guess many things) that only gets you so far…
now that you have some practical experience, might be worth glancing thru some of the PD texts,
you’ll be able to gloss over most of it as you know it,
but you’ll probably find nuggets that’ll make you go “oh, thats why it thats why that patch does that” :slight_smile:

no worries, thats the best way to learn.

I’ll also say, I didn’t find many good ‘advanced tutorials’ on PD (not that i looked really hard :wink: ), most things i learnt by experimenting…

but be thankful, if you think the general PD documentation is scarce/bad,
the documentation on the externals/ C api - is virtually non-existent, I’ve resorted to looking at the pure data source code to work that out.


#134

Thank you for your time and advice!
S-samplerstyleREC.zip (1.5 MB)
I am using inlets and outlets for each of the samplerstyleREC voices now, which has bypassed the throw~ object issues. I am using loadbang-global to initiate the sample tables, which i would like to do with r loadbang-$1… but for some reason cant. The decay and sample speed messages are not making it into sampler-voice.pd for some reason. It does however record and play up to 24 samples in mono or poly… so theres that.

F-trigfilter.zip (4.4 KB) If anyone is really loving these non-working patches im uploading here is another one. It’s supposed to be the note-responsive bandpass filter from ‘CA Filter’ without the cellular automata. Not sure why im getting no wet signal from this one. Enjoy!


#135

ok,
the loading-global in your module.pd can just be replaced with loadbang-$1
you can see this is being called, as at the top of the patch you can see
[ print loaded:samplerstyleREC into $1] is executed.

the sampler-voice.pd is as i said,
you need to pass in parameters to abstractions, this is how $ arguments work in PD
(nothing magic for orac here :wink: )

so the simplest way is in module.pd change each voice to:
[sampler-voice 1.wav 0 $1]

then in sampler-voice.pd you can use
[r loadbang-$3]
as this you now have sent the module parameter as arg 3

( alternatively you could pass in as arg 1, then shift all the args in the subpatch by 1, but that’s more work, and brings no benefit :wink: )

you can actually see me doing this in many modules, as its quite a common thing to have to do.

in fact it was so common, i covered it in my ‘Orac: Converting patches to module’ video, around half way thru (circa 17:00 mins)

(same video also i think describes how i moved away from using throw to outlets)


btw: do NOT use loadbang-global, this is not a substitute for loadbang-$1

it has nothing really to do with loading a particular module, and will means your module will start doing things any time ANY module is changed in orac, which will harm performance and useabilty.

his is only use where changing a module can affect other modules - primarily this is used by the router module, since the tempo is stored on it, so changing it / loading a preset will mean that other modules need to react if they stored the tempo.
in this case the impact is very minor, it’s just updating an internal variable.


#136

oh. btw… watch the rest of the video… your patch also suffers from some of the other issues which i explain how to tackle e.g. table name, and the messages used to read/write to it.

(basically your module will have issues if you load more than one instance of it into orac )

i know, i know the video is at a really fast pace, it covers a huge amount of ground - but i had to keep it reasonably concise to have any chance that anyone would watch it and not be frightened off ‘giving it a go’ - the latter half in particular is probably worth watching a few times, and making sure you understand exactly why i do certain things.

don’t be fooled by some of my ‘flippant’ comments, like “all you need to do is …” for a deeper understanding, you may have to do a bit of experimentation/reading up to understand what Ive done.

e.g. $1 in the subpatch example , is only because its got 1 arg, its different if you have multiple args like you do

but again, its a starting point, go check the other modules, one of the reason i did so many was so that i knew the underlying orac architecture could cover all modules needs :slight_smile: