def illumination_02(): part = ppfs[0][2] part = list(sorted(part)) contour = RC(4, 3) | RC(4, 3) deletions = [] deletions.append((28, [16, 17, 18, 19])) deletions.append((28, [0, 1, 6, 7, 12, 13])) deletions = sievetools.cycle_tokens_to_sieve(*deletions) extrusions = [] cycle = [] cycle.append((80, [24, 36, 48, 60, 72])) cycle = sievetools.cycle_tokens_to_sieve(*cycle) function = lambda x: list(calligraphs.cycle_forward(x, 2)) #extrusions.append(calligraphs.ExtrusionToken(cycle, 2, function)) cycle = [] cycle.append((80, [52, 65])) cycle = sievetools.cycle_tokens_to_sieve(*cycle) function = lambda x: list(calligraphs.cycle_forward(x, 4)) #extrusions.append(calligraphs.ExtrusionToken(cycle, 2, function)) number = 2 reading = calligraphs.sacred_reading(part, contour, deletions, *extrusions) return reading, number
def illumination_01(): # 1-1 and 1-2 part = ppfs[0][0] + ppfs[0][1] part = list(sorted(part)) contour = RC(2, 0) | RC(2, 0) deletions = [] deletions.append((14, [10, 11, 12, 13])) deletions.append((28, [16, 17, 18, 19])) deletions = sievetools.cycle_tokens_to_sieve(*deletions) #deletions = None extrusions = [] cycle = [] cycle.append((80, [24, 36, 48, 60, 72])) cycle = sievetools.cycle_tokens_to_sieve(*cycle) function = lambda x: list(calligraphs.cycle_forward(x, 2)) #extrusions.append(calligraphs.ExtrusionToken(cycle, 2, function)) cycle = [] cycle.append((80, [52, 65])) cycle = sievetools.cycle_tokens_to_sieve(*cycle) function = lambda x: list(calligraphs.cycle_forward(x, 4)) #extrusions.append(calligraphs.ExtrusionToken(cycle, 2, function)) reading = calligraphs.sacred_reading(part, contour, deletions, *extrusions) number = 1 return reading, number
def sacred_reading_1(pitch_numbers, duration): from desir import calligraphs # contour_sieve = abjad.sievetools.ResidueClass(7, 2) | abjad.sievetools.ResidueClass(7, 6) # contour_sieve = abjad.sievetools.ResidueClass(4, 3) | abjad.sievetools.ResidueClass(4, 3) # contour_sieve = None contour_sieve = 6 deletion_sieve = abjad.sievetools.ResidueClass(7, 1) | abjad.sievetools.ResidueClass(7, 2) # deletion_sieve = None cycle = abjad.sievetools.ResidueClass(9, 0) | abjad.sievetools.ResidueClass(9, 0) length = 4 function = lambda x: list(calligraphs.undulate_backward(x, 4)) extrusion_1 = calligraphs.ExtrusionToken(cycle, length, function) cycle = abjad.sievetools.ResidueClass(7, 0) | abjad.sievetools.ResidueClass(7, 0) length = 2 function = lambda x: list(calligraphs.cycle_forward(x, 4)) extrusion_2 = calligraphs.ExtrusionToken(cycle, length, function) # pitch_numbers = calligraphs.sacred_reading(pitch_numbers, # contour_sieve, deletion_sieve, extrusion_1) pitch_numbers = calligraphs.sacred_reading(pitch_numbers, contour_sieve, deletion_sieve, extrusion_1, extrusion_2) # print(pitch_numbers) pitch_numbers = sequencetools.flatten_sequence(pitch_numbers) pitch_numbers = [x for x in pitch_numbers if x is not None] pitch_numbers = Sequence(pitch_numbers) message = "pitches are repetition-free: {}" message = message.format(pitch_numbers.is_repetition_free()) print(message) notes = construct.notes(pitch_numbers, [duration]) label = "sacred reading 1" notes[0].markup.up.append(Markup(label)) return notes