Workbench

Generate Notes and Accidentals with Python

all_notes = []
for n in ["C", "D", "E", "F", "G", "A", "B"]:
  if n not in ["C", "F"]:
    all_notes.append(f"{n}b")
  all_notes.append(n)
  if n not in ["B", "E"]:
    all_notes.append(f"{n}#")
print(all_notes)

Results

['C', 'C#', 'Db', 'D', 'D#', 'Eb', 'E', 'F', 'F#', 'Gb', 'G', 'G#', 'Ab', 'A', 'A#', 'Bb', 'B']

Sun Jul 19 2026 20:00:00 GMT-0400 (Eastern Daylight Time)