scan_audio_folder
Scan audio folders to extract BPM, key, and role from filenames. Returns loop metadata and summaries to help select loops matching target criteria.
Instructions
Walk a folder for audio loops and parse metadata from filenames.
Returns every audio file (.wav, .mp3, .flac, .aif, .aiff, .ogg, .m4a)
with BPM, musical key, and role (kick / bass / pad / lead / fx / …)
extracted from the filename. Plus a summary of distributions so
the AI can quickly decide on a target BPM / key before picking loops.
For a large library (thousands of files), don't scan the whole
thing blindly: call list_audio_subfolders first to see its shape,
point path at the specific subfolder that matters, and use the
filters below to narrow further.
Args:
path: Absolute folder path (e.g., D:/Music Production/Chillstep Express).
recursive: Walk subfolders too. Default True.
max_files: With no filters, stop after this many files visited.
With any filter below active, stop after this many MATCHES
instead (the walk looks past non-matching files to find
them, up to an internal safety ceiling). Default 500; max 5000.
query: Space-separated terms, ALL must match (AND) against the
full path, case-insensitive — covers genre/style words
("techno") and specific naming ("laugh") since these
usually appear literally in folder or file names.
min_bpm: Only files whose parsed BPM is >= this. 0 = no filter.
max_bpm: Only files whose parsed BPM is <= this. 0 = no filter.
role: Exact match (case-insensitive) against the parsed role
(kick/snare/hat/ride/perc/bass/pad/lead/vocal/fx/drums).
Empty = no filter.
key: Root note + optional accidental, e.g. "D", "F#", "Bb".
Matches any quality (major/minor) unless you specify one
("Dm"). Empty = no filter.
Returns a structure with:
folder: resolved absolute path
total_files: how many matched
truncated: True if max_files hit before end
summary: BPM / key / role distributions + parse-failure counts
loops: list of { path, filename, duration_sec, size_mb, parsed: { bpm, key, role } }
hint: a one-line suggestion for the AI's next call
Files without parseable metadata are still listed when no filter
needs that field; a min_bpm/max_bpm/role/key filter excludes files
where that specific field didn't parse. Pair with
transport_set_bpm + load_loops to turn the selection into a
working REAPER session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | ||
| path | Yes | ||
| role | No | ||
| query | No | ||
| max_bpm | No | ||
| min_bpm | No | ||
| max_files | No | ||
| recursive | No |