Oh I agree this is an issue… but perhaps this could be solved by introducing a DSL or some other pattern construct that lets you express notes and durations together, perhaps it could look like this…
(PUnpack
is made up)
theme = PUnpack(
[\freq, \dur],
[
[scale[7], 4],
[scale[6], 1],
[scale[4], 1],
[tritone, 6],
[scale[4], 5], // Now finding this is trivial
[tritone, 1],
[scale[4], 4],
[scale[6], 1],
[scale[4] 1],
]
) <> Pbind(
\instrument, \pulsar,
\env, Pseq([
Pfuncn({ Env([0, 1, 0.4, 0.2, 0], [0.005, 0.5, 0.25, 4], \cubed) }, 1),
], inf),
\amp, Pseq([1, 0.75, 0.75, 1] * 0.2, inf, 7),
\formantRatio, Prand([2, 4, 8, 16], inf),
\overlap, Prand([0.1, 0.2, 0.4, 0.8], inf),
\leftAmp, Prand([0.5, 0.6, 0.7, 0.8, 0.9, 1] / 2, inf),
\rightAmp, Prand([0.5, 0.6, 0.7, 0.8, 0.9, 1] / 2, inf),
\spread, Prand([0, 0.005, 0.01], inf),
\whiteAmount, 1,
\whiteRatio, 0.5,
\whiteLag, 0.001,
\powerShape, 0.75,
\out, 0
);
Point being, this is really an issue of how the data is structured, which can be changed, or at least, potentially mitigated somehow.
Edit: just realised you can already do this, but it is slightly more verbose…
theme = Pseq([
Pbind(freq: scale[7], \dur: 4),
Pbind(freq: scale[6], \dur: 1),
Pbind(freq: scale[4], \dur: 1),
Pbind(freq: tritone, \dur: 6), // Now finding this is trivial
Pbind(freq: scale[4], \dur: 5),
Pbind(freq: tritone, \dur: 1),
Pbind(freq: scale[4], \dur: 4),
Pbind(freq: scale[6], \dur: 1),
Pbind(freq: scale[4], \dur: 1),
], inf) <> Pbind(
\instrument, \pulsar,
\env, Pseq([
Pfuncn({ Env([0, 1, 0.4, 0.2, 0], [0.005, 0.5, 0.25, 4], \cubed) }, 1),
], inf),
\amp, Pseq([1, 0.75, 0.75, 1] * 0.2, inf, 7),
\formantRatio, Prand([2, 4, 8, 16], inf),
\overlap, Prand([0.1, 0.2, 0.4, 0.8], inf),
\leftAmp, Prand([0.5, 0.6, 0.7, 0.8, 0.9, 1] / 2, inf),
\rightAmp, Prand([0.5, 0.6, 0.7, 0.8, 0.9, 1] / 2, inf),
\spread, Prand([0, 0.005, 0.01], inf),
\whiteAmount, 1,
\whiteRatio, 0.5,
\whiteLag, 0.001,
\powerShape, 0.75,
\out, 0
);