{"id":14006715,"url":"https://github.com/derrickward/ChordRecGen","last_synced_at":"2025-07-24T00:31:59.230Z","repository":{"id":80904228,"uuid":"267082942","full_name":"derrickward/ChordRecGen","owner":"derrickward","description":"Mobile app library for musical chord recognition and generation","archived":false,"fork":false,"pushed_at":"2020-07-01T05:56:09.000Z","size":248,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-30T17:39:08.208Z","etag":null,"topics":["chord","chord-generation","chord-recognition","chords","ios","ios-swift","midi","music","music-theory"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derrickward.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-05-26T15:36:27.000Z","updated_at":"2024-11-13T05:04:03.000Z","dependencies_parsed_at":"2023-03-12T12:42:41.122Z","dependency_job_id":null,"html_url":"https://github.com/derrickward/ChordRecGen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/derrickward/ChordRecGen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickward%2FChordRecGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickward%2FChordRecGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickward%2FChordRecGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickward%2FChordRecGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derrickward","download_url":"https://codeload.github.com/derrickward/ChordRecGen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickward%2FChordRecGen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266774745,"owners_count":23982246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chord","chord-generation","chord-recognition","chords","ios","ios-swift","midi","music","music-theory"],"created_at":"2024-08-10T10:01:36.156Z","updated_at":"2025-07-24T00:31:58.599Z","avatar_url":"https://github.com/derrickward.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"\n# ChordRecGen\n\nMobile app (Swift, IOS/Mac) library for musical chord recognition and generation. Interface is also compatible with objective-C.\n\n## Getting Started\n\n1. clone git repository\n2. Add ChordRecognizeGenerate XCode library project to your workspace.\n3. (optional) If you want to run sample app, from command line, run pod install to generate XCode workspace for app. Sample app uses AudioKit and AudioKitUI cocoapod libraries. \n\n### How Chord Recognition Works\n\n1. On receiving an array of notes, the chord recognizer attempts to match a triad from a lookup table. Multiple roots are tried. The best match is chosen based on a score computed by a utility.\n2. If a triad is found, the \"stack of thirds\" are traversed in the note array to determine the chord's factor. Other notes are classified as \"altered\", \"added\", or \"inverted\", etc.. along the way accordingly.\n3. If there are notes left over that do not match, a recursive check for additional chords is made (polychords).\n\n### Usage\n\n**• Chord Recognition**\n\n1. Declare an instance of the *ChordRecognizer* class\n2. Pass an array of note bytes (MIDI standard) to the notesToChord method.\n3. *notesToChord* returns an array of *ChordGroup* objects, which contain a characterization of the chord. Each object in the array represents an alternate descriptor/name for the chord. Each *ChordGroup* instance only contains more than one *Chord* object instance if the notes form a polychord.\n\nSee *ChordRecognizerViewController.swift* class code in the sample app for a complete example.\n\n**• Chord Generation**\n\n1. Declare an instance of the *ChordRecognizer* class\n2. Declare an instance of the *Chord* class. Specify the key, factor, octave, and quality using the constructor. Initialize any additional descriptors using the properties (inversions, alterations, added notes, etc...).\n3. Call the *chordToMIDINotes* method and pass in the chord.\n4. The *notes* property of the chord class will now contain the MIDI note bytes for the chord.\n\nSee *ChordGeneratorViewController.swift* class code in the sample app for a complete example.\n\n### Chord Classes\n\n#### ***• Chord***\n\nObject encapsulating a single chord's notes and descriptors.\n\n*Properties*\n```\nadditions - array of Tone objects representing added notes to chord\n\nfactors - array of Tone objects representing chord's factors (7, 9, etc..). \n\nommision - optional property indicating degree of ommited note in Triad\n\nquality - quality of chord (major, minor, etc...)\n\nfactorQuality - quality of chord factor (dominant, major, half-diminished, none)\n\nrootNote - byte indicating the root note of the chord (MIDI note)\n\nnotes - array of MIDI note bytes for all chord notes\n\ninvertedNotes - array of MIDI note bytes for inverted chord notes\n\nalteredNotes - array of Tones representing altered notes in chord\n\ntriad - Triad instance containing information about the chord's triad\n\noctave - octave 0 - 8\n\ninversion - indicates 1st, 2nd, 3rd, or no inversion\n```\n            \n*Methods*\n```\n\ninit(rootNote : ChordNote,quality : Quality,factor : Degree, factorQuality : Quality)\n\ninit(root : ChordRoot,octave : UInt8, quality : \nQuality,factor : Degree, factorQuality : Quality)\n\ninit(notes:[ChordNote])\n\ninit()\n\nisDyad - returns true is chord is a dyad\n\nisPowerchord - returns true if chord is a powerchord\n\nisSuspended - returns true if chord has a quality of sus2 or sus4\n\naddAdditions(designators: [Tone]) - add additional notes to chord (added notes)\n\nsetFactor(degree: Degree) - set the factor of the chord\n\naddFactors(factors: [Tone]) - add more than one factor to chord\n\nclearFactors\n\ngetFullName - returns a string containing the full name of the chord\n\ngetFullName(formType : Form) - overload that allows you to specify short or long form for the chord name (default is long)\n\ngetRootName - returns a string with the name of the root of the chord\n\n```\n\n#### ***• ChordGroup***\nObject encapsulating an array of chords. More than one chord in array implies a polychord. \n\n*Properties*\n```\nchords - array of Chord objects\n\nnotes - returns an array of bytes representing the notes in all chords in the group (MIDI notes)\n\n```\n\n*Methods*\n```\ngetFullName - returns a string containing the full name of the chord/polychord\n\nisPolychord - returns true if group of chords is a polychord\n```\n\n#### ***• Tone***\nObject that encapsulates a degree and an array of signs. Used to represent chord factors, alterations, and added notes.\n\n### Sample App\n\nThe sample app UI contains a tab for chord recognition and a tab for chord generation. The chord recognition UI has an onscreen piano keyboard for entering notes. The recognize button characterizes the chord using the library, and the name is displayed on screen. The chord generation UI contains controls for setting the chord's key, octave, factor, qualities, inversions, added notes, etc... On clicking generate, the notes for the chord are generated and the chord is played back.\n\n### Apps That Use Library\n\nMixxmaster\n[https://apps.apple.com/us/app/mixxmaster/id1381233927](https://apps.apple.com/us/app/mixxmaster/id1381233927)\n\n## Authors\n\n* **Derrick Ward** - [derrickward](https://github.com/derrickward)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n* I am not an expert in music theory and learned chord theory on the fly while building this project. I am seeking contributors and testers with more depth of knowledge than I have to improve this project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderrickward%2FChordRecGen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderrickward%2FChordRecGen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderrickward%2FChordRecGen/lists"}