Skip to main content
oops
Source Link
math scat
  • 9.5k
  • 1
  • 20
  • 83

Vyxal, 27 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online! | 35 bytes if you have to handle flats

Explanation:

\kA7ẎkA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ
kA7Ẏ                           Uppercase alphabets A-H
    :\#ẊY                      Duplicate, take cartesian product with "#", interleave
         3⟇8⟇                  Remove third and remove eight char (I know, very cringe)
             ~ḟǓ               Find index of note, rotate list by index
                »°f»b          Compressed number 2906, binary "101101011010"
                     ⁰9*       Multiply scale by 9, pushes 9 for major and 0 for minor
                        ǔ      Rotate "101101011010" by 0 or 9
                         *ꜝ    Filter out list by binary string

Vyxal, 27 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online! | 35 bytes if you have to handle flats

Explanation:

\kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ
kA7Ẏ                           Uppercase alphabets A-H
    :\#ẊY                      Duplicate, take cartesian product with "#", interleave
         3⟇8⟇                  Remove third and remove eight char (I know, very cringe)
             ~ḟǓ               Find index of note, rotate list by index
                »°f»b          Compressed number 2906, binary "101101011010"
                     ⁰9*       Multiply scale by 9, pushes 9 for major and 0 for minor
                        ǔ      Rotate "101101011010" by 0 or 9
                         *ꜝ    Filter out list by binary string

Vyxal, 27 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online! | 35 bytes if you have to handle flats

Explanation:

kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ
kA7Ẏ                           Uppercase alphabets A-H
    :\#ẊY                      Duplicate, take cartesian product with "#", interleave
         3⟇8⟇                  Remove third and remove eight char (I know, very cringe)
             ~ḟǓ               Find index of note, rotate list by index
                »°f»b          Compressed number 2906, binary "101101011010"
                     ⁰9*       Multiply scale by 9, pushes 9 for major and 0 for minor
                        ǔ      Rotate "101101011010" by 0 or 9
                         *ꜝ    Filter out list by binary string
added 330 characters in body
Source Link
math scat
  • 9.5k
  • 1
  • 20
  • 83

Vyxal, 3527 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

\bokA7ẎkA7Ẏ:\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online! | Try it Online!35 bytes if you have to handle flats

Explanation:

\bokA7Ẏ\kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ
\bo                                   Remove "b"\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ
   kA7Ẏ                               Uppercase alphabets A-H
       :\#ẊY                          Duplicate, take cartesian product with "#", interleave
            3⟇8⟇                      Remove third and remove eight char (I know, very cringe)
                ~ḟǓ                   Find index of note, rotate list by index
                   $¹≠                Push trimmed note, compare with original note
                      ßǔ              If false (b in input), rotate list by 1
                    
                        »°f»b          Compressed number 2906, binary "101101011010"
                             ⁰9*       Multiply scale by 9, pushes 9 for major and 0 for minor
                                ǔ      Rotate "101101011010" by 0 or 9
                                 *ꜝ    Filter out list by binary string

Vyxal, 35 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

\bokA7Ẏ:\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online!

Explanation:

\bokA7Ẏ:\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ
\bo                                   Remove "b"
   kA7Ẏ                               Uppercase alphabets A-H
       :\#ẊY                          Duplicate, take cartesian product with "#", interleave
            3⟇8⟇                      Remove third and remove eight char (I know, very cringe)
                ~ḟǓ                   Find index of note, rotate list by index
                   $¹≠                Push trimmed note, compare with original note
                      ßǔ              If false (b in input), rotate list by 1
                    
                        »°f»b         Compressed number 2906, binary "101101011010"
                             ⁰9*      Multiply scale by 9, pushes 9 for major and 0 for minor
                                ǔ     Rotate "101101011010" by 0 or 9
                                 *ꜝ   Filter out list by binary string

Vyxal, 27 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online! | 35 bytes if you have to handle flats

Explanation:

\kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ
kA7Ẏ                           Uppercase alphabets A-H
    :\#ẊY                      Duplicate, take cartesian product with "#", interleave
         3⟇8⟇                  Remove third and remove eight char (I know, very cringe)
             ~ḟǓ               Find index of note, rotate list by index
                »°f»b          Compressed number 2906, binary "101101011010"
                     ⁰9*       Multiply scale by 9, pushes 9 for major and 0 for minor
                        ǔ      Rotate "101101011010" by 0 or 9
                         *ꜝ    Filter out list by binary string
added 330 characters in body
Source Link
math scat
  • 9.5k
  • 1
  • 20
  • 83

Vyxal, 2735 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

kA7Ẏ\bokA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online!Try it Online!

Explanation:

kA7Ẏ\bokA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ
\bo                                   Remove "b"
   kA7Ẏ                               Uppercase alphabets A-H
       :\#ẊY                          Duplicate, take cartesian product with "#", interleave
            3⟇8⟇                      Remove third and remove eight char (I know, very cringe)
                ~ḟǓ                   Find index of note, rotate list by index
                »°f»b   $¹≠                Push trimmed note, compare with original note
                      ßǔ              If false (b in input), rotate list by 1
                    
                        »°f»b         Compressed number 2906, binary "101101011010"
                     ⁰9*        ⁰9*      Multiply scale by 9, pushes 9 for major and 0 for minor
                        ǔ        ǔ     Rotate "101101011010" by 0 or 9
                         *ꜝ        *ꜝ   Filter out list by binary string

Vyxal, 27 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online!

Explanation:

kA7Ẏ:\#ẊY3⟇8⟇~ḟǓ»°f»b⁰9*ǔ*ꜝ
kA7Ẏ                           Uppercase alphabets A-H
    :\#ẊY                      Duplicate, take cartesian product with "#", interleave
         3⟇8⟇                  Remove third and remove eight char (I know, very cringe)
             ~ḟǓ               Find index of note, rotate list by index
                »°f»b          Compressed number 2906, binary "101101011010"
                     ⁰9*       Multiply scale by 9, pushes 9 for major and 0 for minor
                        ǔ      Rotate "101101011010" by 0 or 9
                         *ꜝ    Filter out list by binary string

Vyxal, 35 bytes

-1 byte thanks to AndrovT

First input is the note, second is the scale; 0 for minor and 1 for major.

\bokA7Ẏ:\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ

I'm a bit rusty.

Try it Online!

Explanation:

\bokA7Ẏ:\#ẊY3⟇8⟇~ḟǓ$¹≠ßǔ»°f»b⁰9*ǔ*ꜝ
\bo                                   Remove "b"
   kA7Ẏ                               Uppercase alphabets A-H
       :\#ẊY                          Duplicate, take cartesian product with "#", interleave
            3⟇8⟇                      Remove third and remove eight char (I know, very cringe)
                ~ḟǓ                   Find index of note, rotate list by index
                   $¹≠                Push trimmed note, compare with original note
                      ßǔ              If false (b in input), rotate list by 1
                    
                        »°f»b         Compressed number 2906, binary "101101011010"
                             ⁰9*      Multiply scale by 9, pushes 9 for major and 0 for minor
                                ǔ     Rotate "101101011010" by 0 or 9
                                 *ꜝ   Filter out list by binary string
added 91 characters in body
Source Link
math scat
  • 9.5k
  • 1
  • 20
  • 83
Loading
Source Link
math scat
  • 9.5k
  • 1
  • 20
  • 83
Loading