Improving Documentation - Pfunc and Pfuncn [SOLVED]

E.g. see this thread, granted a quite exceptional case, but there have often been requests concerning such special situations where Pkey is not or hardly applicable, Pfunc is always possible in some way.

https://www.listarc.bham.ac.uk/lists/sc-users-2013/msg28267.html

A FAQ is the the combination of Pif, Pkey and ‘==’, which needs Pbinop. This is not Pkey’s fault but it forces an unintuitive syntax. The Pfunc variant is not shorter and also not intuitive per se, but it follows its standard scheme.

Pbind(
    \midinote, Pwhite(60, 62),
    \dur, 0.2,
    \amp, Pif(Pbinop('==', Pkey(\midinote), 61), 0.5, 0.05)
).play


Pbind(
    \midinote, Pwhite(60, 62),
    \dur, 0.2,
    \amp, Pfunc { |e| (e[\midinote] == 61).if { 0.5 }{ 0.05 } }
).play
2 Likes