Questions on scamp.performance.Performance.to_score

Hi, I’ve been recently trying to imitate your work in The Great Rhythm Work video, and I have a problem with displaying scores. Since the notation of indispensability (2 * 3 * 2) would be a time signature 6/8, I thought it should print it, but the error occurred.

from scamp_extensions.rhythm import indispensability_array_from_expression
from scamp_extensions.utilities import remap
from scamp import *

indispensibilities = indispensability_array_from_expression(
    "2 * 3 * 2", normalize=True)

MIN_SUBDIVISION_LENGTH = 0.3

s = Session(tempo=120)

# s.print_default_soundfont_presets()

perc = s.new_part("piano")

indispensibility_range = {
    54: (0.9, 1.0),
    61: (0.7, 1.0),
    49: (0.0, 0.7),
    54: (0.4, 0.7)
}

s.start_transcribing()

for i in range(4):
    for indisp in indispensibilities:
        for which_sample, indisp_play_range in indispensibility_range.items():
            if indisp_play_range[0] <= indisp <= indisp_play_range[1]:
                perc.play_note(which_sample,
                               remap(indisp, 0.5, 1.0, *
                                     indisp_play_range) ** 1.5,
                               MIN_SUBDIVISION_LENGTH, blocking=False)
        wait(MIN_SUBDIVISION_LENGTH)

s.stop_transcribing().to_score(time_signature="6/8").show()

And the error looks like this.

abjad.exceptions.AssignabilityError: not assignable duration: Duration(1, 12).

It only works well with 4/4. Due to my lack of knowledge, I have no idea why this error came out. Can anyone help me?

That error suggests some sort of corner case that is breaking my quantization system. I’ll have to look into it!

That said, the reason that you’re running into a corner case is because you’re using an unusual note duration of 0.3 (your MIN_SUBDIVISION_LENGTH). If you change it to 0.5 (and perhaps compensate by making the tempo 120 * 5/3 = 200) then the notation turns out fine.

1 Like