pyo: Retrieve amplitudes of audio signal frequenciy ranges
pyo is not really the issue here at all. The question still stands if you were to substitute it with a million other packages of similar functionality.

What is at the centre of this question is "How to build a classifier to distinguish between different types of hits on a drum". Once you have that sorted, you can then implement it with whatever package you like, including pyo.

One of the simplest classifiers you can use for this task is the Nearest Neighbour Classifier.

The end effect of this classifier is not too different than your current thinking: I will split the frequencies of the sound and then try to work with if-then-else constructs, the final outcome of which would be the classification. Every if-then-else, puts a binary decision boundary on the outcome. For example, if you monitor the audio volume then you can create a rule that tells you whether there is something playing or not (if the volume is above a threshold, then something is playing). The nearest neighbour classifier over spectral features (of the FFT), does exactly the same thing but puts $N_{DFT}$ if-then-else on a given frame (it is not exactly if-then-else, but the end-effect is the same).

To get it to work, you would need a few representative recordings of each drum shot. For example, 20 different rimshots, 20 different straight hits. If you pass each one through the Discrete Fourier Transform (DFT) (of which the FFT is a quick implementation of) this will give you $c_{k,i,N_{DFT}}$ coefficients. That would be one set of $N_{DFT}$ coefficients for the $i^{th}$ recording of the $k^{th}$ type of drum hit.

Find the centroids (means of each DFT coefficient) that correspond to each drum hit and this will give you $k$ points in feature space that represent what each drum hit tends to sound like (obviously, here $k=2$).

To figure out what sort of drum hit has just been recorded (a drum hit you have not encountered during the "training" phase), take the waveform of it, pass it through DFT, take its DFT coefficients and work out which centroid they are closer to.

Doing this in real time might be a bit more challenging as you would have to establish an audio "loop" that continuously records frames from the audio interface, transforms them and passes them over to the classifier to make a decision.

Eventually, you will probably also need a way to describe a "third class" for sounds that are not drum hits and in which case you would like your classifier to remain "silent".

Overall, the system will also require some tuning to bring it as close as possible to a real time identification of drum hits, presumably, from a clean audio source, but it would be a start.

Hope this helps.