findSegments

fun findSegments(pitchesHz: FloatArray, mask: BooleanArray, minGapMs: Float = 0.0f, hopMs: Int = 10): List<IntRange>

Find contiguous segments where a mask is true.

Return

List of IntRange representing segment bounds (inclusive)

Parameters

pitchesHz

Pitch values in Hz (-1 for unvoiced)

mask

Criteria mask

minGapMs

Minimum gap between segments to keep separate

hopMs

Hop size between frames in milliseconds