PR(\aiBass)
Functionally, this process is almost identical to aiMel. Consult that help file for details on construction and usage.
The process adds the behavior of writing every output note into the global Library under a user-specified key. From there, harmonic processes like macroRh and chTop can read the note and treat it as the root of the harmony they should generate.
The key used in the library can be the same for every note if you assign a constant symbol, or if can change if you assign a pattern. A more sophisticated usage might examine the notes so that only certain notes get written into the key that the harmony players are listening to -- that is, the process could play elaborate figuration in the notes, but only pass less frequent chord changes into the harmony processes.
BP(\bass).bassID = \roots; // every note gets saved with Library.put(\roots, note)
// Every other note goes into \roots; the rest into \dummy (where presumably they are ignored)
BP(\bass).bassID = Pseq([\roots, \dummy], inf);
// look at velocity to determine which notes to pass
// chord-change notes have a velocity higher than a given threshold
// chucking syntax is also legit here
Pfunc({ |event|
(event[\note].gate.notNil
and: { event[\note].gate >= 0.9 }).if({ \roots }, { \dummy });
}) =>.bassID BP(\bass);