The straight way to handle this is to build in a section selection in your SynthDef, e.g. by controlling the ‘pos’ argument between two bounds.
Most of miSCellaneousLib’s Buffer Granulation tutorial examples contain arguments posLo and posHi that do exactly this. Note that TGrains has a ‘centerPos’ arg which expects the position in seconds whereas GrainBuf’s arg ‘pos’ expects the relative position between 0 and 1.
pos defines a signal that is looping between posLo and posHi according to the given speed (rate) using Phasor. Of course you may choose a different type of movement (random, sine, whatever).
Certainly you could do an automatic position selection based on whatever criteria, including an analysis of the spectrum of the sound used.
To me your attempt contains two things that are not necessarily related: (1) finding a position where frequencies are not too high and (2) finding an “interesting position”.
(1) can be approached by quite objective criteria (to be chosen though), e.g., with filter bank analysis and FFT.
(2) is depending on personal judgement.
From my experience with granular synthesis I’d rather start from point (2), therefore not excluding possibly interesting choices by (1). However, it would be possible to implement (1), but this would need to clarify the criteria and it could be quite some work.
There’s another point to think about: in buffer granulation the spectrum is determined by a number of different variables, at least these three: (i) the spectrum of the source, (ii) the trigger rate of grains (if it’s so-called synchronous granulation with equidistant grains), and (iii) the rate of position movements. These variables can interact in quite complicated and opaque ways.
So, considering these blurrings, all the analysis work might not necessarily lead to expected or interesting results.
right I see, it sounds extra technical for not so much result but good news i improved a little bit the recording and tried different way to read the part that was getting processed by another extra high filter , mainly by adding different looping length to the impulse that modulate the trigger,
this way it does not loop up too much that same section that might not bit too interesting let say