def get_score():
    treble_pattern = Staff()
    chords = Staff(context_name='ChordNames')

    for key in sideman.keys_in_fifths():
        jazz_scale = sideman.JazzScale(key)
        pattern_measure = get_pattern8(jazz_scale)
        chord_measure = get_pattern8_chord_measure(jazz_scale)
        treble_pattern.append(pattern_measure)
        chords.append(chord_measure)

    # Merge all the pairs of 2/4 measures into 4/4 measures

    # TODO: Can probably just put a loop over both staves...

    staves = [chords, treble_pattern]
    for staff in staves:
        parts = sequencetools.partition_sequence_by_counts(staff[:], [2],
                                                           cyclic=True)
        for part in parts:
            mutate(part).fuse()

    tempo = Tempo(Duration(1, 4), (100, 138))
    attach(tempo, treble_pattern)
    score = Score([chords, treble_pattern])
    return score
def get_score():
    treble_pattern = Staff()
    chords = Staff(context_name='ChordNames')

    for key in sideman.keys_in_fifths():
        scale = sideman.JazzScale(key)
        pattern_measure = get_pattern_n77(scale)
        chord_measure = get_pattern_n77_chords(scale)
        treble_pattern.append(pattern_measure)
        chords.append(chord_measure)

    mutate(treble_pattern[:]).split([(4, 4)], cyclic=True)
    #mutate(chords[:]).split([(4, 4)], cyclic=True)

    #    staves = [chords, treble_pattern]
    #    for staff in staves:
    #        parts = sequencetools.partition_sequence_by_counts(staff[:], [2], cyclic=True)
    #        for part in parts:
    #            mutate(part).fuse()

    #tempo = Tempo(Duration(1, 4), (100,138))
    tempo = Tempo(Duration(1, 4), 100)

    attach(tempo, treble_pattern)
    score = Score([chords, treble_pattern])
    return score
def get_score():
    treble_pattern = Staff()
    chords = Staff(context_name='ChordNames')
    for key in sideman.keys_in_fifths():
        jazz_scale = sideman.JazzScale(key)
        treble_pattern.append(get_pattern15(jazz_scale))
        chords.append(get_pattern15_chord_measure(jazz_scale))
    score = Score([chords, treble_pattern])
    tempo = Tempo(Duration(1, 4), (138, 192))
    attach(tempo, treble_pattern)
    return score
def get_score():
    treble_pattern = Staff()
    chords = Staff(context_name='ChordNames')

    for key in range(0, 12, 2):
        jazz_scale = sideman.JazzScale(key)
        treble_pattern.append(get_pattern7(jazz_scale))
        chords.append(get_pattern7_chord_measure(jazz_scale))

    score = Score([chords, treble_pattern])
    tempo = Tempo(Duration(1, 4), (100, 138))
    attach(tempo, treble_pattern)
    return score
示例#5
0
def get_score():
    treble_pattern = Staff()
    chords = Staff(context_name='ChordNames')

    for key in sideman.keys_in_order():
        jazz_scale = sideman.JazzScale(key)
        treble_pattern.append(get_pattern6(jazz_scale, key % 2 == 1))
        chords.append(get_pattern6_chord_measure(jazz_scale))

    score = Score([chords, treble_pattern])
    tempo = Tempo(Duration(1, 4), (100, 160))
    attach(tempo, treble_pattern)
    return score
示例#6
0
def get_score():
    treble_pattern = Staff()
    chords = Staff(context_name='ChordNames')

    for key in (0, 3, 6, 9, 5, 8, 11, 2, 10, 1, 4, 7):
        jazz_scale = sideman.JazzScale(key)
        treble_pattern.append(get_pattern4(jazz_scale))
        chords.append(get_pattern4_chord_measure(jazz_scale))

    score = Score([chords, treble_pattern])
    tempo = Tempo(Duration(1, 4), (100, 132))
    attach(tempo, treble_pattern)
    return score
def get_score(key_name):

    # This pattern is computed starting in C (II, V, and I in C).
    # By specifying key_name == 'F", we can transform it accordingly

    bass_pattern = Staff()
    chords = Staff(context_name='ChordNames')
    voicing = Staff()
    for key in sideman.keys_for_ii_v_i_descending():
        scale = sideman.JazzScale(key)
        pattern_measure = get_pattern_ii_v_i(scale)
        chord_measure = get_pattern_ii_v_i_chords(scale)
        voicing_measure = get_pattern_ii_v_i_voicing(scale)
        bass_pattern.append(pattern_measure)
        chords.append(chord_measure)
        voicing.append(voicing_measure)

    if key_name == 'F':
        key_offset = -7
        voice_offset = 12
    else:
        voice_offset = 0
        key_offset = 0

    mutate(voicing).transpose(-12 + key_offset + voice_offset)
    mutate(bass_pattern).transpose(-24 + key_offset)
    mutate(chords).transpose(key_offset)
    clef = Clef('bass')
    attach(clef, bass_pattern)

    mutate(bass_pattern[:]).split([(4, 4)], cyclic=True)
    mutate(voicing[:]).split([(4, 4)], cyclic=True)
    #mutate(chords[:]).split([(4, 4)], cyclic=True)

    tempo = Tempo(Duration(1, 4), 100)

    attach(tempo, bass_pattern)
    score = Score([chords, voicing, bass_pattern])
    return score
#
# Proof of concept for Pattern 13

from abjad import *
import sideman
js = sideman.JazzScale(0)
m = Measure( (8, 4) )
m.append( Note("c'", (1, 2)))
m.append( Note("e'", (1, 8)))
m.append( Note("g'", (1, 4)))
m.append( Note("a'", (1, 8)))
m.append( Note("a'", (4, 4)))
t = spannertools.Tie()
attach(t, m[3:5])
print(t)
staff = Staff()
staff.append(m)
print(staff)
mutate(staff[0:1]).split([Duration(4,4), Duration(4,4)])
print("mutated ",staff)
show(staff)