From 57bbc0ef4e326d5ea7d8d2e1ac07d26b66bef1af Mon Sep 17 00:00:00 2001 From: acidvegas Date: Sat, 20 Jan 2024 20:48:05 -0500 Subject: [PATCH] Updated mirrors and LICENSE --- LICENSE | 2 +- README.md | 8 +++----- mzk/functions.py | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/LICENSE b/LICENSE index 4c8b212..54ec6ab 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2021, acidvegas +Copyright (c) 2024, acidvegas 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 index bb578b1..73fcfc4 100644 --- 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 index 1b0b001..6f0f2d9 100644 --- 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