Adding automatic octaves to a melody

This macro allows you to get octaves from a sequence of single notes (this is particularly useful in piano music).

The function takes two arguments: the first one is a number (#1 adds notes an octave above, #-1 an octave below, etc), the second one is the music to deal with.

Beware: the function can handle chords, but tends to reverse the intervals.