Skip to main content
not sure how I managed to figure out ~b+3 lol. I had 132 bytes earlier
Source Link
12944qwerty
  • 567
  • 2
  • 12

Python 3, 113 110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c,*a=l.index(a),a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -23 bytes.

Try it online!

Python 3, 129 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):b="#"in a;c,*a=l.index(a[:~b+3])+b,a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

This version accepts # keys. Additional 19 bytes :(

Try it online!

Python 3, 113 110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c,*a=l.index(a),a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -2 bytes.

Try it online!

Python 3, 113 110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c,*a=l.index(a),a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -3 bytes.

Try it online!

Python 3, 129 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):b="#"in a;c,*a=l.index(a[:~b+3])+b,a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

This version accepts # keys. Additional 19 bytes :(

Try it online!

mistakes mistakes mistakes
Source Link
12944qwerty
  • 567
  • 2
  • 12

Python 3, 113 110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c,*a=l.index(a),a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -2 bytes.

Try it online!Try it online!

Python 3, 113 110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c,*a=l.index(a),a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -2 bytes.

Try it online!

Python 3, 113 110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c,*a=l.index(a),a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -2 bytes.

Try it online!

oops, didn't use ovs help lol
Source Link
12944qwerty
  • 567
  • 2
  • 12

Python 3, 113 111110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c=lc,*a=l.index(a);a=[a]*2;I=[l[c,a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -2 bytes.

Try it online!

Python 3, 113 111 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c=l.index(a);a=[a]*2;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -2 bytes.

Try it online!

Python 3, 113 110 bytes

l='C Db D Eb E F Gb G Ab A Bb B'.split()
def f(a):c,*a=l.index(a),a,a;I=[l[c-7]];return a*2+I*2+a+[l[c-5]]+I+a

Doesn't accept # ones. Uses flats only.

Thanks to @ovs and @l4m2 for -2 bytes.

Try it online!

added 61 characters in body
Source Link
12944qwerty
  • 567
  • 2
  • 12
Loading
oops, wasn't right... and -1 bytes
Source Link
12944qwerty
  • 567
  • 2
  • 12
Loading
added 44 characters in body
Source Link
12944qwerty
  • 567
  • 2
  • 12
Loading
Source Link
12944qwerty
  • 567
  • 2
  • 12
Loading