Add one-shot vs loop sample classification#3
Merged
Conversation
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_loopboolean field to distinguish one-shot samples (single kicks, snares, chord stabs) from loops (drum patterns, basslines, melodic phrases) — any sample type can be eitherChanges
services/audio_analysis.py: Newanalyze_and_classify()function that infers loop/one-shot and extracts metadata in a single audio load passmodels/sample.py: Addedis_loopcolumn withserver_default, addedis_loopfilter tosearch_by_clap()schemas/sample.py:is_looponSampleSchemaandSampleSearchRequestagents/sample_agent.py: System prompt section on one-shot vs loop behavior rulesagents/tools/: All three tool files conditionally show key/BPM only for loops;suggest_complement()skips key compatibility for one-shot sourcesrouters/samples.py: Passis_loopfilter through search endpointscripts/: All scripts converted to async (useget_async_sqlalchemy_session), sharedfind_audio_filehelper extracted to__init__.pycore/config.py: Fixedenv_filepath (was resolving tobackend/.envinstead of project root), addedextra="ignore"for non-Settings env varspyproject.toml: Addedsqlalchemy[asyncio]extra (providesgreenlet)c1e3a6c19709_add_is_loop_columnTest Plan
uv run seed-db— verify one-shots getkey=None,bpm=None; loops get full metadatais_loop=False, "loop" dirs →is_loop=True)GET /api/samples— verifyis_loopappears in responseuv run pre-commit run --all-filesandcd frontend && pnpm lint🤖 Generated with Claude Code