When you drop a folder of recordings into a multisample instrument, the software has to figure out what note each file represents. It does this by finding the fundamental frequency of the audio, converting that to a musical pitch, and assigning the file to the keyboard zone centered on that pitch. Everything else, which notes the sample covers, how far it stretches up and down, follows from that root note placement.
For clean, clearly pitched recordings, this process is reliable. A folder of synth notes or piano samples will auto-map correctly and be ready to play with minimal adjustment. Noisier or inharmonic material needs review, and knowing which categories give detectors trouble is what makes that review fast.
How pitch detection works
Every pitched sound has a fundamental frequency and a series of harmonics above it. The fundamental is the lowest frequency at which the vibrating source completes a full cycle. The harmonics are integer multiples of it: if the fundamental is 220 Hz (A3), the harmonics sit at 440 Hz, 660 Hz, 880 Hz, and so on.
Pitch detection finds the fundamental by recognizing the pattern those frequencies make. The most common method is autocorrelation: the algorithm takes a short window of audio and measures how well it correlates with a time-shifted copy of itself. When the shift equals one period of the fundamental, the correlation peaks. That period converts directly to a frequency.
Other algorithms work in the frequency domain. HPS (Harmonic Product Spectrum) downsamples the spectrum repeatedly and multiplies the results together. The fundamental is the only frequency where peaks align across all the downsampled copies, so it stands out clearly. More recent methods like YIN and pYIN refine the autocorrelation approach with additional checks that reduce octave errors, which are the most common class of mistake.
For clean pitched audio in the middle of the keyboard range, most algorithms agree. The differences show up at the edges: sounds where the fundamental is weak, where the noise floor is high, or where the harmonic structure is unusual.
What makes a sample easy to detect
Clear, stable fundamentals map reliably. If the fundamental is among the strongest frequencies in the signal and it holds steady for at least several cycles, the detector has solid evidence to work with. Sustained oscillator waveforms, clean piano recordings in the mid-range, woodwinds, and brass instruments played at a reasonable dynamic all sit in this category.
Short attack transients don’t cause problems because the detector usually analyzes a portion of the note after the initial strike, where the harmonic series has settled. The inharmonic content at the very start of a piano note is real, but the analysis window skips past it to the sustained body of the tone.
Recording with the note name in the filename also helps. SampleStack reads pitch from audio analysis first and uses the filename as a secondary signal. If the name contains a clear note (C3.wav, D#4.wav, piano_A5.wav), that information can confirm or override an uncertain detection result. When the audio analysis is confident and the filename agrees, everything lands cleanly.
What makes a sample hard to detect
Inharmonic content is the main source of trouble. When the overtones don’t sit at integer multiples of the fundamental, the patterns that pitch detectors look for aren’t present. Bells and metallic percussion are the clearest examples: a struck bell has strong partial frequencies that bear little relationship to a harmonic series. Algorithms applied to this material return inconsistent or octave-shifted results.
Noise raises the same problem. Room ambience, amp hiss, and processing artifacts blur the harmonic structure and raise the noise floor the algorithm is working against. A heavily reverbed synth pad might have a clear fundamental when played dry, but the reverb tail populates the spectrum with reflections that don’t belong to the fundamental’s harmonic series. The same recording dry maps cleanly; processed for atmosphere, it has more uncertainty.
Airy, breathy timbres and vocals with significant fricative content have a related problem. There’s a genuine pitch, but the noise component mixed into the signal makes confirming it harder.
The octave error is a specific failure mode worth understanding. Some instruments produce recordings where the second harmonic (the octave above the fundamental) is louder than the fundamental itself. This appears in flutes and recorders in the upper register, some bowed string recordings, and certain synth patches with a scooped low end. An algorithm that finds the loudest frequency will call the note an octave too high. YIN and pYIN are better at catching this because they explicitly check for sub-octave candidates, but the error still comes up often enough to be worth anticipating.
Very short samples don’t provide enough cycles to measure the fundamental period reliably. This is mainly a concern for very short stabs and clicks at low pitches, not for typical instrument samples, which are usually at least a second long.
How to prep source material for reliable detection
Silence at the start of each file helps. The algorithm uses the beginning of the file to estimate the noise floor. Half a second of silence before the note gives it a clean baseline, which improves accuracy on material with low signal-to-noise ratios.
Keep source material dry. Add reverb, saturation, or modulation after the instrument is built, not before importing. Processing that adds frequency content obscures the harmonic structure the algorithm is looking for. The same patch dry and the same patch with a long reverb tail are genuinely different analysis problems.
Name files with their note. Even a rough name like A3.wav or synth_C4.wav gives the detector context when the audio analysis is ambiguous. For material where you know the pitch in advance, naming by note before import is straightforward and saves manual correction afterward.
For instruments that inherently resist detection (bells, metallic percussion, pitched noise, heavily processed sounds), accept that auto-mapping will need review. Import the folder, let the auto-map run, play the instrument chromatically, and correct what’s wrong. With a good zone map visualization, finding and fixing outliers takes a few minutes rather than redoing the whole mapping.
Root notes and zone boundaries
Finding the pitch of each sample gives you root notes. Zone boundaries are a separate step: once root notes are placed, the software determines which keyboard range each sample covers.
A simple approach assigns each zone the span of notes closest to its root. If three samples are rooted at C3, E3, and G3, the zones split the keyboard at D3 and F#3, so each sample covers the minor third around its root. Samples that are dense across the range produce narrower zones; samples spaced further apart produce wider ones, and the pitch shifts more noticeably when crossing a wide zone boundary.
The zone assignments are a starting point. After auto-mapping, playing the instrument chromatically from the bottom to the top of the range is how you find transitions that are too wide or catch cases where a zone’s root note landed on the wrong octave. Adjusting a root note is usually enough to fix either problem.
In the multisample workflow
Both the Disting NT and the Rample depend on sample-to-zone mapping being correct to function as intended. On the NT’s Poly Multisample algorithm, each file in a folder gets assigned a chromatic position and stretched to cover adjacent semitones. A sample mapped to the wrong octave plays back an octave off, which is immediately audible. On the Rample, each voice can hold up to 12 multi-sample layers, and a misassigned root note shifts the pitch of one layer relative to the others in the same voice.
When you build a multisample instrument in SampleStack’s multisample mode, pitch detection runs automatically as files are imported. Results appear in the zone map, with uncertain assignments flagged so you can review them first. Root notes are editable by dragging in the map or typing a note name. The zone preview plays any selected zone directly, so checking a suspicious assignment takes a few seconds rather than exporting and testing on hardware.
The synth-sampling walkthrough covers the full workflow from recording to export. Pitch detection is one step in that chain, and it goes smoothly when the source material is clean.
Frequently asked questions
Why did pitch detection put my sample on the wrong octave?
The most common cause is a recording where the second harmonic is louder than the fundamental. Some instruments, particularly flutes and recorders in the high register, have this character. Fix it by dragging the root note marker down an octave in the zone map, or by trimming the file to start after the initial attack transient.
Can pitch detection work on drums and sound effects?
For most drums and effects, no. Pitched percussion like tuned toms or marimba sometimes detects correctly, but the inharmonic transient content in typical drums makes detection unreliable. Name files with their intended pitch and set root notes manually.
Should I name my files with note names before importing?
It helps for ambiguous material. Pitch detection reads audio first and uses the filename as a secondary signal. For clearly pitched, cleanly recorded sources, the audio analysis alone is usually enough.
What if two samples end up on the same root note?
The zone map shows the conflict. Check both files: one has likely been assigned the wrong octave. Adjust the root note of the incorrect file to resolve the overlap.
Does pitch detection work better on longer or shorter samples?
Longer samples generally detect more reliably. The algorithm needs enough cycles of the waveform to measure the fundamental period. A sustained note of one to two seconds gives the detector solid material to work with.