Created
June 22, 2017 11:37
-
-
Save weepy/6caedb688ef4e18999efb4614e743e35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UTransformHarmonize : public UTransformBase { | |
public: | |
list<int> intervals; | |
bool calcPlayingNotes(CLOCK clock) { | |
bool changed = upstreamTransform->calcPlayingNotes(clock); | |
if(shouldUpdate || changed) { | |
playingNotes.clear(); | |
NoteList input = upstreamTransform->playingNotes; | |
for(auto it = input.begin(); it != input.end(); it++) { | |
for(auto interval: intervals) { | |
Note n = *it; | |
n.key += interval; | |
n.options["key"] = n.key; | |
playingNotes.push_back(n); | |
} | |
} | |
playingNotes.markAsNew(); | |
shouldUpdate = false; | |
return true; | |
} | |
else { | |
return false; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment