Dec-07-2019, 01:15 PM
I am making a program that prints a piano-keyboard-diagram on the screen based on the input. I want to use text input using the 'music tracker' standard.
The example below is a basic C chord.
I don't know how to do this(I think this is how to solve the problem):
The conversion table looks like this for only the central octave:
C4=40
c4=41
D4=42
d4=43
E4=44
F4=45
f4=46
G4=47
g4=48
A4=49
a4=50
B4=51
The example below is a basic C chord.
# User input rightNotes = "C4 E4 G4 C5" leftNotes = "C2 C3" # Convert user input to numbers rightHandNumbers = [] # Notes for the right hand leftHandNumbers = [] # Notes for the left handThe rightNotes and leftNotes need to be converted to numbers to rightHandNumbers and leftHandNumbers. The numbers are the piano-key-numbers(1-88). C4=(key)40, E4=44, G4=47, C5=52, C2=16, C3=28
I don't know how to do this(I think this is how to solve the problem):
- Making a function that cuts the rightNotes string by spaces into different values.
- Making a function that converts the separated values into the given numbers.
The conversion table looks like this for only the central octave:
C4=40
c4=41
D4=42
d4=43
E4=44
F4=45
f4=46
G4=47
g4=48
A4=49
a4=50
B4=51