Skip to main content

Audio-based bow-change and note-boundary detection for string instruments

Project description

bowdet

Audio-based bow-change and note-boundary detection for string instruments.

bowdet detects bow changes (down-bow ↔ up-bow transitions) in bowed string instrument recordings using a two-stage mel-spectrogram boundary approach.

Version 0.2.1 also includes BowDet-NB, an experimental unsupervised note-boundary detector for bowed string recordings.

Install

pip install bowdet

Bow-change detection

from bowdet import detect

times = detect("recording.wav")
print(times)  # array of bow-change times in seconds

Options

times = detect(
    "recording.wav",
    threshold=0.40,
    min_dist_sec=0.12,
)

BowDet-NB: note-boundary detection

BowDet-NB detects note boundaries using an unsupervised V3 multi-scale mel boundary-strength method. It uses only the boundary proposal stage, without the supervised Stage-2 classifier.

from bowdet import detect_nb

times = detect_nb("recording.wav")
print(times)  # array of note-boundary times in seconds

The full descriptive API is also available:

from bowdet import detect_note_boundaries

times = detect_note_boundaries("recording.wav")

Method

The bow-change detector uses a two-stage pipeline:

  1. Stage 1 — Boundary Proposal: Computes log-mel spectrogram boundary strength and proposes candidate positions at spectral peaks.
  2. Stage 2 — Candidate Classification: A compact CNN fused with 15 acoustic boundary features classifies each candidate as a bow change or not.

BowDet-NB uses a standalone unsupervised version of Stage 1 for note-boundary detection, based on multi-scale left-right mel-spectrogram differences.

Key insight: Bow changes and bowed-string note boundaries often produce broadband spectral transitions visible in the log-mel spectrogram, spanning approximately 100–300 ms across frequency bands.

Performance

Bow-change detection

Evaluated under leave-one-performer-out (LOPO) on 6 viola performers (9 recordings, ~17.7 min, 1,020 annotated bow changes):

Metric Score
IoU@0.1 F1 0.645 ± 0.012
Point F1 @100ms 0.635

BowDet-NB note-boundary detection

Evaluated on 9 bowed-string recordings spanning viola, violin, and cello:

Metric Tonal mean F1
Point F1 @50ms 0.701
Point F1 @100ms 0.774
Point F1 @150ms 0.793
Pseudo-region IoU@0.1 F1 0.812
Pseudo-region IoU@0.3 F1 0.803

Citation

If you use bowdet in your research, please cite this repository:

@software{yuan2026bowdet,
  author = {Haotian Yuan},
  title  = {bowdet: Audio-based bow-change and note-boundary detection for string instruments},
  year   = {2026},
  url    = {https://github.com/Yuan-618/bowdet}
}

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bowdet-0.2.1.tar.gz (117.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bowdet-0.2.1-py3-none-any.whl (115.4 kB view details)

Uploaded Python 3

File details

Details for the file bowdet-0.2.1.tar.gz.

File metadata

  • Download URL: bowdet-0.2.1.tar.gz
  • Upload date:
  • Size: 117.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for bowdet-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0e42d20970d4853b382ffb995cb6e30b66590a238c68ecce1c819ec852313afa
MD5 4af7de090527e304f872de22f201bbae
BLAKE2b-256 9d03f8ec5619906e28b30702f6825d1b916b26fcc2461064fadd747137f84fc4

See more details on using hashes here.

File details

Details for the file bowdet-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bowdet-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 115.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for bowdet-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22bd1c71ca6df1274d68202a96fb973c294e402563e280664a5a301f818270d4
MD5 215950c71056a09ad15bab5a55f4addb
BLAKE2b-256 622b4964d32a1292ead4f417fad47fb90a4c4a9c67ba155b8d5e19714113788f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page