2
\$\begingroup\$

The challenge.

Make a program that produces a random series of 8 notes in the scale of E minor, and then harmonizes them.

Details.

  • Notes must be represented in output as a 1-2 char string, which designates the note and if it is sharped or not, followed by a number, which designates the octave. Examples would be C3, D#7, or A#1. No notes can be flatted, only sharped.
  • No notes can have an octave lower than 1.
  • The scale starts at E4 and ends at D5. No notes that are randomly generated can be outside of these bounds, but the chords can be below it.
  • Each note that the program randomly makes must have a chord of three notes an octave below it.
  • The three notes of a chord are as followed:
    • Root note: The note originally randomly generated, but an octave lower.
    • Middle note: Depending on what note fits within the scale, this is 3 to 4 semitones above the root note and is what makes a chord major or minor.
    • Top note: The fifth of the root note, or raised 7 semitones. If the fifth of the root note isn't in the scale, then the top note is 6 semitones above the root.
  • Output is simply just a print to the console of a string.

Output.

What a note and its harmony look like:
({E4}, {E3}, {G3}, {B3})
Output format:
[ (*note and harmony*), x8 ]
All space padding is optional.

Conclusion.

Any languages are allowed, and the shortest response, in bytes, after a week is the winner.

\$\endgroup\$
6
  • 3
    \$\begingroup\$ When you say random you should specify a distribution. Many things are random or may appear random, we can't tell which of these you actually want. I would also question what adding randomness to this challenge actually does to improve it. \$\endgroup\$ Commented Aug 8, 2020 at 1:47
  • 1
    \$\begingroup\$ Welcome to CGCC. There are a number of things that are unclear. The scale of E natural minor is E F# G A B C D and you mention that the scale ends on D. But then you also mention D# and A# . As far as I'm aware A# is not a note in any version of E minor. D# instead of D occurs in some variants of the E minor scale, but in harmonies it would typically only be used to substitute a B minor chord B D F# with a B major chord B D# F# and never as the root note of a chord so I'm wondering why it's included. I suggest you just list the 7 possible outputs, one for each note of the scale \$\endgroup\$ Commented Aug 8, 2020 at 1:56
  • \$\begingroup\$ @LevelRiverSt I was using those as references, not as if they were part of the scale \$\endgroup\$ Commented Aug 8, 2020 at 5:17
  • 1
    \$\begingroup\$ If I've understood correctly the required outputs are [E4 E3 G3 B3] [F#4 F#3 A3 C4] [G4 G3 B3 D4] [A4 A3 C4 E4] [B4 B3 D4 F#4] [C5 C4 E4 G4] [D5 D4 F#4 A4 ] is that correct? if so edit it into the question. \$\endgroup\$ Commented Aug 8, 2020 at 13:32
  • 1
    \$\begingroup\$ If you do edit the challenge, I suggest thinking about whether you can make it more approachable for those without any background in music. LevelRiverSt's comments are a good start. \$\endgroup\$ Commented Aug 8, 2020 at 15:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.