-
Notifications
You must be signed in to change notification settings - Fork 784
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
Comments
(*Second note should be eighth note -- sorry) |
With the new block api, the label of the block is not changed to 'sum note values'. @walterbender . |
@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. |
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 What is the use of these two blocks? |
whole notes played returns the number of notes played (in units of whole notes). notes played lets you specify the units. |
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
The text was updated successfully, but these errors were encountered: