Code Monkey home page Code Monkey logo

coltrane's Issues

Feature request: abilty to invert intervals

Coltrane should be able to invert intervals which is a very basic and useful operation for manipulating intervals.

For example, if I created an interval of a Perfect Fifth Coltrane should have a way to invert the original interval to a Perfect Fourth.

Output sharps/flats based on the key

Super cool app (found it via your reddit post)! I was just reading through the README and saw that one of the Fm7 examples that, for example, D# is in the scale; generally, unless in some larger context, F minor is expressed in terms of flats (Ab, Bb, Db, Eb) instead of their sharp counterparts. It'd be nice to have coltrane express them accordingly.

tl;dr It just feels a little awkward to me to see "D#" in a spot where I'd expect "Eb"; makes me pause a sec and double-check what I'm looking at.

Output natural symbols only when relevant

This is another issue of preference. At least in my experience, you usually only see natural symbols in music when the context that you're in says that you should be playing a flat or sharp. Seeing them in, say, the D major scale example makes me pause and double-check the context I'm in: "hmmm... I see G♮--did I actually ask for the right thing?".

Seems like the UI would be less cluttered and it'd be a little more natural to only include the natural symbols when they mean to do something out of the scale's normal mode: like if the user wanted to see "f harmonic minor", you'd show an E♮ instead of E♭.

Again, just some thoughts I figured I throw out there.

Coltrane doesn't display enharmonic intervals correctly

Coltrane does not give the correct name when creating an interval that has a more common enharmonic equivalent. Due to this, Coltrane cannot be used for music theory centric applications.

This interval is C to D (or D _down to _ C) and should be a Major Second (Correct)

2.5.0 :007 > interval = Coltrane::Note['D'] - Coltrane::Note['C']
 => #<Coltrane::IntervalClass:0x000000000142e248 @cents=200> 
2.5.0 :008 > interval.name
 => "M2" 

This interval is C to D# (or D# _down to _ C) and should be an Augmented Second (Wrong)

2.5.0 :009 > interval = Coltrane::Note['D#'] - Coltrane::Note['C']
 => #<Coltrane::IntervalClass:0x00000000013e46c0 @cents=300> 
2.5.0 :010 > interval.name
 => "m3" 

This interval is F to B (or B _down to _ F) and should be an Augmented Fourth (Correct)

> 2.5.0 :017 > interval = Coltrane::Note['B'] - Coltrane::Note['F']
>  => #<Coltrane::IntervalClass:0x00000000016d3958 @cents=600> 
> 2.5.0 :018 > interval.name
>  => "A4" 

This interval is B to F (or F _down to _ B) and should be a diminished fifth (Wrong, it gives and Augmented Fourth)

> 2.5.0 :017 > interval = Coltrane::Note['F'] - Coltrane::Note['B']
>  => #<Coltrane::IntervalClass:0x00000000016d3958 @cents=600> 
> 2.5.0 :018 > interval.name
>  => "A4" 

This interval is B to Fb (or Fb _down to _ B) and should be a doubly diminished fifth (Wrong, it gives a Perfect 4th)

2.5.0 :033 > interval = Coltrane::Note['Fb'] - Coltrane::Note['B']
 => #<Coltrane::IntervalClass:0x0000000001514810 @cents=500> 
2.5.0 :034 > interval.name
 => "P4" 

undefined method `match?'

I just did gem install coltrane, then tried running the coltrane cli and I got this error:

/Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/lib/core_ext.rb:7:in `underscore': undefined method `match?' for /[A-Z-]|::/:Regexp (NoMethodError)
Did you mean?  match
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/lib/coltrane/classic_scales.rb:25:in `block in <module:ClassicScales>'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/lib/coltrane/classic_scales.rb:24:in `each'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/lib/coltrane/classic_scales.rb:24:in `<module:ClassicScales>'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/lib/coltrane/classic_scales.rb:5:in `<module:Coltrane>'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/lib/coltrane/classic_scales.rb:3:in `<top (required)>'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/lib/coltrane.rb:29:in `<top (required)>'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/cwatts/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/coltrane-1.0.22/exe/coltrane:9:in `<top (required)>'
	from /Users/cwatts/.rbenv/versions/2.3.0/bin/coltrane:23:in `load'
	from /Users/cwatts/.rbenv/versions/2.3.0/bin/coltrane:23:in `<main>'

Status of project?

I just found this project today and I think it's great, however it seems a bit abandoned (the chat doesn't work for example and some of the links in the readme are 404, open PRs, etc).

I was using it to find chords and it also seems to lack some results that the other online chord finders have. I'd like to contribute but does anyone know what the status of this project is? Finished? On hold?

chords not recognized

{:notes=>["F#", "C#", "A", "G#"], :chord=>"?"}] #Gbmin add9
{:notes=>["C#", "C", "F"], :chord=>"?"}, #Dbmaj7(no5)

coltrane ... --on guitar: Strings depicted in unconventional (reverse) order

coltrane scale F pentatonic --on guitar

Strings are depicted in unconventional order: topmost in coltrane's representation is the low E string:

E  | -- -- G  -- A  -- B  -- -- D  -- E  -- -- G  -- A  -- B  -- -- D  --
A  | -- B  -- -- D  -- E  -- -- G  -- A  -- B  -- -- D  -- E  -- -- G  --
D  | -- E  -- -- G  -- A  -- B  -- -- D  -- E  -- -- G  -- A  -- B  -- --
G  | -- A  -- B  -- -- D  -- E  -- -- G  -- A  -- B  -- -- D  -- E  -- --
B  | -- -- D  -- E  -- -- G  -- A  -- B  -- -- D  -- E  -- -- G  -- A  --
E  | -- -- G  -- A  -- B  -- -- D  -- E  -- -- G  -- A  -- B  -- -- D  --

Compare this to the representations found via: google image search, where topmost is the high E string.

Run in Hyper with `Abnormal end`

I'm a Windows user, but I can't run examples in Hyper. Message Abnormal end is printed. I guess some plugins should be installed. So what can I do next? Thanks!

Abnormal end

Hello,
When using CLI parameters, I got an "Abnormal end" message.

To reproduce:

$ docker run -it --entrypoint /bin/bash ruby
$ gem install coltrane
$ coltrane chords CM7 --on guitar
This terminal doesn't seem to support true color. Try something like iTerm2 (for macOS), VTE or Konsole (for linux) or Hyper (for Windows) and you'll see the true magic!

-> coltrane chords CM7 --on guitar 

Abnormal end

Interval methodlolgy is not iniutive.

When talking about intervals from a music theory perspective, the default is to assume the interval is assenting rather than descending. This is very important because reversing the operation creates undesired structures.

For example, a major chord is defined as a set of Root, Major 3rd, and a Perfect 5th. When building these ascending with a root of C, you end up with the nodes C, E, G which is what you expect. If you use the same intervals, but take them as descending instead, you end up with C, Ab, F which is a F minor chord.

Coltrane only seems to be able handle talking about descending intervals when figuring out the intervals based on two notes. From exploring the docs and trying in irb, I can only seem to create descending intervals means to use the gem, I'd have to think about a lot of operations in reverse to get the correct interval.

(currently works)
D down to C interval example:

2.5.0 :019 > interval = Coltrane::Note['D'] - Coltrane::Note['C']
 => #<Coltrane::IntervalClass:0x0000000001646ff8 @cents=200> 
2.5.0 :020 > interval.name
 => "M2" 

(proposed operation and current results)
C up to D interval example:

2.5.0 :021 > interval = Coltrane::Note['C'] + Coltrane::Note['D']
 => #<Coltrane::Note:0x0000000001671b40 @alteration=0, @integer=2> 
2.5.0 :022 > interval.name
 => "D" 

provide install via Homebrew

Project looks great, just thinking it would be nice to have install available via os package manager as well.

Problem with coltrane shell in Linux Mint 21

I installed coltrane and Konsole in Linux Mint 21, but when entering
./coltrane shell
I always get:
-> coltrane shell
Abnormal end

I also tried other terminals (rxvt, gnome-terminal, xterm) but none work.
Any idea whether this is a bug?

Broken link for "Why did I write this library" URL in `README.md`.

Currently in the Extras section of the README the link for "Why did I write this library" points to https://medium.com/@pedrozath/so-i-wrote-a-library-to-help-me-compose-music-ddb4ae7c8227:

  • * [Why did I write this library](https://medium.com/@pedrozath/so-i-wrote-a-library-to-help-me-compose-music-ddb4ae7c8227).

However, that link now appears to redirect to https://blog.pedromaciel.com/so-i-wrote-a-library-to-help-me-compose-music-ddb4ae7c8227 which generates a browser warning due to a self-signed certificate.

Side Note:

  • The certificate served seems to be the default for a project named "Traefik", which had an issue opened that might be relevant: traefik/traefik#5849

If you ignore the browser warning a 404 status is returned.

Due to some issues with redirects & parameters it was a little non-trivial to actually find the copy of the page that the Internet Archive's Wayback Machine does actually have but, for anyone else interested, here's the link which displays the content:

abnormal end

I also run in "abnormal end" error when running it on Linux (debian)
Is this project still maintained?
:(

crashes with C9 or Cadd9 or C add9 or C add 9 etc.

Welcome to Coltrane 4.1.1 (You chose: chords)
? What do you need (You chose: show chord)
? Which chord?

C add 9
? How do you wanna see it? (You chose: Guitar)
/opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/theory/note.rb:29:in initialize' /opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/theory/note.rb:43:in new'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/theory/note.rb:43:in []' /opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/theory/chord.rb:93:in parse_from_name'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/theory/chord.rb:22:in initialize' /opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/commands/get_chords_from_string.rb:6:in new'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/commands/get_chords_from_string.rb:6:in block in run' /opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/commands/get_chords_from_string.rb:5:in map'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/commands/get_chords_from_string.rb:5:in run' /opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/commands/command.rb:7:in run'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/ui/views/show_chord.rb:14:in render' /opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/lib/coltrane/ui/base_view.rb:5:in render'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/view.rb:34:in respond' /opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/route.rb:13:in respond'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/history.rb:31:in refresh' /opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/router.rb:21:in get'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/app.rb:82:in flow' /opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/app.rb:26:in block in start'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/app.rb:26:in loop' /opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/app.rb:26:in start'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/exe/coltrane:24:in <top (required)>' /opt/local/bin/coltrane:23:in load'
/opt/local/bin/coltrane:23:in <main>' Bad constructor. Wrong argument(s). Traceback (most recent call last): 5: from /opt/local/bin/coltrane:23:in

'
4: from /opt/local/bin/coltrane:23:in load' 3: from /opt/local/lib/ruby2.7/gems/2.7.0/gems/coltrane-4.1.1/exe/coltrane:24:in <top (required)>'
2: from /opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/app.rb:26:in start' 1: from /opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/app.rb:26:in loop'
/opt/local/lib/ruby2.7/gems/2.7.0/gems/gambiarra-0.0.5/lib/gambiarra/app.rb:26:in `block in start': no implicit conversion of nil into Hash (TypeError)

enharmonic change

coltrane scale F pentatonic minor
results in:
F G♯ A♯ C D♯
where it should be:
F A♭ B♭ C E♭ F

The process basically consists of determining the intervals of the pentatonic scale:
minor 3rd, 4th, 5th, flat 7th.
E.g. the minor 3rd of F is foremost a 3rd, hence A. But A is a major 3rd, so we lower it by appending a . Same applies to the other notes.
You could argue that those notes (G♯, A♭) are enharmonic equivalents. But this only applies in equal temperament. Also, you'll be battling against a well established convention in music.

See e.g. Step 7, and particularly Step 4 in the explanation on how to build the F pentatonic minor scale.

Commands not recognized

Recently I've installed coltrane and have been trying to get ruby to recognize
While the Core Music Theory library works with irb, the main CLI doesn't recognize any of the coltrane commands.

Here's an example of what I get when I input a command in irb

irb(main):005:0> coltrane chords --notes C-E-G
/usr/local/Cellar/ruby/3.1.2/lib/ruby/3.1.0/irb/workspace.rb:119:in `eval': (irb):5: syntax error, unexpected constant, expecting `do' or '{' or '(' (SyntaxError)
coltrane chords --notes C-E-G
                        ^
from /usr/local/Cellar/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
from /usr/local/opt/ruby/bin/irb:25:in `load'
from /usr/local/opt/ruby/bin/irb:25:in `<main>'

Outside of irb, I get the coltrane: command not found statement.
I'm using coltrane 4.1.1 and ruby 3.1.2p20

Ruby 3 support

It seems that this gem doesn't support Ruby 3.
Or it crashes on my PC for some other reason.

$ coltrane
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/router.rb:32:in `build_url'
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/router.rb:19:in `get'
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/app.rb:82:in `flow'
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/app.rb:26:in `block in start'
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/app.rb:26:in `loop'
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/app.rb:26:in `start'
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/coltrane-4.0.6/exe/coltrane:24:in `<top (required)>'
/home/morigs/.asdf/installs/ruby/3.0.0/bin/coltrane:23:in `load'
/home/morigs/.asdf/installs/ruby/3.0.0/bin/coltrane:23:in `<main>'
wrong number of arguments (given 1, expected 2)
/home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/app.rb:26:in `block in start': no implicit conversion of nil into Hash (TypeError)
        from /home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/app.rb:26:in `loop'
        from /home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/gambiarra-0.0.3/lib/gambiarra/app.rb:26:in `start'
        from /home/morigs/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/coltrane-4.0.6/exe/coltrane:24:in `<top (required)>'
        from /home/morigs/.asdf/installs/ruby/3.0.0/bin/coltrane:23:in `load'
        from /home/morigs/.asdf/installs/ruby/3.0.0/bin/coltrane:23:in `<main>'

short commands don't work

% coltrane -h
Coltrane 2.1.0 | Error:  Invalid command.

% coltrane -v
Coltrane 2.1.0 | Error:  Invalid command.

% coltrane help
Coltrane 2.1.0 -- A music querying interface
by Pedro Maciel ([email protected])

Check the chat room for project discussion/help: https://gitter.im/coltrane-music/Lobby


Usage:

  coltrane <subcommand> [options]

Options:
        -h, --help         Show this message
        -v, --version      Print the name and version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.