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 block #3679

Merged
merged 5 commits into from
Jan 28, 2024
Merged

implemented current interval block #3679

merged 5 commits into from
Jan 28, 2024

Conversation

Aman1919
Copy link
Contributor

Issue #2209

currentinterval2.mp4

@Aman1919
Copy link
Contributor Author

@pikurasa could u review the changes ?

@pikurasa
Copy link
Collaborator

@pikurasa could u review the changes ?

I tested it just now via
current-interval-test.zip, and the results are pretty good so far.

Two things I noticed:

  1. When going below, it is doing the wrong thing. The result of measuring Do4 to Ti3, for example, should be "Minor second below" (right now it is "Major seventh, one octave below". Do4 to La3 should be "Minor third below". FWIW, when it gets to Do4 and Do3, it is correctly displaying "one octave below".
  2. Please make sure that, for English, more than one octave is plural as in "octaves" for "plus two octaves"

I haven't yet tested keys other than C major. I did test chromatic, and some of the results are unexpected, but I suspect that has to do with the note names we are giving it not with the way we are measuring them, so I don't expect you to resolve that in this ticket (but I thought worth mentioning).

@Aman1919
Copy link
Contributor Author

@pikurasa could u review the changes ?

I tested it just now via current-interval-test.zip, and the results are pretty good so far.

Two things I noticed:

  1. When going below, it is doing the wrong thing. The result of measuring Do4 to Ti3, for example, should be "Minor second below" (right now it is "Major seventh, one octave below". Do4 to La3 should be "Minor third below". FWIW, when it gets to Do4 and Do3, it is correctly displaying "one octave below".
  2. Please make sure that, for English, more than one octave is plural as in "octaves" for "plus two octaves"

I haven't yet tested keys other than C major. I did test chromatic, and some of the results are unexpected, but I suspect that has to do with the note names we are giving it not with the way we are measuring them, so I don't expect you to resolve that in this ticket (but I thought worth mentioning).

@pikurasa ok . I have done changes . It is displaying now

current.interval3.mp4

@pikurasa
Copy link
Collaborator

It works brilliantly, as far as I can tell. It works across different keys as well, which is great.

Would you mind making the following (small) changes to the text (and capitalization) for consistency?

"two octaves above" --> "Two perfect octaves above"

"an octave below" --> "A perfect octave below"

Then, it should be ready for code review by @walterbender

@Aman1919
Copy link
Contributor Author

@walterbender I have done the change . Could you please review the code ?

@pikurasa pikurasa requested a review from walterbender January 26, 2024 19:50
if (index1 > index2) letterGap = NOTENAMES.length - letterGap;

let totalIntervals = this.GetIntervalNumber(turtle);
const numberToStringMap = ['an', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"an" is not going to work well with translation. Please change to "one".

Note that any string that is to be translated needs to be inside _(), e.g., _("two")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@walterbender should i just do this _() to the return value ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to add it to each string. Otherwise they won't be added to the list of strings to translate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done the changes

@Aman1919 Aman1919 requested a review from walterbender January 27, 2024 17:07

if (totalIntervals > 21) {
if (octave >=1) {
lastWord = ", " + _('plus') + " " + os + " " +plural;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after + please.

@walterbender
Copy link
Member

The interval shouldn't depend upon the order of the pitches in the note block:

Screenshot from 2024-01-27 15-12-23
Screenshot from 2024-01-27 15-12-05

@pikurasa
Copy link
Collaborator

The interval shouldn't depend upon the order of the pitches in the note block:

Oh yes, I hadn't seen that behavior. Those should both be minor 3rd (Sol_4 to Mi_4).

@Aman1919
Copy link
Contributor Author

@walterbender did changes for this . I think before it going to above octave . fixed it .

interval2.mp4

@walterbender walterbender merged commit 72dbe4c into sugarlabs:master Jan 28, 2024
3 checks passed
@Aman1919 Aman1919 deleted the nb branch January 28, 2024 17:46
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