# Bach Doodle Dataset: 21.6 Million User Melodies with Coconet Four-Voice Bach-Style Harmonizations (Google Magenta)

## Facts

- Provider: Google Magenta (Cheng-Zhi Anna Huang et al.)
- License: CC-BY-4.0 (https://magenta.tensorflow.org/datasets/bach-doodle)
- Stored at: Google Cloud Storage, gs://magentadata/datasets/bach-doodle (us)
- Access: public, readable without an account
- Category: Speech & Audio
- Source: https://magenta.tensorflow.org/datasets/bach-doodle
- Page: https://scigantic.com/archive/cfa84c27-5205-5d5a-9f75-5c09c249a469
- Keywords: Speech & Audio, Google Cloud Storage

## About

The Bach Doodle Dataset collects compositions made with the Google Doodle of March 2019, where users entered a short melody and a Coconet model harmonized it in four voices in the style of J.S. Bach chorales. It holds over 21.6 million miniature compositions from 8.5 million anonymous sessions (one session is a single page load, which can contain several compositions), about 6 years of music in total. Each data point contains the user's input melody, the four-voice harmonization returned by Coconet, and metadata: country of origin, the user's rating, the key signature, time spent composing and how many times the composition was played back. The folder holds the data sharded as 192 gzipped JSON-lines files (bach-doodle.jsonl-00000-of-00192.gz and onward, about 37 MB each) and as matching TFRecord shards of NoteSequence protocol buffers, readable with the note-seq library. Used for symbolic music generation, melody and harmony modeling, music education research and ethnomusicological comparison of melodies across countries. License: CC BY 4.0, made available by Google LLC. Cite Huang et al., The Bach Doodle: Approachable music composition with machine learning at scale, ISMIR 2019.

## Load the data

```python
import gcsfs
fs = gcsfs.GCSFileSystem(token='anon')
fs.ls('magentadata/datasets/bach-doodle/', detail=False)[:10]
```

Lists the files with anonymous access. Runs on any machine, with no cloud account.

## Data structure

Example file: `datasets/bach-doodle/`

## Open it

- In a hosted notebook with the data mounted: https://scigantic.com/archive/cfa84c27-5205-5d5a-9f75-5c09c249a469
- Full record as JSON (schema card included): https://api.scigantic.com/api/archives/cfa84c27-5205-5d5a-9f75-5c09c249a469
- Over MCP: `get_schema_card` with id `cfa84c27-5205-5d5a-9f75-5c09c249a469` at https://api.scigantic.com/mcp

## Related topics

- [Speech & Audio datasets](https://scigantic.com/topics/speech-and-audio)
