Skip to main content

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

Metadata

Release files for bowdet 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bowdet 0.2.2
File Size Uploaded Provenance Actions
bowdet-0.2.2.tar.gz 117.0 kB With provenance Details for bowdet-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bowdet 0.2.2
File Interpreter ABI Platform Actions
bowdet-0.2.2-py3-none-any.whl Python 3 none any Details for bowdet-0.2.2-py3-none-any.whl

Total release size: 232.4 kB

Release files / bowdet-0.2.2.tar.gz

Download URL bowdet-0.2.2.tar.gz
Size 117.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bd4e9685c56e5e50a0000b1f0e9517379112333438a294b77ad2e896914233a4
BLAKE2b-256 checksum
How to use checksums
8564b17303f5b83617a95fbea374727b2d8319ffd51a932ad801b5c6a9a7c2ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 9, 2026.

Transparency log

Release files / bowdet-0.2.2-py3-none-any.whl

Download URL bowdet-0.2.2-py3-none-any.whl
Size 115.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
776f214d260f489a043f5f3f509ba6e0cf2d8ddae4afa161b27cbefeaefa5da6
BLAKE2b-256 checksum
How to use checksums
ce6874a2c99e3400b36f33861a0e1f3431dca94284eaeb7f4e621c7a30fadcaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 9, 2026.

Transparency log

Security for bowdet 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bowdet-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page