Converting Pd Patches to ORAC Modules - Sub Patches?

I’ve got the basics going thanks to @thetechnobear’s helpful video (link below). In which, Mark takes a sub-patch that is currently in a separate .pd file, and copies it into sub-patch in the Module.pd file in order to hook up the inlets and outlets. (Sorry if I’ve not got the terminology quite correct there, hopefully you know what I mean though).

My question is, do you always have to do that? I’m looking at a Pd patch with multiple .pd files - do they all have to go into Module.pd? Ideally not, as that’s quite a lot more editing down into the guts of the patch. Of course, I’ve tried keeping separate files and that’s not working.

You should be able to use sub patches. Are they in the same directory as module.pd? Are you getting some errors?

Try looking at some other user modules on https://patchstorage.com/platform/orac/ to see how they’re structured.

Thanks. Yes all in the same folder. No errors to view (I’ll go searching for a log), but no sound. I’ve been experimenting with simple patches/sub-patches on Windows, then porting over, so I know they basically work. Yes, I’ve been looking at other modules for guidance. Ok as long as I know it’s possible, I will persevere.

1 Like

Well, I’ve worked out how to convert my own patches, including sub-patches both in the module.pd file and in external files. But I failed to convert any of the patches I found on patchstorage.com, so I clearly don’t really understand the process properly. More work needed. I suspect the loadbangs, even though I think I’ve handled them.

Still even with the default ones, which include the Mutable Instrument ports, there’s a big sound palette to explore in a little box.

Indeed, loadbangs were the culprit. I guess they are put in all over the place with a typical Pd patch, and need hunting down. But back on an even keel :smile: Certainly sub-patches, either in the file or in a separate file are working, if I follow Mark’s instructions carefully about passing $ parameters around.

1 Like

Could you quickly recap what has to be done about the loadbangs? :slight_smile:

Each conventional pd [loadbang] object needs replacing with a receive [r loadbang-$1]. The patches made for Organelle use [r loadbang].

Issues I came across:

  1. loadbangs are often liberally sprinkled around in the patch and its possibly many sub-patches. So they all have to be hunted down and edited.
  2. When invoking a sub-patch that is in a separate .pd file e.g. [foo] then you need to supply the special ORAC parameter [foo $1]
  3. Where sub-patches are already invoked with a parameter e.g. [foo 1000] then these need changing to [foo 1000 $1]. And inside the sub-patch ‘foo’, the special parameter for ORAC is then available as $2 (or if there are already two arguments, $3 and so on).

Does that make sense?

1 Like

Yes it does, thank you. :slight_smile:

There’s one case I’ve not explored yet: a sub-patch inside the module.pd file, invoked with a parameter e.g.

[pd foo 100 200]

With no parameter e.g. [pd foo] then the ORAC parameter is simply available as $1 in the sub-patch. But I don’t know yet what happens in the above case. Should it be…

[pd foo 100 200 $1]

or simply

[pd foo 100 200]

I will report back when I know

OK, the answer is simple - invoking sub-patches with parameters is only for ‘abstractions’ a.k.a. sub-patches in a separate .pd file, so the question should not arise.