Pitch Processing Config
data class PitchProcessingConfig(val fixOctaveErrors: Boolean = true, val removeSpuriousJumps: Boolean = true, val octaveThresholdCents: Float = 150.0f, val referencePitchHz: Float = 0.0f, val fixBoundaryOctaves: Boolean = true, val boundaryWindowMs: Float = 50.0f, val smoothPitch: Boolean = true, val smoothingWindowSize: Int = 7, val removeBlips: Boolean = true, val minimumNoteDurationMs: Float = 80.0f, val hopMs: Int = 10)
Configuration for batch pitch processing pipeline (ADR-001).
Replaces ContourCleanup with expanded config covering octave correction, smoothing, and blip removal. Supports 3-tier API: presets, builder, .copy().
Usage
// Tier 1: Preset
PitchProcessing.process(contour, PitchProcessingConfig.SCORING)
// Tier 2: Builder
val config = PitchProcessingConfig.Builder()
.fixOctaveErrors(true)
.removeSpuriousJumps(false)
.smoothingWindowSize(9)
.build()
// Tier 3: .copy()
PitchProcessing.process(contour, PitchProcessingConfig.DISPLAY.copy(hopMs = 20))Content copied to clipboard
iOS (Swift)
// Tier 1: Preset (lowercase Swift accessors: .raw / .scoring / .display)
PitchProcessing.process(contour: contour, config: .scoring)
// Tier 2: Builder (native Int, not Int32)
let config = PitchProcessingConfig.Builder()
.fixOctaveErrors(true)
.removeSpuriousJumps(false)
.smoothingWindowSize(9)
.build()
// Tier 3: .doCopy() (SKIE bridge for Kotlin's .copy)
let config = PitchProcessingConfig.display.doCopy(hopMs: 20)Content copied to clipboard
Constructors
Link copied to clipboard
constructor(fixOctaveErrors: Boolean = true, removeSpuriousJumps: Boolean = true, octaveThresholdCents: Float = 150.0f, referencePitchHz: Float = 0.0f, fixBoundaryOctaves: Boolean = true, boundaryWindowMs: Float = 50.0f, smoothPitch: Boolean = true, smoothingWindowSize: Int = 7, removeBlips: Boolean = true, minimumNoteDurationMs: Float = 80.0f, hopMs: Int = 10)
Types
Properties
Link copied to clipboard
How much of phrase edges to check for boundary octaves (ms)
Link copied to clipboard
Fix octave errors at phrase onset/offset
Link copied to clipboard
Enable snap-back octave correction
Link copied to clipboard
Minimum duration for valid pitch (removes blips)
Link copied to clipboard
How close to 1200 cents a jump must be to be corrected
Link copied to clipboard
Reference pitch in Hz for octave correction (0 = auto-detect)
Link copied to clipboard
Remove short voiced runs below minimum duration
Link copied to clipboard
Enable spurious octave jump removal (from tona)
Link copied to clipboard
Smoothing filter window size (must be odd)
Link copied to clipboard
Apply pitch smoothing filter