mzk

- music theory helper
git clone git://git.acid.vegas/mzk.git
Log | Files | Refs | Archive | README | LICENSE

commit 57bbc0ef4e326d5ea7d8d2e1ac07d26b66bef1af
parent 385132b9e25d3babf890b8f6f35f96b59e1b8913
Author: acidvegas <acid.vegas@acid.vegas>
Date: Sat, 20 Jan 2024 20:48:05 -0500

Updated mirrors and LICENSE

Diffstat:
MLICENSE | 2+-
MREADME.md | 10++++------
Mmzk/functions.py | 26+++++++++++++-------------

3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/LICENSE b/LICENSE
@@ -1,6 +1,6 @@
 ISC License
 
-Copyright (c) 2021, acidvegas <acid.vegas@acid.vegas>
+Copyright (c) 2024, acidvegas <acid.vegas@acid.vegas>
 
 Permission to use, copy, modify, and/or distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
diff --git a/README.md b/README.md
@@ -26,8 +26,6 @@ Using the root of C, we can apply the pattern of the major scale to the C chroma
 * Color support for windows
 * Scale/chord ASCII coloring
 
-## Mirrors
-- [acid.vegas](https://git.acid.vegas/mzk)
-- [GitHub](https://github.com/acidvegas/mzk)
-- [GitLab](https://gitlab.com/acidvegas/mzk)
-- [SuperNETs](https://git.supernets.org/acidvegas/mzk)
-\ No newline at end of file
+___
+
+###### Mirrors for this repository: [acid.vegas](https://git.acid.vegas/mzk) • [SuperNETs](https://git.supernets.org/acidvegas/mzk) • [GitHub](https://github.com/acidvegas/mzk) • [GitLab](https://gitlab.com/acidvegas/mzk) • [Codeberg](https://codeberg.org/acidvegas/mzk)
+\ No newline at end of file
diff --git a/mzk/functions.py b/mzk/functions.py
@@ -42,6 +42,19 @@ def chord_notes(type, key):
 			_notes.append(notes[int(step)-1])
 	return _notes
 
+def print_scale(root, type, full=False, chord=False):
+	frets = (24,147) if full else (12,75)
+	print(f'{root.upper()} {type.upper()} SCALE'.center(frets[1]))
+	print('  ┌' + '┬'.join('─'*5 for x in range(frets[0])) + '┐')
+	print('0 │' + '│'.join(str(x).center(5) for x in range(1,frets[0]+1)) + '│')
+	print('  ├' + '┼'.join('─'*5 for x in range(frets[0])) + '┤')
+	notes = chord_notes(type, root) if chord else scale_notes(type, root)
+	for string in ('eBGDAE'):
+		string_notes = generate_scale_string(string, notes, full)
+		print(string + ' │' + '│'.join(note.center(5, '-') for note in string_notes[1:]) + '│')
+	print('  └' + '┴'.join('─'*5 for x in range(frets[0])) + '┘')
+	print((', '.join(notes) + ' / ' + get_pattern(constants.scales[type])).rjust(frets[1]))
+
 def scale_notes(type, key):
 	last = 0
 	all_notes = chromatic_scale(key)*2
@@ -160,19 +173,6 @@ def print_intervals():
 	print('└───────────┴────────────────────┴───────┘')
 	print(print_intervals.__doc__)
 
-def print_scale(root, type, full=False, chord=False):
-	frets = (24,147) if full else (12,75)
-	print(f'{root.upper()} {type.upper()} SCALE'.center(frets[1]))
-	print('  ┌' + '┬'.join('─'*5 for x in range(frets[0])) + '┐')
-	print('0 │' + '│'.join(str(x).center(5) for x in range(1,frets[0]+1)) + '│')
-	print('  ├' + '┼'.join('─'*5 for x in range(frets[0])) + '┤')
-	notes = chord_notes(type, root) if chord else scale_notes(type, root)
-	for string in ('eBGDAE'):
-		string_notes = generate_scale_string(string, notes, full)
-		print(string + ' │' + '│'.join(note.center(5, '-') for note in string_notes[1:]) + '│')
-	print('  └' + '┴'.join('─'*5 for x in range(frets[0])) + '┘')
-	print((', '.join(notes) + ' / ' + get_pattern(constants.scales[type])).rjust(frets[1]))
-
 def print_scales():
 	'''definition:
 		any set of musical notes ordered by fundamental frequency or pitch