I'm making a sequencer in Kyma that outputs midi using the MIDIOutput Event.
Initially I'm starting with a 4 step sequence but I'm about to make it much more complex with nested loops.
If I put the expression that calculates the current note value in the MIDIOuput Event it works fine:
MIDIOutput Event:
Frequency:
(((((1 bpm: !BPM) nextIndex) mod: 4) of: {(1 to: 4) collect: [:i | !Seq1Value suffix: i]}) + 60) nn hz
But as I add more levels of nesting this expression is going to become unweildy and hard to debug because I can't see (in the VCS) any intermediate values. But if I create a STGC to create a !Gate signal and another STGC to calculate the current note value (!SeqVal) then weird notes start coming out over midi (half way between values).
Mixer:
Inputs:
SoundToGlobalController:
GeneratedEvent:
!Gate
Value:
1 bpm: !BPM
SoundToGlobalController:
GeneratedEvent:
!SeqVal
Value:
((((!Gate nextIndex) mod: 4) of: {(1 to: 4) collect: [:i | !Seq1Value suffix: i]}) + 60) nn hz
MIDIOutput Event:
Frequency:
!SeqVal
Value:
!Gate
I've tried delaying the !Gate signal in the MIDIOutput Event using turnOnAfter: for: and while that had some odd effect it didn't fix the problem. How do I create a sound that can work out the note value for the MIDIOutput Event without having to write the entire expression in its frequency parameter?
I've attached two example sounds - the first one that works where the entire expression is in the MIDIOutput Event and the other where I've tried to refactor that expression into STGCs unsuccessfully.
http://kyma.symbolicsound.com/qa/?qa=blob&qa_blobid=394791909300513371