Metadata-Version: 2.4
Name: jazzsamba
Version: 0.1.0
Summary: Python helper for the JazzSAMBA jazz-standards multitrack dataset
Author: Phillip Long
License: MIT License
        
        Copyright (c) 2026 Phillip Long
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/pnlong/jazzsamba
Project-URL: Documentation, https://github.com/pnlong/jazzsamba#readme
Keywords: jazz,music,dataset,multitrack,MIR
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: soundfile>=0.12
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# jazzsamba

Python API for the **JazzSAMBA** multitrack jazz-standards dataset.

Install the package, point it at a local `JazzSAMBA/` directory (after unzipping the Zenodo archives into one folder), and load songs, takes, and stems.

## Related repos

| | |
|--|--|
| **Dataset download** | Zenodo (DOI forthcoming) |
| **Project page** | [`pnlong/jazzsamba-demo`](https://github.com/pnlong/jazzsamba-demo) — [listen / explore](https://pnlong.github.io/jazzsamba-demo/) |
| **Processing / release pipeline** | [`pnlong/jazz-standard-dataset`](https://github.com/pnlong/jazz-standard-dataset) (authoring only; not required to use this package) |

## Install

```bash
pip install -e .
# later: pip install jazzsamba
# needs setuptools>=68 (or the included setup.py for older pip)
```

From the processing monorepo (submodule):

```bash
pip install -e packages/jazzsamba
```

## Quick start

```python
from jazzsamba import JazzSamba

ds = JazzSamba("/path/to/JazzSAMBA")
# or JazzSamba() if JAZZSAMBA_DIR / JAZZ_SAMBA_ROOT is set (or a nearby .env)
song = ds.song(0)
take = song.recording.take("preferred")
mixture = take.mixture_path()
bass = take.stem("bass")
print(bass.audio_path, bass.midi_path, bass.midi_is_gt, bass.is_derived)
for stem in take.stems(is_derived=False):
    ...
```

Iterate and filter (rows whose protocol song directory is missing are skipped):

```python
for song in ds.songs(synchronous=False, genre="swing"):
    take = song.recording.take("preferred")
    extras = song.recording.extras()  # async only; not a Take
```

`reference.url` / `youtube_id` come from `songs.csv` (pointers only; commercial/YouTube audio is not in JazzSAMBA).

## Object model

See [docs/ER.md](docs/ER.md). Canonical layout and song- vs take-level fields are also in the JazzSAMBA dataset `README.md` (shipped on Zenodo).

```
JazzSamba(root)
  └── Song
        └── AsyncRecording | SyncRecording
              └── Take (preferred | alternate)
              └── extras/   # async only, not a Take
```

Prefer:

```python
take = song.recording.take("preferred")
take.measure_sequence   # derived from annotations/bars.csv
take.solo_order         # derived from annotations/soloists.csv (instrument column)
take.annotations()
```

## Dataset root layout

```
JazzSAMBA/
  songs.csv
  musicians.csv
  async/
    splits/{train,val,test}.txt
    songs/<NN-title>/{preferred,alternate,extras}/
  sync/
    splits/{train,val,test}.txt
    songs/<NN-title>/{preferred,alternate}/
```

```python
ids = ds.split_ids("async_test")  # reads async/splits/test.txt
```

## License

MIT — see [LICENSE](LICENSE).
