Ejemplo n.º 1
0
class Line4(Line3):
    clef = None
    metrical_durations = ID({ # TO DO... mobve this to arrangement?
            8:((1,4),)*4,
            9:((1,4),)*4,
            10:((1,2),(1,4),(1,4),),
            11:((1,4),)*4,
            12:((1,2),(1,4),(1,4),),
            13:((1,2),(1,4),(1,4),),
            14:((1,4),)*4,
            15:((1,4),)*4,
            },
            default=((1,1),), limit=24)
    # metrical_durations = ((1,1),)*8 + ((1,4),)*8 + ((1,2),(1,4),(1,4),) + ((1,4),)*4 + ((1,1),)*13
    rhythm_initial_silence = 30
    rhythm_times=1 # TO DO: ditto as Line3 - do we want to repeat?? (would need to adjust or truncate the end)
    pitch_displacement = machines.FifthDisplacement(
            up      = (2,5,7,9),
            down =      ( 6,8,)
            )
    rhythm_multipliers = Line3.rhythm_multipliers.copy()
    rhythm_multipliers[8] = 0.5
    def update_data(self, **kwargs):
        super().update_data(**kwargs)
        if self.__class__.__name__ == "Line4":
            self.tag_events("darkred", every_child=True)
Ejemplo n.º 2
0
class Line3(GenC, machines.RhythmsBroken, gen_b.Line3):
    clef = None
    metrical_durations = ID({
            7:((1,4),)*4,
            8:((1,4),)*4,
            9:((1,2),)*2,
            10:((1,4),)*4,
            12:((1,4),)*2 + ((1,2),),
            },
            default=((1,1),), limit=24)
    # rhythm_initial_silence = 28
    rhythm_initial_silence = 56
    breaks = ID1({
            7:   2,
            10:  -0.5,
            11:  2,
            13:  1,
            }, cyclic=False)
    pitch_respell = "sharps"
    rhythm_times = 1 # TO DO: do we want to repeat?? (would need to adjust or truncate the end)
    pitch_displacement = machines.FifthDisplacement(
            up      = (2,3,4,7,9,10,  17, 27),
            down    = (   5,6,     11)
            )
    respell="sharps"
Ejemplo n.º 3
0
class Gen0(
        object
):  # basic attributes, such as starting time signature, rehearsal mark, etc.
    metrical_durations = ID(default=((4, 4), ), limit=12)
    # tempo_units_per_minute = 48 # TO DO... tempo indication makes everything SLOW... WHY?????
    # tempo_text = "Slow"
    tempo_command = '\\note #"4" #1 = 48'
    # tempo_units_per_minute = 48
    time_signature = (4, 4)
Ejemplo n.º 4
0
class GenB(
        object
):  # basic attributes, such as starting time signature, rehearsal mark, etc.
    metrical_durations = ID({}, default=((3, 4), ), limit=24)
    rehearsal_mark_number = 2
    # tempo_units_per_minute = 72
    start_bar_line = "||"
    time_signature = (3, 4)
    tempo_command = None
Ejemplo n.º 5
0
class Line3(GenD, gen_c.Line3):
    metrical_durations = ID(default=((3,8),(3,8),(3,8),), limit=24)
    rhythm_multipliers = machines.RhythmsMultiplied.make_multipliers(cyclic_start=1, cyclic=False)
    rhythm_multipliers.extend( (1,) + (0.5,1,0.5,1,1,0.5,0.5,1,1) + (1,1,1,1,1,0.5,1,1,3) )
    rhythm_times = 1
    pitch_displacement = gen_c.Line3.pitch_displacement +\
            machines.FifthDisplacement(
                        up = (1,8),
                        down=(   9,17,)
                        )
    pitch_displacement.cycle_me(18, cycle=(-1,-1,-1,1,1,1), times=6)
    rhythm_initial_silence = 49.5

    breaks = ID({ 
                2:  -3,
                4:  -3,
                6:   3,
                8:   1,
                10:   6,
                11:  1,
                15:  1,
                17:  1 
                })
Ejemplo n.º 6
0
class Line5(GenD, gen_c.Line4):
    metrical_durations = ID(default=((9,8),), limit=24)
    metrical_durations.fillme(range(12,24), ((3,8),)*3)
    rhythm_initial_silence = (11*3 + 2) * 3/2
    
    # TO DO... this could be made more readable...
    multiplier_phrase = (0.5,)*2 + (0.25,)*2 + (0.5,) + (0.25,)*4 + (0.5,) + (0.25,)*3 + (0.5,) + (0.25,)*4
    rhythm_multipliers = machines.RhythmsMultiplied.make_multipliers()
    rhythm_multipliers.extend( (1,) + (0.5,)*2 + (0.25,)*2 + multiplier_phrase*2 + (0.5,)*2 )
    
    breaks = ID()
    rhythm_times = 5
    pitch_displacement = machines.FifthDisplacement(
            up =    (1,2,3,4,5,7)
            )
    # pitch_displacement[0] = (-24,) # TEMP USE ... see 2 octaves down for ease-of-viewing only
    respell = "flats"
    def update_data(self, **kwargs):
        super().update_data(**kwargs)
        self.events[7].tag("8va")
        self.events[126].tag("8va!")
        if self.__class__ is Line5:
            self.tag_events("red", every_child=True)
Ejemplo n.º 7
0
class Line4(GenD, gen_c.Line4):
    metrical_durations = ID(default=((3,8),(3,8),(3,8),), limit=24)
    rhythm_times = 3
    rhythm_initial_silence = ((8 * 3) + 2) * 3/2
    # show_data_attr="my_index"
    # show_data_type=machines.SegmentData
    pitch_displacement = gen_c.Line4.pitch_displacement +\
            machines.FifthDisplacement(
                        up=  (8, 19,     24,25,27,        40,  45,47 ),
                        down=(     20,22,        36,37,38,  41,     48, 53),
                        )
    pitch_displacement.cycle_me(55, cycle=(-1,0,1,-1,1,0), times=3)
    breaks = ID1({
            10:  -12.5,
            19:  -3.5,
            # 11:  2,
            # 13:  1,
            }, cyclic=False)
    def update_data(self, **kwargs):
        super().update_data(**kwargs)
Ejemplo n.º 8
0
class Line3(GenB, machines.RhythmsMultiplied, gen_a.Line1):
    clef = "bass"
    # TO DO, use fill here to make this cleaner
    metrical_durations = ID(
        {
            0: ((3, 4), ),
            1: ((3, 4), ),
            2: ((3, 4), ),
            3: ((3, 4), ),
            4: ((3, 4), ),
        },
        default=((1, 4), ) * 3,
        limit=24)
    rhythm_initial_silence = 36

    def update_data(self, **kwargs):
        super().update_data(**kwargs)
        if self.__class__.__name__ == "Line3":
            self.tag_events("darkyellow", every_child=True)
        if self.__class__ is Line3:
            self.events[1].tag("\clef bass")

    # TO DO... this is ugly:
    rhythm_multipliers = machines.RhythmsMultiplied.make_multipliers(
        cyclic=True, cyclic_start=1)
    rhythm_multipliers.extend((
        1,
        0.5,
    ) + (
        0.25,
        0.5,
    ) * 3 + (0.25, 1))
    # print(rhythm_multipliers)
    # rhythm_multipliers += {
    #     10: 0.5
    # }
    pitch_displacement = machines.FifthDisplacement(
        up=(22, 52, 53, 54),
        down=(1, 19, 26, 38, 46),
    )
    rhythm_times = 2
Ejemplo n.º 9
0
class Line1(Gen0, machines.PitchedLine):
    # time_signature = (4,4)
    # HERE is for testing purposes:
    # class Line1(
    #             machines.RhythmsPulsed,
    #             machines.PitchesReverse,
    #             machines.RhythmsReverse,
    #             machines.RhythmsBroken,
    #             machines.RhythmsMultiplied,
    #             machines.ArrangeAttachments,
    #             machines.Pitches,
    #             machines.Rhythms,
    #             machines.SegmentedLine,
    #             ):

    metrical_durations = ID({}, default=((1, 1), ), limit=12)
    rhythm_initial_silence = 12
    rhythm_times = 1
    rhythm_sequence = ID1({5: 1, 6: 2, 9: 1}, default=0, limit=10)
    pitch_sequence = ID1(
        {
            2: 1,
            4: 2,
            5: 2,
            8: 1,
            9: 2,

            # TRYING MODE CHANGES...
            # 2:1,
            # 4:2,
            # 5:2,
            # # 6:3,
            # 7:3,
            # 8:4,
            # 9:5
        },
        default=0,
        limit=10)

    # ------------------------------------------------------------------------------------------
    # # show_data_type=machines.SegmentData
    # show_data_attr="original_depthwise_index"
    # ------------------------------------------------------------------------------------------
    # ------------------------------------------------------------------------------------------
    # # UNCOMMENT FOR TESTING PURPOSES:
    # metrical_durations = ID({
    #     3:((1,2),(1,2),)
    #     }, default=((1,1),), limit=24)
    # rhythm_multipliers=machines.RhythmsMultiplied.make_multipliers({1:0.5,2:4})
    # rhythm_times=1
    # rhythm_reverse=(3,)
    # pitch_reverse=(4,)
    # breaks = ID1({
    #     1: 0.5,
    #     3: -1.5,
    #     4: -4
    #     })
    # rhythm_pulses = ID({
    #     2:1,
    #     3:0.5,
    #     }, limit=10)
    # def update_data(self, **kwargs):
    #     super().update_data(**kwargs)
    #     # self.events[1].tag("(")self.events[2].tag("mf")
    #     # self.events[3].tag(")")
    #     self.events[1].tag("\<")
    #     self.events[2].tag("\!")
    #     self.events[2].tag("mf")
    #     self.events[2].tag("(")
    #     self.events[2].tag("\>")
    #     self.events[4].tag("\!",")")

    # -------------------------------------------------------------------------------------------------
    def update_data(self, **kwargs):
        super().update_data(**kwargs)
        if self.__class__.__name__ == "Line1":
            self.tag_events("darkmagenta", every_child=True)
Ejemplo n.º 10
0
class GenD(object):
    time_signature = (9,8)
    metrical_durations = ID(default=((6,8),(3,8),), limit=24)
    rehearsal_mark_number = 4
    tempo_command = '\\note #"1" #1 = \\note #"2." #1 + \\note #"4." #1 (\\note #"4." #1 = 72)'
    start_bar_line = "||"
Ejemplo n.º 11
0
class Drone0(GenD, machines.Drone0):
    rhythm_sequence = ID(default=1, limit=12)
    rhythm_initial_silence = 4.5
    initial_dynamic = "p"
    middle_dynamic = "mf"
    end_dynamic = "p"
Ejemplo n.º 12
0
class GenC(object):
    time_signature = (4,4)
    metrical_durations = ID(default=((1,1),), limit=24)
    rehearsal_mark_number = 3
    start_bar_line = "||"
    tempo_command = '\\note #"2." #1 = \\note #"1" #1 (\\note #"4" #1 = 96)'
Ejemplo n.º 13
0
class Drone0(GenB, machines.Drone0):
    rhythm_sequence = ID(default=1, limit=10)
    rhythm_initial_silence = 3
    initial_dynamic = "p"
    end_dynamic = "p"