Sampler-voice.pd question

I’m having trouble with understanding this object in some of the sampler-voice.pd’s on the organelle. Anyone out there can explain to me understand this expression? It follows strip note.

[expr if ($f1 > 59, $f1 - 60, $f1 - 12)]

Is $f1 the variable from the abstraction’s key assignment label within the patches main.pd?

It then goes

[sel $2] (second argument) keynumber

is $2 taking the variable of $f1 which is the key number of the abstraction in main.pd?


1 Like

it is a little confusing!
$1 and $2 inside sampler-voice.pd are replaced by the arguments set in main.pd where the sampler-voice.pd abstractions are instantiated.

the $f1 (note the ‘f’) is only used by expr and has nothing to do with the arguments. When you use $f1 in expr it creates an inlet for numbers and those are referenced in the expression as $f1. So in this case

[expr if ($f1 > 59, $f1 - 60, $f1 - 12)]

if the number coming in the inlet (the note number in this case) is above 59, then subtract 60 and send it out, otherwise subtract 12 and send it out. Together with the [abs] and [% 24] it maps all MIDI note numbers to the range 1-24. The point is if you are using an external controller, all the notes will make noise, not just 60-84 (the Organelle keyboard range) …


So the one part I don’t understand is “all notes make noise”. So if I have
a midi controller hooked up; when I change octaves outside the range of
60-84, say if I"m an octave lower, it will still trigger Organelle keys

Cheers for that explanation @oweno - lil pd tutorial right there

That’s right, no matter what number you feed in, you get a number 1-24 out. So if you play a ‘C’ 2 octaves below the first note on the Organelle, it will sound the same as if you play it 2 octaves higher.

In the end its not really practical, it would be better if when you played it lower it also played it slower speed or something, but this was really just a quick hack so if someone plugged in a MIDI keyboard that was set on a different range they would still hear something.

1 Like

You are awesome. Thanks so much for explaining this.

Agreed. :slight_smile: