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

Note Counter and Sum Note Values #1891

Closed
pikurasa opened this issue Nov 5, 2019 · 6 comments
Closed

Note Counter and Sum Note Values #1891

pikurasa opened this issue Nov 5, 2019 · 6 comments

Comments

@pikurasa
Copy link
Collaborator

pikurasa commented Nov 5, 2019

Our current Note Counter does not "count the number of notes contained", which is what its name suggests. Rather, it sums the total note values contained and produces two values as a summed note value.

This is a handy tool, but it should be named something like "Sum Note Values". (The Japanese translation suggests the meaning of the latter.)

It would also be handy to be able to just count how many note blocks are contained within a particular section. I was trying to do something with heap and random to the following effect:

Note-Counter-as-Note-Counter.html.zip

Screenshot at 2019-11-05 15:39:11 Note-Counter

@pikurasa
Copy link
Collaborator Author

pikurasa commented Nov 5, 2019

(*Second note should be eighth note -- sorry)

@b18050
Copy link
Contributor

b18050 commented Feb 9, 2020

With the new block api, the label of the block is not changed to 'sum note values'. @walterbender .

@b18050
Copy link
Contributor

b18050 commented Feb 10, 2020

@walterbender I want to add the note counter block (which counts number of note blocks). But I cannot find the logic . So , what should I do to derive the logic to count note blocks.
P.S.- I looked the logic of notecounter in js/logo.js. Not so helpful for me

@walterbender
Copy link
Member

It is not completely obvious how to do this. The way that the current logic works is to take advantage of the fact that we track the duration of the notes. We'd have to start tracking the number of notes played as well. Then the same logic would apply: a = the number of notes played up until now; b = the number of notes played after the notes to be counted have been played (with the "just counting flag set"). The result we return is b - a.

@walterbender walterbender modified the milestones: GCI 2019, future Feb 10, 2020
@b18050
Copy link
Contributor

b18050 commented Feb 11, 2020

@walterbender What is the use of these two blocks?
notesplayed

@walterbender
Copy link
Member

whole notes played returns the number of notes played (in units of whole notes). notes played lets you specify the units.

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

No branches or pull requests

4 participants