https://github.com/mewa/esac-mir
Traditional folk music information retrieval from EsAC and MIDI files
https://github.com/mewa/esac-mir
midi music music-information-retrieval
Last synced: about 1 year ago
JSON representation
Traditional folk music information retrieval from EsAC and MIDI files
- Host: GitHub
- URL: https://github.com/mewa/esac-mir
- Owner: mewa
- License: gpl-3.0
- Created: 2017-11-06T01:38:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-05T11:35:08.000Z (over 7 years ago)
- Last Synced: 2025-03-12T09:44:59.316Z (over 1 year ago)
- Topics: midi, music, music-information-retrieval
- Language: Haskell
- Homepage:
- Size: 62.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Formats
### ESAC JSON format
`ESAC JSON` format is an intermediate format, which represents esac records. Individual records are expressed as JSON objects with the following properties:
| property | type | ESAC field mapping |
|-----------|--------|--------------------|
| name | String | record name |
| title | String | CUT |
| source | String | TRD |
| region | String | REG |
| signature | String | SIG |
| key | String | KEY |
| melody | String | MEL |
| remarks | String | REM |
### ESAC-Id JSON format
In addition to the properties defined by the `ESAC JSON` format, the `ESAC-Id JSON` format includes record `id`, which is used to make API calls.
| property | type |
|----------|--------|
| id | String |
### ESAC Filter format
| property | type |
|----------|--------|
| field | String |
| term | String |
`field` can take the following values:
* `name`
* `title`
* `source`
* `region`
* `signature`
* `key`
* `melody`
* `melody_raw`
* `melody_rhythm`
* `remarks`
### MIDI JSON format
`MIDI JSON` format is a JSON object representing a MIDI file.
| property | type | description |
|----------|--------|----------------------------------------------|
| midi64 | String | data url containing base64-encoded MIDI file |
## API methods
### Get ESAC record by id
| method | url |
|--------|-------------|
| GET | `/esac/:id` |
| parameter | description | optional |
|-----------|----------------------------------------------------------------------------|----------|
| :id | id of ESAC record | no |
| parse | when non-empty value is suppplied, request body is parsed as raw ESAC file | yes |
| response |
|-----------------------|
| `ESAC-Id JSON` object |
### Get ESAC records list
| method | url |
|--------|--------------|
| GET | `/esac/list` |
| response |
|--------------------------------------|
| JSON array of `ESAC-Id JSON` objects |
### Search for ESACs matching filters
| method | url |
|--------|----------------|
| POST | `/esac/search` |
| request body | response |
|-------------------------------------|--------------------------------------|
| JSON array of `ESAC Filter` objects | JSON array of `ESAC-Id JSON` objects |
### Add ESAC record
| method | url |
|--------|---------|
| PUT | `/esac` |
| parameter | description | optional |
|-----------|----------------------------------------------------------------------------|----------|
| parse | when non-empty value is suppplied, request body is parsed as raw ESAC file | yes |
| request body | response |
|-------------------------------------------------------|----------------------------------|
| `ESAC JSON` (or ESAC file, when `parse` is specified` | `{"id": }` |
### Update ESAC record by id
| method | url |
|--------|-------------|
| PATCH | `/esac/:id` |
| parameter | description | optional |
|-----------|----------------------------------------------------------------------------|----------|
| :id | id of ESAC record | no |
| parse | when non-empty value is suppplied, request body is parsed as raw ESAC file | yes |
### Delete ESAC record by id
| method | url |
|--------|-------------|
| DELETE | `/esac/:id` |
| parameter | description | optional |
|-----------|----------------------------------------------------------------------------|----------|
| :id | id of ESAC record | no |
### Parse raw ESAC to ESAC JSON
| method | url |
|--------|-------------|
| POST | `/esacjson` |
| request body | response |
|--------------|-------------|
| ESAC file | `ESAC JSON` |
### Convert ESAC to MIDI
| method | url |
|--------|--------------|
| POST | `/esac2midi` |
| parameter | description | optional |
|-----------|----------------------------------------------------------------------------|----------|
| parse | when non-empty value is suppplied, request body is parsed as raw ESAC file | yes |
| format | when `format=file`, response is a MIDI file | yes |
| tempo | BPM in resulting MIDI file, default is `90` | yes |
| octave | base octave of ESAC intervals, default is `5` | yes |
| request body | response |
|-------------------------------------------------------|------------------------------------------------|
| `ESAC JSON` (or ESAC file, when `parse` is specified) | `MIDI JSON` (or MIDI file, when `format=file`) |
### Convert MIDI to ESAC
| method | url |
|--------|--------------|
| POST | `/esac2midi` |
| parameter | description | optional |
|-----------|--------------------------------------------------|----------|
| key | base sound of the resulting ESAC, default is `C` | yes |
| request body | response |
|--------------|-------------|
| MIDI file | `ESAC JSON` |