From d4b2f163f73872a6167fee0fa36758d7be75a5fc Mon Sep 17 00:00:00 2001 From: Andrew Zimolzak Date: Tue, 23 Dec 2014 13:20:19 -0500 Subject: [PATCH] search for specific chords --- .gitignore | 50 -------------------------------------------------- ukulele.py | 11 ++++++++++- 2 files changed, 10 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index 51cbe85..1d60f4e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,53 +2,3 @@ __pycache__/ *.py[cod] -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -bin/ -build/ -develop-eggs/ -dist/ -eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml - -# Translations -*.mo - -# Mr Developer -.mr.developer.cfg -.project -.pydevproject - -# Rope -.ropeproject - -# Django stuff: -*.log -*.pot - -# Sphinx documentation -docs/_build/ - diff --git a/ukulele.py b/ukulele.py index a5c0d0d..4948097 100755 --- a/ukulele.py +++ b/ukulele.py @@ -79,9 +79,18 @@ def print_short(self): #### main loop +find_these = None +find_these = ['A#maj7', 'A#7', 'D#', 'D', 'Gm7', 'C7', 'F7sus', 'D#maj7', 'Daug'] # comment out if no search + for f in product(range(0,Maxfret+1), repeat=len(Tuning)): c = Chord(f) - c.print_short() + if find_these == None: + c.print_short() # print all + else: + if c.root != None: + for findme in find_these: + if ''.join([c.root, c.chordtype]) == findme: + c.print_short() #### tests