I currently have the following lists:
counter = [13] instruments = ['3\t ---', '2\t / \\', '1\t / \\', '0\t--- \\ ---', '-1\t \\ /', '-2\t \\ /', '-3\t ---'] score = ['|*************|']
What I'm trying to do is replace the symbols in the tool list with symbols from the list of points (excluding | ).
I am currently having the following issues.
Characters are replaced row by row, not column by column.
Tool List:
3 --- 2 / \ 1 / \ 0 --- \ --- -1 \ / -2 \ / -3 ---
List of points:
|*************|
EXPECTED OUTPUT:
3 *** 2 * * 1 * * 0 *** * -1 * -2 * -3
Current output:
3 *** 2 * * 1 * * 0 *** * ** -1 -2 -3
Here's how I replace characters in the instruments list now:
for elements in counter: current_counter = elements count = 0 for elements in instrument_wave: amplitude, form = elements.split('\t') for characters in form: if characters in ['-', '/', '\\']: form = form.replace(characters, '*', 1) count += 1 if count == current_counter: break for characters in form: if characters in ['-', '/', '\\']: form = form.replace(characters, '') if '-' not in amplitude: amplitude = ' ' + amplitude new_wave = amplitude + "\t" + form waveform.append(new_wave)
Any help would be appreciated, especially as to how I should correct my replacement character to make it go column-wise rather than row-wise.