Generating a musical scale from a root note
Yikes — the global variables make this spaghetti code.  Functions should make it obvious what their input parameters are, and return their output values.  You'd be better off lumping everything into one main() function than using global variables.  Ironically, the two variables that should have been global constants — chromatic and scales — weren't.

It is customary to put main() last, and helper functions first, so that you don't have to write forward declarations.

You used std::find() and std::distance(), so you should #include &lt;algorithms&gt; and &lt;iterator&gt;.  I suggest listing your includes alphabetically.

Behaviour

Please enter your root note and scale: 
F# Major

root scale: F# Major

C D E F G A B 


If the rootnote is not found in chromatic, you should handle that case instead of blindly proceeding based on chromatic.end().

Please enter your root note and scale: 
D Major

root scale: D Major

D E Gb G A B Db 


Those enharmonic equivalents will sound the same, but those should technically be F♯ and C♯.

Please enter your root note and scale: 
null blah

root scale: null blah


Making the user enter the magic word "null" as the root note to exit the program is weird.

Suggested solution

#include &lt;algorithm&gt;
#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;map&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;

const std::vector&lt;std::string&gt; chromatic = {
    "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"
};

const std::map&lt;const std::string, const std::vector&lt;int&gt;&gt; degrees = {
    {"Major",       { 0, 2, 4, 5, 7, 9, 11, 12 }},
    {"Minor",       { 0, 2, 3, 5, 7, 8, 10, 12 }},
    {"Harmonic",    { 0, 2, 3, 5, 7, 8, 11, 12 }},
    {"Melodic",     { 0, 2, 3, 5, 7, 9, 11, 12 }}
};

std::string scalenotes(const std::string&amp; rootnote, const std::string&amp; scale) {
    int root = std::distance(chromatic.begin(), std::find(chromatic.begin(), chromatic.end(), rootnote));
    if (root &gt;= chromatic.size()) {
        return "";
    }
    std::stringstream ss;
    for (int i : degrees.at(scale)) {
        ss &lt;&lt; chromatic[(root + i) % chromatic.size()] &lt;&lt; " ";
    }
    return ss.str();
}

std::stringstream ask(const std::string&amp; question) {
    std::string line;
    std::cout &lt;&lt; question;
    std::getline(std::cin, line);
    return std::stringstream(line);
}

int main()
{
    std::string rootnote, scale;
    while (ask("Please enter your root note and scale: ") &gt;&gt; rootnote &gt;&gt; scale) {
        std::cout &lt;&lt; "\nroot scale: " &lt;&lt; rootnote &lt;&lt; " " &lt;&lt; scale
                  &lt;&lt; ": " &lt;&lt; scalenotes(rootnote, scale) &lt;&lt; "\n\n";
    }
}