Orac : module developers guide

preset being loaded, or if midi learn so you had a midi cc mapped etc

The main point is , the pages are ‘merely’ for grouping for display- parameters still exist and can be manipulated that don’t appear on a page.

Note: when I implement the mod matrix this will also allow for non displayed parameters to be modulated.

ok, that makes sense… so taking the ADSR example, we would:

  • define params for attack, decay, sustain, release
  • define blank page for graphics, called ADSR
  • in the module listen for ADSR becoming active. lets say knob 1 is attack. When the ADSR page becomes active we receive oknob1 and use that value to draw the attack line on screen and also send the attack value back to kontrolrack ? (this is still where I’m unclear)
  • implement getparam logic for keeping things updated from presets / modulation / cc

I’ll make a simple module as an example of this once I’m sure this is the right idea.

1 Like

This is where you call setparam

You probably won’t need getparam

Say you define the param as m-attack

You should just be able to use
[r m-attack] as you would normally ( when the param is displayed)

The only thing I’d need to test is if setparam will broadcast m-attack back to the Pd patch, I think it does/should.

this appears to work. for example I just tried sending ‘setparam b1 as_cutoff 1’ (for the analog style module). the value gets sent back out, and I also checked it is stored when you save a preset. I did notice setparam takes a value 0-1 (pre scaling), is this how it should be? e.g. as_cutoff is mapped to 100-2100, so when you set as_cutoff to 1 using setparam, you get 2100 back…

1 Like

hmm, i thought it was in the scale of the parameter e.g. 100-2100
(and should definitely be consistent with getparam)

the only drawback (and perhaps why i did it like this originally) was if you use the scaled parameters, you need to know the limits (min/max)…
but i’ll take a look next time im in the code :slight_smile:

ok cool ! thanks for the insights

also wondering if it would be easier if a module could just send a flag to suppress the display of a page… so the ADSR page could be setup as a usual textual display, but then if the module wanted to display a graphic page instead, it could just send something like ‘disabledisplay module_id page_id’. this would keep platform specific receives (r oknob1) out of the module. although all the oled display stuff is platform specific stuff already going in the module, so maybe this a moot point…

one other thing while discussing param scaling. a bunch of parameters when mapped to a knob work better as ‘log pots’. for example with something like delay time going from 0 - 4000 ms, at the low end of the scale you don’t get much adjustment. in Pd I often simply square the 0-1 knob value, so first half of the knob would go from 0-1000 ms… I was thinking about an attribute you could set in the module.json parameters list indicating linear or audio taper (or just a number to which the 0-1 input value is raised pre scaling)?

Super stupid question :
how do you save the json file when edited ? (In the Organelle, editing with VIM)

I tried to make a gain module as a first module.
Couldn’t make it work, would anyone check it please ?

gainmoduletattempt.zip (1.9 KB)

I’m looking to add a “gate length” type of parameter to some synth modules. Have seen various methods employed when looking at some patches and modules. Makenote (arpeggio synth, and ORAC polybeats), and vline~ (C&G pow pow polybeats) for example. My pd skills are VERY rudimentary - what would be the simplest way to try and add this parameter to an existing synth module?
*Notes will be coming into orac from external sequencer

(I apologize for having made similar posts in other threads. In hindsight I should have started here)

in module.json, the names of page parameters should match names of parameters, so

["pg_main","Main",["gain"]]

should be

["pg_main","Main",["gain_gain"]]
1 Like

most synth modules will respond to note-on and note-off messages (essentially the same as a gate). so the length of the note or gate is determined by what is driving the synth (key presses or an arpeggiator or sequencer of some kind), usually this is the expected behavior of a synth (i.e. the notes getting played and their duration are best kept outside of the synth module). or are you thinking of release time? so when the note releases, specify how long it fades out?

if you really did want to set a gate length in a synth, you could use something like this:

[r notesIn-$1]
|
[stripnote]
|
[makenote]

so note offs are ignored (filtered out by stripnote), and makenote will generate a note off after specified duration.

you could also make a simple module that you could place before any synth that would provide this behavior, so you could use any existing synth.

I think release time won’t achieve the results I’m looking for as my MPC 1000 doesn’t have a master gate length per track parameter that can be adjusted in real time :frowning:
I like having the notes cut off super short and being able adjust up from there (without having to change the original midi sequence’s note lengths). Thanks a lot for your suggestions, I’ll definitely give this a try!

Unrelated, this was such an embarrassingly simple mod that I almost hesitate to post it - allows one to use delay module as fx or aux send from a mixer - but maybe someone w 0 pd skills will happily find it some day: delayfxsend.zip (2.4 KB)

Thanks. I still don’t get everything, but I should probably go through the video tutorial another time.

Well, the module is not working. I’ve got nothing displayed on screen where I’d expect to have “gain” displayed.

if no parameters are displayed , it’s most likely a syntax error in the json file.
If it’s just one parameter missing , then it’s a mismatch between param id in its def, and the page def

Tip: if you restart mother , then the stderr is redirected to the console for pd, and so you will see errors when loading modules in orac.

(fw_dir/scripts/restart-mother.sh or something lkke that :slight_smile: )

1 Like

So, this is the json I’m using :

{
“display” : “gain”,
“parameters” : [
[“float”,“gain_gain”, “Gain”,0.5,4,1]
],
“pages” : [
[“pg_main”,“Main”,[“gain_gain”]]
]
}

Then in the module.pd, to use the parameter should I use [r gain_gain-$1] or [r Gain-$1] ?

looks ok to me…, yes r gain_gain-$1 - you never use the display name. this is covered in my video.

also what Id recommend is look at any of the orac modules as an example, some of them are pretty simple in fact what I usually do (and i think i do in the creating modules video) is usually copy one as a starting point, then edit from there… easier to not make mistakes.

anyway, here is version of your module that works… I didnt do anything other than fix the module.json
(sorry, Im really busy until next week… and will be offline from thursday)

unzip into /media/orac/usermodules - then it will appear as test/gain
(e.g. on sdcard /sdcard/media/orac/usermodules/)

gain.zip (828 Bytes)

btw: this gain module isn’t actually needed, as the router already allows you to add gain - no?

if you want to allow for more gain, then what i would do is probably copy the router module, and then just edit module.json to change the max value on the gain … e.g. change to 400% if that’s what you want.

1 Like

Thanks a lot !

Yeah I missed it at first. But still, I figured that it would be the simplest and best first module to do.

Well. I don’t get it. Your files work, but whenever I make any change on my Mac and then re-upload it to the Organelle, it doesn’t work.
I’d like to edit it directly on the Organelle, but I don’t even know how to save the edited file…
Sorry I’ll move to something else, I don’t want to waste your time.

Probably something to do with the editor your using, probably changing line endings or something.

Look for a ‘programmers / code editor’ , there’s quite a few free ones - some will explicitly have Json syntax support.

I use sublime text , for this on the Mac all the time, but don’t think that one is free.

( I do a lot of editing on organelle with vi but then old school :wink: )