Comprehensive API for Arabic Maqām Theory
The Digital Arabic Maqām Archive API provides comprehensive access to Arabic music theory data, including maqamat (melodic modes), ajnas (tetrachordal structures), tuning systems, and advanced analysis tools for modulation and transposition. This API is designed for researchers, musicians, and developers working with microtonal music theory.
http://localhost:3000
All API endpoints are relative to this base URL. The API accepts JSON requests and returns JSON responses.
Retrieve all ajnas (tetrachordal structures) - the melodic building blocks for maqamat. Each jins contains note names, source references, and theoretical commentary.
curl -X GET "http://localhost:3000/api/ajnas" \ -H "Content-Type: application/json"
[ { "id": "1", "name": "jins rāst nawā", "noteNames": [ "nawā", "ḥusaynī", "awj", "kurdān" ], "commentsEnglish": "", "commentsArabic": "", "sourcePageReferences": [] }, { "id": "2", "name": "jins bayyāt", "noteNames": [ "dūgāh", "segāh", "chahārgāh", "nawā" ], "commentsEnglish": "", "commentsArabic": "", "sourcePageReferences": [] } ]
Analyze a specific jins within tuning systems, including transpositions and pitch class analysis.
Parameter | Type | Required | Description |
---|---|---|---|
jinsID | String | Optional* | Unique identifier for the jins (mutually exclusive with jinsName) |
jinsName | String | Optional* | Name of the jins (mutually exclusive with jinsID) |
includeTranspositions | Boolean | Optional | Whether to include all transpositions (ignored if newTonicForTransposition is specified). Defaults to false. |
newTonicForTransposition | String | Optional | If specified, returns only the transposition to this tonic note (overrides includeTranspositions) |
centsTolerance | Number | Optional | Tolerance value used as (+/-) for calculating possible transpositions within tuning systems that aren't based on frequency ratio fractions (e.g. 9/8, 4/3, 3/2) in their core data (0-50, default: 5) |
tuningSystemID | String | Optional | Specific tuning system to analyze |
tuningSystemStartingNoteName | String | Optional | Starting note name for tuning system note naming convention (must match first element in tuning system). If not provided, defaults to the first available note naming convention in the tuning system core data. This parameter affects the theoretical framework used for jins analysis. |
* Either jinsID or jinsName must be provided, but not both.
** Names can be provided with or without Arabic diacritics (e.g., both "jins bayyāt" and "jins bayyat" are accepted).
curl -X POST "http://localhost:3000/api/jins" \ -H "Content-Type: application/json" \ -d '{ "jinsName": "jins bayyāt", "includeTranspositions": true, "newTonicForTransposition": "dūgāh", "centsTolerance": 5, "tuningSystemID": "al-Farabi-(950g)", "tuningSystemStartingNoteName": "ʿushayrān" }'
curl -X POST "http://localhost:3000/api/jins" \ -H "Content-Type: application/json" \ -d '{ "jinsID": "1", "includeTranspositions": true, "newTonicForTransposition": "dūgāh", "centsTolerance": 5, "tuningSystemID": "IbnSina-(1037)", "tuningSystemStartingNoteName": "ʿushayrān" }'
Retrieve all maqamat (melodic modes) - complete modal structures in Arabic music theory. Each maqam contains ascending/descending sequences, suyur (melodic pathways), and source references.
curl -X GET "http://localhost:3000/api/maqamat" \ -H "Content-Type: application/json"
[ { "id": "1", "name": "maqām rāst", "ascendingNoteNames": [ "rāst", "dūgāh", "segāh", "chahārgāh", "nawā", "ḥusaynī", "awj" ], "descendingNoteNames": [ "ʿajam", "ḥusaynī", "nawā", "chahārgāh", "segāh", "dūgāh", "rāst" ], "suyūr": [...], "commentsEnglish": "", "commentsArabic": "", "sourcePageReferences": [] } ]
Analyze a specific maqam within tuning systems, including transpositions, modulations, and pitch class analysis.
Parameter | Type | Required | Description |
---|---|---|---|
maqamID | String | Optional* | Unique identifier for the maqam |
maqamName | String | Optional* | Name of the maqam |
includeTranspositions | Boolean | Optional | Whether to include all transpositions (ignored if newTonicForTransposition is specified). Defaults to false. |
newTonicForTransposition | String | Optional | If specified, returns only the transposition to this tonic note (overrides includeTranspositions) |
centsTolerance | Number | Optional | Tolerance value used as (+/-) for calculating possible transpositions within tuning systems that aren't based on frequency ratio fractions (e.g. 9/8, 4/3, 3/2) in their core data. This affects the modulation possibilities: more transpositions allow for more modulations (0-50, default: 5) |
tuningSystemID | String | Optional | Specific tuning system to analyze |
tuningSystemStartingNoteName | String | Optional | Starting note name for tuning system note naming convention (must match first element in tuning system). If not provided, defaults to the first available note naming convention in the tuning system core data. This parameter affects the theoretical framework used for maqam analysis. |
includeMaqamatModulations | Boolean | Optional | Include maqam-to-maqam modulations |
includeAjnasModulations | Boolean | Optional | Include ajnas-based modulations |
* Either maqamID or maqamName must be provided, but not both.
** Names can be provided with or without Arabic diacritics (e.g., both "maqam segāh" and "maqam segah" are accepted).
curl -X POST "http://localhost:3000/api/maqam" \ -H "Content-Type: application/json" \ -d '{ "maqamName": "maqām bayyāt", "includeTranspositions": false, "newTonicForTransposition": "rāst", "centsTolerance": 5, "tuningSystemID": "al-Ṣabbāgh-(1954)", "tuningSystemStartingNoteName": "rāst", "includeMaqamatModulations": true, "includeAjnasModulations": false }'
curl -X POST "http://localhost:3000/api/maqam" \ -H "Content-Type: application/json" \ -d '{ "maqamID": "2", "includeTranspositions": true, "newTonicForTransposition": "dūgāh", "centsTolerance": 5, "tuningSystemID": "IbnSina-(1037)", "tuningSystemStartingNoteName": "ʿushayrān", "includeMaqamatModulations": false, "includeAjnasModulations": true }'
Retrieve suyūr (melodic pathways) for a specific maqam or from a particular academic source. Suyūr represent traditional melodic progressions and ornamentations within maqamat.
Parameter | Type | Required | Description |
---|---|---|---|
maqamId | String | Optional* | Unique identifier for the maqam to retrieve suyūr from (mutually exclusive with maqamName and sourceId) |
maqamName | String | Optional* | Name of the maqam to retrieve suyūr from (mutually exclusive with maqamId and sourceId). Can be provided with or without Arabic diacritics. |
sourceId | String | Optional* | Unique identifier for the academic source to retrieve suyūr from across all maqamat (mutually exclusive with maqamId and maqamName) |
* Either maqamId, maqamName, or sourceId must be provided, but only one at a time.
curl -X POST "http://localhost:3000/api/sayr" \ -H "Content-Type: application/json" \ -d '{ "maqamId": "30" }'
curl -X POST "http://localhost:3000/api/sayr" \ -H "Content-Type: application/json" \ -d '{ "maqamName": "maqām faraḥfazzā" }'
curl -X POST "http://localhost:3000/api/sayr" \ -H "Content-Type: application/json" \ -d '{ "sourceId": "Al-Shawwā-(1946)" }'
{ "maqamId": "30", "maqamName": "maqām faraḥfazzā", "suyūr": [ { "id": "Sayr Al-Shawwā-(1946)", "creatorEnglish": "Al-Shawwā", "creatorArabic": "الشوّا", "sourceId": "Al-Shawwā-(1946)", "page": 19, "commentsEnglish": "Begins on nawā, then ḥusaynī and 'ajam until muḥayyar ascending and descending, then descends from nawā until yegāh with a touch of qarār ḥijāz before ending on its qarār, yegāh. Therefore it is assumed that the initial ascents and descents are in jins nahāwand nawā as per the construction of the maqām.", "commentsArabic": "", "stops": [ { "type": "jins", "value": "6", "startingNote": "nawā", "direction": "ascending" }, { "type": "jins", "value": "6", "startingNote": "nawā", "direction": "descending" }, { "type": "note", "value": "nawā" } ] } ] }
{ "sourceId": "Al-Shawwā-(1946)", "maqams": [ { "maqamId": "30", "maqamName": "maqām faraḥfazzā", "suyūr": [ { "id": "Sayr Al-Shawwā-(1946)", "creatorEnglish": "Al-Shawwā", "creatorArabic": "الشوّا", "sourceId": "Al-Shawwā-(1946)", "page": 19, "commentsEnglish": "Begins on nawā, then ḥusaynī and 'ajam until muḥayyar ascending and descending...", "commentsArabic": "", "stops": [ { "type": "jins", "value": "6", "startingNote": "nawā", "direction": "ascending" } ] } ] } ] }
Perform comprehensive modulation analysis for a given maqam within a specific tuning system. Calculates both maqamat-to-maqamat modulations and ajnas-based modulations.
Parameter | Type | Required | Description |
---|---|---|---|
tuningSystemID | String | Required | Unique identifier for the tuning system context |
maqamID | String | Optional* | Unique identifier for the source maqam (mutually exclusive with maqamName) |
maqamName | String | Optional* | Name of the source maqam (mutually exclusive with maqamID) |
tuningSystemStartingNoteName | String | Optional | Starting note name for tuning system note naming convention (must match first element in tuning system). If not provided, defaults to the first available note naming convention in the tuning system core data. This parameter affects the theoretical framework used for modulation analysis. |
noteNameToModulateFrom | String | Required | Which note name within the maqam to find modulations from |
ajnasModulationsMode | Boolean | Optional | Enable ajnas-based modulation analysis |
centsTolerance | Number | Optional | Tolerance value used as (+/-) for calculating possible transpositions within tuning systems that aren't based on frequency ratio fractions (e.g. 9/8, 4/3, 3/2) in their core data. This affects the modulation possibilities: more transpositions allow for more modulations (0-50, default: 5) |
* Either maqamID or maqamName must be provided, but not both.
* Note names, maqam names, and tuning system IDs can be provided with or without Arabic diacritics (e.g., both "dūgāh" and "dugah" are accepted).
curl -X POST "http://localhost:3000/api/modulations" \ -H "Content-Type: application/json" \ -d '{ "tuningSystemID": "al-Farabi-(950g)", "maqamID": "2", "noteNameToModulateFrom": "dūgāh", "ajnasModulationsMode": true, "centsTolerance": 5 }'
# Alternative using maqamName curl -X POST "http://localhost:3000/api/modulations" \ -H "Content-Type: application/json" \ -d '{ "tuningSystemID": "al-Farabi-(950g)", "maqamName": "maqām bayyāt", "noteNameToModulateFrom": "dūgāh", "ajnasModulationsMode": true, "centsTolerance": 5 }'
{ "maqamatModulations": [ { "targetMaqamID": "3", "modulationType": "direct", "commonTones": [...], "transitionPath": [...] } ], "ajnasModulations": [ { "jinsID": "5", "modulationDegree": 2, "intervalPattern": [204, 182, 204] } ] }
Update the patterns dataset with new pattern data.
curl -X PUT "http://localhost:3000/api/patterns" \ -H "Content-Type: application/json" \ -d '[ { "id": "1", "name": "Pattern 1", "data": "pattern data" } ]'
Retrieve all academic sources and references used in the maqam theory database. These provide scholarly foundation for the theoretical content.
curl -X GET "http://localhost:3000/api/sources" \ -H "Content-Type: application/json"
[ { "id": "Shawqi-(1969)", "titleEnglish": "Qiyās Al-Sullam Al-Mūsīqī Al-ʿArabī", "titleArabic": "قياس السلم الموسيقي العربي", "sourceType": "Book", "contributors": [ { "type": "Author", "firstNameEnglish": "Youssef", "lastNameEnglish": "Shawqi", "firstNameArabic": "يوسف", "lastNameArabic": "شوقي" } ], "editionEnglish": "", "editionArabic": "", "publicationDateEnglish": "1969", "publicationDateArabic": "١٩٦٩", "url": "", "dateAccessed": "", "originalPublicationDateEnglish": "", "originalPublicationDateArabic": "", "publisherEnglish": "Dar Al-Kutub", "publisherArabic": "دار الكتب", "placeEnglish": "Cairo", "placeArabic": "القاهرة", "ISBN": "" } ]
Calculate all possible transpositions of a maqam or jins within a specified tuning system. Finds optimal pitch class mappings with microtonal accuracy.
Parameter | Type | Required | Description |
---|---|---|---|
tuningSystemID | String | Required | Unique identifier for the target tuning system |
maqamID | String | Optional* | Unique identifier for the maqam to transpose (mutually exclusive with jinsID and maqamName) |
maqamName | String | Optional* | Name of the maqam to transpose (mutually exclusive with jinsID and maqamID) |
jinsID | String | Optional* | Unique identifier for the jins to transpose (mutually exclusive with maqamID and maqamName) |
tuningSystemStartingNoteName | String | Optional | Starting note name for tuning system note naming convention (must match first element in tuning system). If not provided, defaults to the first available note naming convention in the tuning system core data. This parameter affects the theoretical framework used for transposition analysis. |
centsTolerance | Number | Optional | Tolerance value used as (+/-) for calculating possible transpositions within tuning systems that aren't based on frequency ratio fractions (e.g. 9/8, 4/3, 3/2) in their core data (0-50, default: 5) |
* Either maqamID, maqamName, or jinsID must be provided, but only one at a time.
** Names and tuning system IDs can be provided with or without Arabic diacritics.
curl -X POST "http://localhost:3000/api/transpose" \ -H "Content-Type: application/json" \ -d '{ "tuningSystemID": "al-Farabi-(950g)", "maqamID": "2", "centsTolerance": 5 }'
# Alternative using maqamName curl -X POST "http://localhost:3000/api/transpose" \ -H "Content-Type: application/json" \ -d '{ "tuningSystemID": "al-Farabi-(950g)", "maqamName": "maqām bayyāt", "centsTolerance": 5 }'
curl -X POST "http://localhost:3000/api/transpose" \ -H "Content-Type: application/json" \ -d '{ "tuningSystemID": "al-Farabi-(950g)", "jinsID": "1", "centsTolerance": 5 }'
Retrieve all tuning systems used in Arabic music. Each defines microtonal pitch relationships and frequency ratios for specific musical scales and theoretical frameworks.
curl -X GET "http://localhost:3000/api/tuningSystems" \ -H "Content-Type: application/json"
[ { "id": "Ronzevalle-(1904)", "name": "Modernist Arabic Tuning", "pitchClasses": [ { "noteName": "rāst", "numerator": 1, "denominator": 1, "cents": 0 }, { "noteName": "dūgāh", "numerator": 9, "denominator": 8, "cents": 204 } ], "description": "24-tone quarter-tone tuning system", "octaveDivisions": 24 } ]
Select an endpoint and options below to see a generated curl request and example output.
Names (note names, ajnas, maqamat, tuning systems) can be entered with or without diacritics.