Rohin Sood
← All posts

Slap Bass: hearing the technique behind the notes

What building a bass-transcription prototype taught me about timbre, timing, and making model output useful to a musician.

Learning slap bass meant replaying the same few seconds of a recording until I could hear what the bassist's hands were doing. The pitch was only part of it. A thumb strike, a popped string, and a muted ghost note can occupy the same rhythmic space while asking for very different movements.

I built Slap Bass to make that process easier: recognize playing techniques in audio and work toward notation that preserves how a line is played. The project brought together labeled recordings, audio classification experiments, live-input processing, and a MusicXML prototype that I could open in MuseScore.

The demo shows a score in MuseScore with S/P/M technique annotations. It demonstrates the notation prototype; the current local export script generates those technique labels synthetically, so the video is not evidence of end-to-end classification accuracy.

What building it taught me

Technique lives in the sound's texture

A pitch estimate cannot tell me whether a note was slapped or popped. That distinction depends on the attack and spectral shape: the information a musician hears as timbre.

My Random Forest experiment uses 13 mel-frequency cepstral coefficients, averaged over each annotated note. MFCCs compress the spectral envelope into a compact feature vector. Averaging makes variable-length notes easy to compare, although it also discards the order of events within the note.

The saved experiment trained 100 trees on IDMT bass recordings. Its stratified note-level split classified 32 of 33 held-out notes correctly. That result made the representation worth exploring, while a recording-level split would better test whether it transfers to unfamiliar performances.

Confusion matrix from the local Random Forest experiment
Saved notebook output: 23 slap-thumb notes and nine pop notes classified correctly, with one pop classified as a slap. ST and SP are the dataset's technique labels. This experiment evaluates annotated note clips, separately from onset detection and score generation. Open full-size figure ↗

Finding the event is part of recognizing it

The transcription prototype loads mono audio at 44.1 kHz, detects onsets, and segments from each detected onset to the next. Backtracking moves detected boundaries toward preceding local energy minima, helping retain the beginning of an attack.

This makes segmentation a modeling decision. A window that starts late can lose the transient that distinguishes a technique; one spanning two notes can mix their characteristics. The live-input prototype raises the same issue with fixed buffers: buffer duration determines how much musical context each prediction sees.

Pitch estimation follows a separate path using YIN. In the export prototype, median segment pitch becomes a note estimate. Short, muted, or strongly percussive events make this difficult because a visible onset does not guarantee a stable fundamental.

A readable score needs its own representation

The MusicXML generator converts seconds into quarter-note units using the supplied tempo: quarter length = duration × BPM / 60. It rounds durations to sixteenth-note increments and adds technique text through music21.

That conversion exposes a tradeoff. Quantization makes a score readable, but can erase expressive timing. The current generator also appends notes sequentially rather than preserving absolute onset offsets, so rests and microtiming need more careful treatment. Uncertain pitch should eventually remain visible to the player instead of silently becoming a confident-looking note.

Preserving more of the performance

I also explored a CNN on fixed-size mel spectrograms. Three convolutional stages learn time-frequency patterns before global pooling and a softmax technique classifier. Compared with averaged MFCCs, the input retains the attack's development over time.

Training and validation accuracy from the local CNN experiment
Original training trace from the three-class MU/SP/ST experiment. The notebook records 378 examples with an 80/20 split; this curve is a development diagnostic, not an evaluation of complete transcriptions. Open full-size figure ↗

The next integration step is connecting learned technique predictions to the notation path and evaluating onset, pitch, technique, and rhythm together on unseen recordings. My main learning is that each layer has to preserve something the next one needs. The final test is whether the transcription helps me practice a passage with less guesswork while keeping the details that made me want to learn it.

← Back to all posts
Behind the mountains