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

Implemented current interval names block #3617

Closed
wants to merge 0 commits into from
Closed

Implemented current interval names block #3617

wants to merge 0 commits into from

Conversation

Aman1919
Copy link
Contributor

@Aman1919 Aman1919 commented Jan 18, 2024

Issue #2209

This will print the current interval names like perfect unison , major second , augmented second etc . and removed NOTESTEP and added ALLNOTESTEP which support more notes like ( #, b )

current.interval.names.mp4

@Aman1919
Copy link
Contributor Author

@walterbender @pikurasa can you review this

@walterbender
Copy link
Member

A few comments:

  • I think most of this (in IntervalsAction) logic belongs in musicutils.js
  • @pikurasa can you review the naming convention?
  • We need to add _() to the strings so that they get translated

@Aman1919
Copy link
Contributor Author

Aman1919 commented Jan 20, 2024

A few comments:

  • I think most of this (in IntervalsAction) logic belongs in musicutils.js
  • @pikurasa can you review the naming convention?
  • We need to add _() to the strings so that they get translated

@walterbender so, this is supposed to change ?
declare const objects like allnotesstep and semitonetointervalmap in musicutils.js
And add _() for translation

@walterbender
Copy link
Member

Maybe the calculations should be in musicutils.js too

@walterbender
Copy link
Member

The basic idea is to keep the music details in one place.

@Aman1919
Copy link
Contributor Author

The basic idea is to keep the music details in one place.

@walterbender did some changes - declared const objs in musicutils and a GetNotesForInterval function which in getting used in both intervalnumber and currentinterval block

@Aman1919 Aman1919 requested a review from walterbender January 20, 2024 19:36
@walterbender
Copy link
Member

Looks good. Just need @pikurasa to sign off on the names.

@pikurasa
Copy link
Collaborator

Looks good. Just need @pikurasa to sign off on the names.

     0: { 0: _("Perfect unison"), 2: _("Diminished second") },
     1: { 2: _("Minor second"), 0: _("Augmented unison") },
     2: { 2: _("Major second"), 3: _("Diminished third") },
     3: { 3: _("Minor third"), 2: _("Augmented second") },
     4: { 3: _("Major third"), 4: _("diminished fourth") },
     5: { 4: _("Perfect fourth"), 3: _("Augmented third") },
     6: { 5: _("Diminished fifth"), 4: _("Augmented fourth") },
     7: { 5: _("Perfect fifth"), 6: _("Diminished sixth") },
     8: { 6: _("Minor sixth"), 5: _("Augmented fifth") },
     9: { 6: _("Major sixth"), 7: _("Diminished seventh") },
     10: { 7: _("Minor seventh"), 6: _("Augmented sixth") },
     11: { 7: _("Major seventh"), 0: _("Diminished Octave") },
     12: { 0: _("Perfect octave"), 7: _("Augmented seventh") }

I think I understand the system for the most part, but one thing confuses me. It seems to me that 0 is same letter, 2 is one letter up, 3 is two letters up. Is that correct? If so, it skips "1". (Assuming I'm correct in my observation) I think we should, instead, have 1 as one letter up, 2 as two letters up, etc.

So, if I've not made any mistakes, this list should look like this:

     0: { 0: _("Perfect unison"), 1: _("Diminished second") },
     1: { 1: _("Minor second"), 0: _("Augmented unison") },
     2: { 1: _("Major second"), 2: _("Diminished third") },
     3: { 2: _("Minor third"), 1: _("Augmented second") },
     4: { 2: _("Major third"), 3: _("diminished fourth") },
     5: { 3: _("Perfect fourth"), 2: _("Augmented third") },
     6: { 4: _("Diminished fifth"), 3: _("Augmented fourth") },
     7: { 4: _("Perfect fifth"), 5: _("Diminished sixth") },
     8: { 5: _("Minor sixth"), 4: _("Augmented fifth") },
     9: { 5: _("Major sixth"), 6: _("Diminished seventh") },
     10: { 6: _("Minor seventh"), 5: _("Augmented sixth") },
     11: { 6: _("Major seventh"), 0: _("Diminished Octave") },
     12: { 0: _("Perfect octave"), 6: _("Augmented seventh") }

If you have any questions, please let me know.

@Aman1919
Copy link
Contributor Author

Looks good. Just need @pikurasa to sign off on the names.

     0: { 0: _("Perfect unison"), 2: _("Diminished second") },
     1: { 2: _("Minor second"), 0: _("Augmented unison") },
     2: { 2: _("Major second"), 3: _("Diminished third") },
     3: { 3: _("Minor third"), 2: _("Augmented second") },
     4: { 3: _("Major third"), 4: _("diminished fourth") },
     5: { 4: _("Perfect fourth"), 3: _("Augmented third") },
     6: { 5: _("Diminished fifth"), 4: _("Augmented fourth") },
     7: { 5: _("Perfect fifth"), 6: _("Diminished sixth") },
     8: { 6: _("Minor sixth"), 5: _("Augmented fifth") },
     9: { 6: _("Major sixth"), 7: _("Diminished seventh") },
     10: { 7: _("Minor seventh"), 6: _("Augmented sixth") },
     11: { 7: _("Major seventh"), 0: _("Diminished Octave") },
     12: { 0: _("Perfect octave"), 7: _("Augmented seventh") }

I think I understand the system for the most part, but one thing confuses me. It seems to me that 0 is same letter, 2 is one letter up, 3 is two letters up. Is that correct? If so, it skips "1". (Assuming I'm correct in my observation) I think we should, instead, have 1 as one letter up, 2 as two letters up, etc.

So, if I've not made any mistakes, this list should look like this:

     0: { 0: _("Perfect unison"), 1: _("Diminished second") },
     1: { 1: _("Minor second"), 0: _("Augmented unison") },
     2: { 1: _("Major second"), 2: _("Diminished third") },
     3: { 2: _("Minor third"), 1: _("Augmented second") },
     4: { 2: _("Major third"), 3: _("diminished fourth") },
     5: { 3: _("Perfect fourth"), 2: _("Augmented third") },
     6: { 4: _("Diminished fifth"), 3: _("Augmented fourth") },
     7: { 4: _("Perfect fifth"), 5: _("Diminished sixth") },
     8: { 5: _("Minor sixth"), 4: _("Augmented fifth") },
     9: { 5: _("Major sixth"), 6: _("Diminished seventh") },
     10: { 6: _("Minor seventh"), 5: _("Augmented sixth") },
     11: { 6: _("Major seventh"), 0: _("Diminished Octave") },
     12: { 0: _("Perfect octave"), 6: _("Augmented seventh") }

If you have any questions, please let me know.

@pikurasa Got it . I have done the changes .

@walterbender
Copy link
Member

I am getting an error:

Uncaught TypeError: Cannot read properties of undefined (reading 'substring')
at Singer.IntervalsActions.GetCurrentInterval (IntervalsActions.js:98:56)
at CurrentIntervalBlock.arg (IntervalsBlocks.js:357:48)
at Logo.parseArg (logo.js:619:26)
at PlusBlock.arg (NumberBlocks.js:739:34)
at Logo.parseArg (logo.js:619:26)
at PlusBlock.arg (NumberBlocks.js:739:34)
at Logo.parseArg (logo.js:619:26)
at Logo.runFromBlockNow (logo.js:1342:30)
at logo.js:1300:32

@walterbender
Copy link
Member

^^ It was when I tried to access the interval name from inside of a note block. It seems to work fine when I have it after the note block.

@Aman1919
Copy link
Contributor Author

Aman1919 commented Jan 22, 2024

^^ It was when I tried to access the interval name from inside of a note block. It seems to work fine when I have it after the note block.

@walterbender i think it was happening bcz GetNotesForInterval was returning 0 instead of object at line 4492 . fixed it

@pikurasa
Copy link
Collaborator

I tested it, and I got unexpected results.

Please see the following:

current-interval-block.webm

The first and last note combinations are correct (C and A): they are both properly identified as major sixths.

The second note combination (E and C) should be minor sixth, and the third note combination (G and E) should be major sixth.

Also, for reference:

@pikurasa
Copy link
Collaborator

A couple notes:

  • A perfect octave doesn't need to say anything after it.
  • Instead of 1 x octave, it should say ", plus one octave".
  • We should account for some of the intervals over an octave, up to a thirteenth. Please see below.
  • There seems to be a bit of a pattern to when intervals are undefined according to this tool. Please see the test below.

Expanded intervals:

     13: { 1: _("Minor ninth"), 0: _("Augmented octave") },
     14: { 1: _("Major ninth"), 2: _("Diminished tenth") },
     15: { 2: _("Minor tenth"), 1: _("Augmented second") },
     16: { 2: _("Major tenth"), 3: _("diminished eleventh") },
     17: { 3: _("Perfect eleventh"), 2: _("Augmented tenth") },
     18: { 4: _("Diminished twelfth"), 3: _("Augmented eleventh") },
     19: { 4: _("Perfect twelfth"), 5: _("Diminished thirteenth") },
     20: { 5: _("Minor thirteenth"), 4: _("Augmented fifth, plus an octave") },
     21: { 5: _("Major thirteenth"), 6: _("Diminished seventh, plus an octave") },

Test file and results:

@Aman1919 Aman1919 closed this Jan 25, 2024
@Aman1919 Aman1919 deleted the cnb branch January 25, 2024 11:35
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 this pull request may close these issues.

3 participants