How to use birdears - 10 common examples

To help you get started, we’ve selected a few birdears examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iacchus / birdears / tests / test_basic.py View on Github external
def test_sequenceclass_chords():

    c4 = Pitch('C', 4)
    e4 = Pitch('E', 4)
    g4 = Pitch('G', 4)
    b4 = Pitch('B', 4)
    d5 = Pitch('D', 5)

    sequence = Sequence([Chord([c4, e4, g4]), Chord([b4, b4, d5]),
                        Chord([c4, e4, g4])])

    sequence.play()

    assert(sequence)
github iacchus / birdears / tests / test_basic.py View on Github external
def test_intervalclass():

    a5 = Pitch('A', 5)
    c3 = Pitch('C', 3)

    a = Interval(a5, c3)

    assert(a)
github iacchus / birdears / tests / test_basic.py View on Github external
def test_sequenceclass_chords():

    c4 = Pitch('C', 4)
    e4 = Pitch('E', 4)
    g4 = Pitch('G', 4)
    b4 = Pitch('B', 4)
    d5 = Pitch('D', 5)

    sequence = Sequence([Chord([c4, e4, g4]), Chord([b4, b4, d5]),
                        Chord([c4, e4, g4])])

    sequence.play()

    assert(sequence)
github iacchus / birdears / tests / test_basic.py View on Github external
def test_sequenceclass_append():

    sequence = Sequence([Pitch('C', 3)])
    sequence.append(Chord([Pitch('C', 4), Pitch('D', 4), Pitch('E', 4)]))

    assert(sequence)
github iacchus / birdears / tests / test_basic.py View on Github external
def test_sequenceclass_notes():

    c4 = Pitch('C', 4)
    d4 = Pitch('D', 4)
    e4 = Pitch('E', 4)

    # sequence = Sequence(['C4', 'D4', 'E4'])

    sequence = Sequence([c4, d4, e4])
    sequence.play()

    assert(sequence)
github iacchus / birdears / tests / test_basic.py View on Github external
def test_sequenceclass_append():

    sequence = Sequence([Pitch('C', 3)])
    sequence.append(Chord([Pitch('C', 4), Pitch('D', 4), Pitch('E', 4)]))

    assert(sequence)
github iacchus / birdears / tests / test_basic.py View on Github external
def test_sequenceclass_extend():
    sequence = Sequence([Pitch('C', 3)])
    sequence.extend(Chord([Pitch('C', 4), Pitch('D', 4), Pitch('E', 4)]))

    assert(sequence)
github iacchus / birdears / tests / test_basic.py View on Github external
def test_chromaticscale_gettriad():

    a = ChromaticScale(tonic='C')
    b = a.get_triad(mode='major', degree=7)
    assert(b)
github iacchus / birdears / birdears / urwid / display_common.py View on Github external
"""
        basic = AttrSpec(foreground, background, 16)

        if type(mono) == tuple:
            # old style of specifying mono attributes was to put them
            # in a tuple.  convert to comma-separated string
            mono = ",".join(mono)
        if mono is None:
            mono = DEFAULT
        mono = AttrSpec(mono, DEFAULT, 1)

        if foreground_high is None:
            foreground_high = foreground
        if background_high is None:
            background_high = background
        high_256 = AttrSpec(foreground_high, background_high, 256)

        # 'hX' where X > 15 are different in 88/256 color, use
        # basic colors for 88-color mode if high colors are specified
        # in this way (also avoids crash when X > 87)
        def large_h(desc):
            if not desc.startswith('h'):
                return False
            if ',' in desc:
            	desc = desc.split(',',1)[0]
            num = int(desc[1:], 10)
            return num > 15
        if large_h(foreground_high) or large_h(background_high):
            high_88 = basic
        else:
            high_88 = AttrSpec(foreground_high, background_high, 88)
github iacchus / birdears / birdears / urwid / display_common.py View on Github external
high_256 = AttrSpec(foreground_high, background_high, 256)

        # 'hX' where X > 15 are different in 88/256 color, use
        # basic colors for 88-color mode if high colors are specified
        # in this way (also avoids crash when X > 87)
        def large_h(desc):
            if not desc.startswith('h'):
                return False
            if ',' in desc:
            	desc = desc.split(',',1)[0]
            num = int(desc[1:], 10)
            return num > 15
        if large_h(foreground_high) or large_h(background_high):
            high_88 = basic
        else:
            high_88 = AttrSpec(foreground_high, background_high, 88)

        signals.emit_signal(self, UPDATE_PALETTE_ENTRY,
            name, basic, mono, high_88, high_256)
        self._palette[name] = (basic, mono, high_88, high_256)