sugarlabs / musicblocks

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

silence block collapse issue #3859

Closed walterbender closed 5 months ago

walterbender commented 5 months ago

Description

Screenshot from 2024-04-12 10-46-52

Expected Behavior

The "undefined" should not be there

How to Reproduce

Drag a silent note (rest) off of the Note Values palette and collapse it.

Checklist


Thank you for contributing to our project! We appreciate your help in improving it.

πŸ“š See contributing instructions.

πŸ™‹πŸΎπŸ™‹πŸΌ Questions: Community Matrix Server.

Ashish020202 commented 5 months ago

@walterbender in my case after collapse it looks like this

image

walterbender commented 5 months ago

That is a different somewhat unrelated bug. Sometimes the shape bounding box doesn't seem to update properly.

Ashish020202 commented 5 months ago

yes, it seems to be, maybe another ticket for this. when I choose 1/8 then undefined is there but in the case of 1/4 it is right?? I checked with other values as well I think only in the case of 1/8 there is an issue.

image

walterbender commented 5 months ago

I haven't looked at the code yet, but I suspect from your analysis that it is a problem with the 1/8 note rest symbol.

Mubashirshariq commented 5 months ago

for 1/16 also i am getting undefined Screenshot from 2024-04-13 21-10-45

walterbender commented 5 months ago

The problem is in musicutils.js there are no symbols defined for 1/8 and 1/16 rests. If there are no such symbols, we should use "".

walterbender commented 5 months ago

There are unicode symbols for those rest values so we should use them. 1/8 rest: "𝄾" 1/16 rest: "𝄿"

khadar1020 commented 5 months ago

Is this correct sir @walterbender Screenshot (1026)

Thank you

walterbender commented 5 months ago

If/when we add more symbols to the NSYMBOLS list, we need to add corresponding symbols to the RSYMBOLS list. but I think we really don't need those uncommon symbols.