Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash chords with the bass #192

Closed
dok opened this issue Jun 27, 2020 · 3 comments · Fixed by #411
Closed

Slash chords with the bass #192

dok opened this issue Jun 27, 2020 · 3 comments · Fixed by #411

Comments

@dok
Copy link

dok commented Jun 27, 2020

Hey @danigb, I was wondering if you'd like help implementing this. Is there a particular structure that you are thinking about when a user passes in something like:

const Chord = require("@tonaljs/chord");

Chord.get('G/C')

/**
{ empty: false,
  name: 'G major',
  setNum: 2192,
  chroma: '100010010000',
  normalized: '100001000100',
  intervals: [ '1P', '3M', '5P' ],
  quality: 'Major',
  aliases: [ 'M', '' ],
  symbol: 'G',
  type: 'major',
  root: '',
  rootDegree: 0,
  tonic: 'G',
  notes: [ 'G', 'B', 'D' ] }
**/

What would be the ideal scenario here? How about something like:

{ empty: false,
  name: 'G major',
  setNum: 2192,
  chroma: '100010010000',
  normalized: '100001000100',
  intervals: [ '4P', '1P', '3M', '5P' ],
  quality: 'Major',
  aliases: [ 'M', '' ],
  symbol: 'G',
  type: 'major',
  root: 'C',
  rootDegree: 0,
  tonic: 'G',
  notes: ['C', 'G', 'B', 'D' ] }

Other references: #164

@danigb
Copy link
Collaborator

danigb commented Jun 28, 2020

Hi @dok , yes! That would be awesome.

Sou you are thinking about adding a couple of fields, right? 👇

  • root (string, "" by default)
  • rootDegree (number 0 by default, means same as tonic)

I'm wondering if "bass" instead of "root" is a better word? Looks like wikipedia uses that term: https://en.wikipedia.org/wiki/Slash_chord

Things to consider:

  • What happens if the root/bass is not part of the chord? (Without going deep, I think it should return an empty not valid chord)
  • What happens if the root/bass is not a note?

@dok
Copy link
Author

dok commented Jun 30, 2020

Adding "bass" in conjunction with the "root" property sounds good! It would be better than manipulating the root, since we won't lose information about the chord. In that case, I don't think the rootDegree would change either.

What happens if the root/bass is not part of the chord? (Without going deep, I think it should return an empty not valid chord)

I think that sounds good for now

What happens if the root/bass is not a note?

That would be like if someone specified a "Eb/Eb" 😂. I think we can either treat it as an "Eb" or return a non-valid chord. What do you think?

@stevage
Copy link
Contributor

stevage commented Dec 6, 2023

Chiming in here. No idea if this will get implemented, but my thoughts:

  • add a bass attribute that for C would be C and for C/Bb would be Bb.
  • name should reflect the slash, maybe C major over Bb
  • aliases should contain the slash

Harder questions:

  • for type, should every type/slash combo be considered unique (ie, is the type of C/Bb "major over flat seventh" or is it just "major slash")
  • does intervals include the bass note? I guess it does, but for some applications that may not be expected.

(I didn't really understand the "Without going deep, I think it should return an empty not valid chord" comment. Maybe you are thinking mostly of classical music where the slash chord indicates an inversion, whereas I'm mostly thinking of jazz/pop, where it most often is a non-chord tone).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants