API Reference¶
This is the auto-generated API reference for DrumScript.
The examples below can also be used as:
import drumscript as ds ds.transcribe() ds.extract_drum_stem() ds.extract_stems() ds.detect_tempo()
Configuration & Constants¶
DrumScript uses a set of global constants to ensure audio processing consistency. These are not hidden magic numbers; they are exposed here for transparency.
This script defines ALL parameters used throughout modules in DrumScript |
Core Functions¶
Run the full DrumScript transcription pipeline end-to-end. |
|
Extracts drum stems and optionally separates the full track into constituent parts. |
|
Estimates the global tempo (BPM) of a given audio file or pre-loaded audio array. |
|
Exports a generated DrumScript score object to a beautifully rendered PDF file. |
|
Converts a DrumScript score object into a standard MIDI file for DAW integration. |
|
Exports a DrumScript score object to MusicXML format. |
Audio Processing¶
This module handles loading and basic normalisation of audio files. |
|
This module uses the demucs library () to extract stems from multi-layer audio files. |
|
|
Legacy wrapper for the transcription pipeline. |
Uses soundfile + numpy so the WAV output path is ffmpeg-free. |
|
|
Separates a full audio track using Demucs and processes the outputs based on user-input args (optional) |
This module contains functions for automatic tempo detection from audio data. |
|
This module will detect the onset (start) times of drum hits in the audio. |
|
This module will extract relevant features from audio segments for drum classification. |
Classification¶
This script determines the classification rules by which the parameters in py are applied to audio_file_path. |
|
|
Dedicated classification engine for single beats, paradiddles, and rudiments. |
Stage 1: Evaluates both skins and Metals simultaneously. |
|
Wrapper to route validated onsets through the Physics-First Classification Engine. |
|
Stage 2B: Sorts Metals (Hats, Cymbals). |
|
|
Stage 2A: Sorts skins (kick, snare, toms). |
Analyses the audio slice and extracts the physical DSP features. |
|
Cuts a specific millisecond slice of audio starting exactly at the onset time. |
Score Builders¶
This script defines ALL parameters used throughout modules in DrumScript |
|
Helper functions for musical calculations. |
|
Module to build the final score from classified events. |
|
Module for rendering the drum score to PDF using ReportLab. |
|
This module takes classified drum events and renders them into a standard MIDI file. |
|
Module for rendering the drum score to MusicXML format. |