def test_emptybox(self): F=ScaleGtr(scale=["G","A","B","C","D","E","F#"],root="G") F.customtuning(['E','A','D','G','B','E']) F.pathname(path+"emptybox.svg") F.emptybox() """ F.dwg.save() """ with open(path+'emptybox.svg','r') as f: file=f.read() self.assertEqual(F.dwg.tostring(),file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
def test_scale_degree_name(self): 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() with open(path + 'scale_degree_name.svg', 'r') as f: file = f.read() self.assertEqual( F.dwg.tostring(), file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
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])
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])
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])
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])
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()