sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
554 stars 752 forks source link

print current interval #2209

Open pikurasa opened 4 years ago

pikurasa commented 4 years ago

It would be nice to be able to "print current interval".

There seems to be no way to display such information.

For example, I would like to add "print current interval" to the following code:

Screenshot at 2020-04-07 15:36:46 scale with stable pitch -- oblique motion

The result would be to print the following on the screen:

Perfect Unison Major Second Major Third Perfect Fourth Perfect Fifth Major Sixth Major Seventh Perfect Octave

For chords with more than two notes, we may try to concatenate information (e.g. "Major Third and Minor Third and Perfect Fifth" for Do, Mi, Sol). Obviously more complex chords would have too much information.

**As for Status widget, we have an opportunity to display the information in a more intuitive way. We could display the information 2D geometrically. I will sketch that out later, but basically it would have points for each played pitch with lines connecting all simultaneous pitches and labels on those lines for the resulting intervals.

(At the top, we could display the chord name too, I suppose, but that could get tricky since the naming has a lot to do with the chord's function within the progression.)

abdul7oss commented 1 year ago

Please assign this issue to me

Vivekk-11 commented 1 year ago

"Print" as in print in console?

pikurasa commented 1 year ago

@abdul7oss @vivekvc14

Basically, we want something like this to work:

Screenshot at 2023-02-02 19:45:52

@walterbender is this still a "good first issue?"

Faizan711 commented 1 year ago

Is this issue still open, if so i would like to be assigned to work on it.

walterbender commented 1 year ago

@Faizan711 Perhaps you can find Devin and me on Matrix and we can discuss the details? (Much of the glue is in place, but the actual calculation of the interval in the current implementation is not what Devin needs.

Faizan711 commented 1 year ago

I didn't understand what do you mean by "find me and devin on Matrix"??

walterbender commented 1 year ago

Please refer to https://github.com/sugarlabs/sugar-docs/blob/master/src/contact.md

Simran180 commented 1 year ago

I would like to work on this issue , if it is not assigned yet can you please assign it to me

walterbender commented 1 year ago

@Simran180 we don't assign issues, but we do accept PRs.

SuryanshBisht commented 1 year ago

From what I have understood, in this issue we basically need to create a block "print current interval" similar to "print interval number" just here we need it to print the name of the interval instead of interval number. For eg. print current interval will print "Minor third" when print interval number prints "3". Can I get an example of how chords with more than 2 notes are implemented in music blocks. And what is needed to be done with status widget?

walterbender commented 1 year ago

The problem with the current implementation is that it doesn't calculate the interval properly. (Well it does, if you use an interval block, but not if you define the interval with multiple pitch blocks.) I think it should return a number, not the name. We can convert the number to a name in a separate step.

pikurasa commented 1 year ago

I think it should return a number, not the name. We can convert the number to a name in a separate step.

I agree that we can start with the number first.

In the above example, the results would be:

0,2,4,5,7,9,11,12

...which, as written above, would be put in musical terminology as:

Perfect Unison
Major Second
Major Third
Perfect Fourth
Perfect Fifth
Major Sixth
Major Seventh
Perfect Octave

This terminology describes intervals as: Quality, Interval, which gives someone enough information to figure out the pitches regardless of whether they have been given the name of the key/mode.