https://github.com/pedrozath/coltrane Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} pedrozath / coltrane Public * Notifications * Fork 36 * Star 1.3k A music theory library with a command-line interface License MIT license 1.3k stars 36 forks Star Notifications * Code * Issues 11 * Pull requests 3 * Actions * Projects 1 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights pedrozath/coltrane This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 29 branches 18 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/p] Use Git or checkout with SVN using the web URL. [gh repo clone pedroz] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @pedrozath pedrozath bumps coltrane version and gambiarra version ... c05d407 Feb 6, 2021 bumps coltrane version and gambiarra version c05d407 Git stats * 171 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .bundle updates April 29, 2017 15:01 bin updates coltrane for ruby 3 January 18, 2021 10:25 exe extracts several coltrane CLI parts into a gem called gambiarra October 20, 2018 17:41 img 2.1.0 March 16, 2018 19:57 lib bumps coltrane version and gambiarra version February 6, 2021 14:57 spec Includes totally revamped, easy to use command line interface. October 16, 2018 00:55 .DS_Store extracts several coltrane CLI parts into a gem called gambiarra October 20, 2018 17:41 .gitignore updates gitignore and readme January 28, 2018 11:40 .rspec progress April 28, 2017 14:38 .rubocop.yml more rubocop fixing January 29, 2018 10:32 .ruby-version updates coltrane for ruby 3 January 18, 2021 10:25 .travis.yml updates travis ruby version January 18, 2021 10:29 CHANGELOG.md extracts several coltrane CLI parts into a gem called gambiarra October 20, 2018 17:41 CODE_OF_CONDUCT.md gemified May 15, 2017 08:01 Gemfile extracts several coltrane CLI parts into a gem called gambiarra October 20, 2018 17:41 Gemfile.lock bumps coltrane version and gambiarra version February 6, 2021 14:57 Guardfile progress April 30, 2017 09:06 LICENSE.txt gemified May 15, 2017 08:01 README.md updates info on coltrane interactive mode April 8, 2018 08:55 Rakefile adds interactive mode April 3, 2018 22:11 coltrane.gemspec updates coltrane for ruby 3 January 18, 2021 10:25 config.ru 2.1.0 March 16, 2018 19:57 View code [ ] Coltrane CLI (Command Line Interface) Features How to discover a chord name using the notes How to discover a Scale by providing chords How to find common chords Quickly generate chord progressions Generate fretboard sheets for improvising Finding the progression of a chord sequence Interactive mode (shell) Installation Any questions? Feature requests? Bugs? Extra Contributing How to contribute License README.md Build Status Gem Version Maintainability Test Coverage Coltrane A music calculation library/CLI written in Ruby. Coltrane CLI (Command Line Interface) Screenshot Screenshot Features * Generate chord progressions for Jazz, Blues, Pop, or custom and see how to play them * Seek chords, see their notes and how to play them * Seek scales, see their notes and see how to play them * Find chords that are common between 2 scales * Find scales containing a chord or a set of notes * Find possible progressions of a chord sequence * All of the above can be seen on guitar, bass, piano or ukelele representations, no sheet music needed How to discover a chord name using the notes coltrane chords --notes C-E-G CM: C E G To see it on guitar: coltrane chords --notes C-E-G --on guitar CM: +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 3 | | | | | 8 | | | | | 3 | | | | 1 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 4 | | | | | | 9 | | | | | | 4 | | | | | | 2 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 5 | | | | 10 | | | | 5 | | | | 3 | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 6 | | | | | | 11 | | | | | | 6 | | | | | | 4 | | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ PS: It looks way better on the terminal , specially on iTerm How to discover a Scale by providing chords You shall provide chords separated by dashes (--chords CM7-Dm7-EM) or notes (--notes C-Ab-F-G). For example: coltrane find-scale --chords E6/9-BM Pentatonic Major C(1) C#(3) D(3) D#(1) E(5) F(0) F#(4) G(2) G#(2) A(4) A#(0) B(5) Blues Major C(2) C#(4) D(3) D#(2) E(5) F(1) F#(4) G(2) G#(3) A(4) A#(1) B(5) Harmonic Minor C(3) C#(5) D(2) D#(4) E(4) F(3) F#(4) G(2) G#(5) A(3) A#(3) B(4) Hungarian Minor C(2) C#(6) D(2) D#(4) E(3) F(3) F#(5) G(1) G#(5) A(3) A#(4) B(4) Pentatonic Minor C(1) C#(5) D(0) D#(4) E(2) F(2) F#(4) G(0) G#(5) A(1) A#(3) B(3) Blues Minor C(2) C#(5) D(1) D#(4) E(2) F(3) F#(4) G(1) G#(5) A(2) A#(4) B(3) Whole Tone C(3) C#(3) D(3) D#(3) E(3) F(3) F#(3) G(3) G#(3) A(3) A#(3) B(3) Flamenco C(3) C#(4) D(2) D#(5) E(3) F(3) F#(4) G(3) G#(5) A(2) A#(4) B(4) Major C(2) C#(4) D(4) D#(2) E(6) F(1) F#(5) G(3) G#(3) A(5) A#(1) B(6) Natural Minor C(2) C#(6) D(1) D#(5) E(3) F(3) F#(5) G(1) G#(6) A(2) A#(4) B(4) When on terminal, the command above will highlight the Scales that have all needed notes. The number in the parenthesis show how many chord notes were included. How to find common chords You may use this command to find a chord that may serve as bridge to a different scale/key (i.e. modulation). Coltrane offers you a command to find common chords shared between both keys/scales. Here is how you use it. Say you wanna transition from C Major to D Natural Minor. coltrane common-chords C Major, D Natural Minor Dm: D F A Am: A C E Dm7: D F A C Am7: A C E G CM: C E G FM: F A C CM6: C E G A FM6: F A C D C6/9: C E G A D F6/9: F A C D G C6/9(add11): C E G A D F [...] You can, whenever it fits, add an --on to see the output in a graphical representation: coltrane common-chords C Major, D Natural Minor --on piano Dm: +-+-++-+-+-+-++-++-+-+-+-++-+-+-+-++-++-+-+ | | || | | | || || | | | || | | | || || | | | | || | | | || || | | | || | | | || || | | | | || | | | || || | | | || | | | || || | | | ++++++ | +++++++++ | ++++++ | +++++++++ | | | | | | | | | | | | | | | | | |D| |F| |A| | |D| |F| |A| | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+ Am: +-+-++-+-+-+-++-++-+-+-+-++-+-+-+-++-++-+-+ | | || | | | || || | | | || | | | || || | | | | || | | | || || | | | || | | | || || | | | | || | | | || || | | | || | | | || || | | | ++++++ | +++++++++ | ++++++ | +++++++++ | | | | | | | | | | | | | | | | |C| |E| | |A| |C| |E| | |A| | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+ [...] Quickly generate chord progressions coltrane progression jazz in A --on guitar Bm7: +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 2 | | 2 | | | | 2 | | | | 9 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 3 | | | | | | 3 | | | | | | 3 | | | | | 10 | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 4 | | | | | | 4 | | | | | 4 | | | | | 11 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 5 | | | | | | 5 | | | | | | 5 | | | | | | 12 | | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ E7: +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 1 | | | | | 6 | | | | | 4 | | | | | 1 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 2 | | | | | 7 | | | 5 | | | | | 2 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 3 | | | | | | 8 | | | | | | 6 | | | | | 3 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 4 | | | | | | 9 | | | | | | 7 | | | | | | 4 | | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ A7: +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 10 | | | | | 5 | | | | 5 | | | 9 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 11 | | | | | 6 | | | | | 6 | | | | | 10 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 12 | | | | | | 7 | | | | | | 7 | | | | | | 11 | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ 13 | | | | | | 8 | | | | | | 8 | | | | | | 12 | | | | | | +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+ You can say Jazz, Pop, Blues, etc. You can also generate progressions in a custom way, using roman numerals: coltrane progression I-vi-V-iidim in D Generate fretboard sheets for improvising Sometimes you wanna see the scale on guitar for improvising: coltrane scale F pentatonic --on guitar F Pentatonic Major: E -- | F -- G -- A -- -- C -- D -- -- F -- G -- A -- -- C -- D -- A A | -- -- C -- D -- -- F -- G -- A -- -- C -- D -- -- F -- G -- D D | -- -- F -- G -- A -- -- C -- D -- -- F -- G -- A -- -- C -- G G | -- A -- -- C -- D -- -- F -- G -- A -- -- C -- D -- -- F -- B -- | C -- D -- -- F -- G -- A -- -- C -- D -- -- F -- G -- A -- E -- | F -- G -- A -- -- C -- D -- -- F -- G -- A -- -- C -- D -- 03 05 07 09 12 15 17 19 The same work for --on piano, --on bass, -- on ukulele, etc. You can also see the chords by typing --tertians or --chords [size]. --tertians will give you chords by sequential thirds while --chords will give you all chords with supplied size (or simply all if empty). ProTip: You can force the guitar frets visualization for chords too using the --on guitar_frets option. Finding the progression of a chord sequence Perhaps this is the most complex operation that Coltrane performs. It searches the chords on all known scales, generates the progression notation and print in, sorted by notes left out. That is because most songs, specially knowadays, may use chords that contain notes which are outside of that scale. This command us to analyze songs and discover what they have in common, even tho they have different notes. Let's say we want to find the possible progressions of Red Hot Chili Pepper's Otherside: coltrane find-progression Am-F-C-G i-VI-III-VII in A Natural Minor (0 notes out) vi-IV-I-V in C Major (0 notes out) iii-I-V-II in F Major (1 notes out) vi-III-VII-IV in D Hungarian Minor (1 notes out) v-III-VII-IV in D Natural Minor (1 notes out) ii-VII-IV-I in G Hungarian Minor (2 notes out) ii-VII-IV-I in G Natural Minor (2 notes out) vii-V-II-VI in A# Major (2 notes out) iv-II-V-III in D Pentatonic Minor (2 notes out) v-II-VI-III in D Blues Minor (2 notes out) iii-I-IV-II in F Pentatonic Major (2 notes out) iv-I-V-II in F Blues Major (2 notes out) PS: Notice that vi-IV-I-V is the well known I-V-vi-IV progression, used in a lot of songs. Interactive mode (shell) Simply type coltrane or coltrane shell to enable interactive mode. You can then run commands without typing coltrane before, E.G.: scale D harmonic minor Installation $ gem install coltrane PS: Once you install the gem the CLI is instaled in your system and it's ready to be used. Any questions? Feature requests? Bugs? 1. Find me on Twitter. I'll be glad to answer. 2. Open an issue. 3. Join our chatroom Extra * How to use the Core Theory library. * Why did I write this library. * Chat room for discussing the project, answering questions, etc. * See the changelog Contributing We are looking for contributors. Find me on our chatroom if you need any kind of information. How to contribute 1. Fork this code 2. Install the test suite (RSpec) by running good old bundle command 3. Make your changes and maybe write a test or two. 4. Check if specs pass bundle exec rspec spec 5. Submit a PR. License The gem is available as open source under the terms of the MIT License. by Pedro Maciel | twitter | pedro@pedromaciel.com About A music theory library with a command-line interface Topics ruby music gem Resources Readme License MIT license Code of conduct Code of conduct Stars 1.3k stars Watchers 18 watching Forks 36 forks Releases 18 tags Packages 0 No packages published Used by 18 * @stevetwitte @stevetwitte / mtdb * @Dahie @Dahie / everchords * @JimmyLongbrow @JimmyLongbrow / ai-comp Contributors 5 * @pedrozath * @ErCollao * @dependabot[bot] * @jjthrash * @lucascaton Languages * Ruby 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.