コード例 #1
0
    def test_TestScaleName(self):
        F = ScaleGtr(ScaleFromName(root='F#', mode='Ionian'))
        F.customtuning(['E', 'A', 'D', 'G', 'B', 'E'])
        F.pathname('img/TestScaleName.svg')
        F.theme(show_note_name=True)
        F.draw()

        with open(path + 'TestScaleName.svg', 'r') as f:
            file = f.read()
            self.assertEqual(
                F.dwg.tostring(),
                file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
コード例 #2
0
ファイル: test_scalegtr.py プロジェクト: janzhen/fretboardgtr
    def test_write_nut(self):
        F=ScaleGtr(scale=["G","A","B","C","D","E","F#"],root="G")
        F.customtuning(['E','A','D','G','B','E'])
        F.pathname(path+"nut.svg")
        F.emptybox()
        F.nut()

        """ F.dwg.save() """

        with open(path+'nut.svg','r') as f:
            file=f.read()
            self.assertEqual(F.dwg.tostring(),file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
コード例 #3
0
    def test_scale_no_color(self):
        F = ScaleGtr(scale=["G", "A", "B", "C", "D", "E", "F#"], root="G")
        F.customtuning(['E', 'A', 'D', 'G', 'B', 'E'])
        F.theme(show_note_name=True, color_scale=False)
        F.pathname('img/scale_no_color.svg')
        F.draw()

        with open(path + 'scale_no_color.svg', 'r') as f:
            file = f.read()
            self.assertEqual(
                F.dwg.tostring(),
                file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
コード例 #4
0
    def test_TestScaleNameEnhar(self):
        F = ScaleGtr(scale=['D#', 'F', 'G', 'G#', 'A#', 'C', 'D'],
                     root='D#',
                     enharmonic=True)
        F.customtuning(['D', 'A', 'D', 'G', 'B', 'E'])
        F.pathname('img/TestScaleNameEnhar.svg')
        F.theme(show_note_name=True)
        F.draw()

        with open(path + 'TestScaleNameEnhar.svg', 'r') as f:
            file = f.read()
            self.assertEqual(
                F.dwg.tostring(),
                file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
コード例 #5
0
    def test_TestChordName(self):
        F = ScaleGtr(ChordFromName(root='C', quality='M'))
        F.customtuning(['D', 'A', 'D', 'G', 'A', 'D'])
        F.pathname('img/TestChordName.svg')
        F.draw()

        with open(path + 'TestChordName.svg', 'r') as f:
            file = f.read()
            self.assertEqual(
                F.dwg.tostring(),
                file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
コード例 #6
0
from fretboardgtr.fretboardgtr import FretBoardGtr
from fretboardgtr.scalegtr import ScaleGtr, ChordFromName, ScaleFromName
from fretboardgtr.chordgtr import ChordGtr
""" , ChordGtr,ScaleFromName,ChordFromName """

F = ScaleGtr(scale=["G", "A", "B", "C", "D", "E", "F#"], root="G")
F.customtuning(['E', 'A', 'D', 'G', 'B', 'E'])
F.pathname('img/scale_degree_name.svg')
F.draw()
F.save()

F = ScaleGtr(scale=["G", "A", "B", "C", "D", "E", "F#"], root="G")
F.customtuning(['E', 'A', 'D', 'G', 'B', 'E'])
F.theme(show_note_name=True, color_scale=False)
F.pathname('img/scale_no_color.svg')
F.draw()
F.save()

F = ScaleGtr(scale=["G", "A", "B", "C", "D", "E", "F#"], root="G")
F.customtuning(['E', 'A', 'D', 'G', 'B', 'E'])
F.theme(show_note_name=True)
F.theme(open_color_scale=True, string_size=3, default_theme=True)
F.pathname('img/scale_note_name.svg')
F.draw()
F.save()

F = ScaleGtr(ScaleFromName(root='F#', mode='Ionian'))
F.customtuning(['E', 'A', 'D', 'G', 'B', 'E'])
F.pathname('img/TestScaleName.svg')
F.theme(show_note_name=True)
F.draw()
コード例 #7
0
ファイル: test_scalegtr.py プロジェクト: janzhen/fretboardgtr
    def test_backgroundfill(self):
        F=ScaleGtr(scale=["G","A","B","C","D","E","F#"],root="G")
        F.customtuning(['E','A','D','G','B','E'])
        F.background_color='rgb(0,0,0)'
        F.pathname(path+"background.svg")
        F.emptybox()
        F.background_fill()

        """ F.dwg.save() """

        with open(path+'background.svg','r') as f:
            file=f.read()
            self.assertEqual(F.dwg.tostring(),file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
コード例 #8
0
ファイル: test_scalegtr.py プロジェクト: janzhen/fretboardgtr
    def test_draw(self):
        F=ScaleGtr(scale=["G","A","B","C","D","E","F#"],root="G")
        F.customtuning(['E','A','D','G','B','E'])
        F.theme(show_note_name=True)
        F.theme(open_color_scale=True,string_size=3,default_theme=True)
        F.pathname(path+"draw.svg")
        F.draw()
        """ F.dwg.save() """

        with open(path+'draw.svg','r') as f:
            file=f.read()
            self.assertEqual(F.dwg.tostring(),file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])