Synth.addNotePan(EventID)
-
@Lindon Is the goal to pan individual events?
-
@d-healey said in Synth.addNotePan(EventID):
@Lindon Is the goal to pan individual events?
yes - sorry just modified the title to be clearer - yes thats what I want to do: pan individual notes...
-
@Lindon Search the forum, someone called Lindon has asked about this before, and others before him :)
-
@d-healey said in Synth.addNotePan(EventID):
@Lindon Search the forum, someone called Lindon has asked about this before, and others before him :)
well I couldn't find anything that Lindon bloke asked, but I found this
https://forum.hise.audio/topic/314/note-panning
- and yes obviously I can use a Simple gain and pan - but:
Im here in my Arp - which is not at the sound source level (so in the master chain) - and its capable of routing arpeggiated notes to one or more sound modules - theres more than one arp as well- by using the MIDI channel its sending on, thus the Arp has no idea about which sound sources are "listening" to the arp - and I'd like to keep it that way - the arp de-coupled from the sound generation. But using a Simple Gain I will have to have the arp "know" who's listening to modify their gain pan positions... which is not so clean...
-
-
@d-healey said in Synth.addNotePan(EventID):
Yeah as I say I know all about these - but if you read my last entry I need the arp to set the pan position on a note by note basis, and this position is an attribute of a step in the arp - so it can be dynamically changed - so the Array Modulator is a nightmare solution...and again these require the Arp to "know" which voice's Stereo FX to "fiddle with" = bad
code.design. -
@Lindon I agree a per event solution is much easier to work with
-
@d-healey yeah -m I think I will have to go with my backup solution:
Each arp has its own assigned CC (100, 101, etc.) that it uses to issue "Pan commands" - and the "listening" modules will have to :
- listen for Notes with their Arps channel number, so they know to play or not.
- Listen for CC "pan command" for that Arp and set their own pan positions
- I was already going to have to do this sort of thing for any Arp-based send amounts etc.
-
My solution for this was to add a Stereo FX and apply a script voice start modulator.
I have a global for note events which is a modified class that Christoph provided in a topic I'll link below.
namespace MessageCustom { const var NUM_SLOTS = 512; const var NUM_PER_SLOT = 16; if(!isDefined(MessageCustomObject)) { global MessageCustomObject = []; MessageCustomObject.reserve(512); for(i = 0; i < NUM_SLOTS; i++) { MessageCustomObject[i] = []; //for(j = 0; j < NUM_PER_SLOT; j++) // MessageCustomObject[i][j] = 0; MessageCustomObject[i].reserve(NUM_PER_SLOT); } } inline function clear() { MessageCustomObject[Message.getEventId() % NUM_SLOTS].clear(); } inline function clearForId(id) { MessageCustomObject[id % NUM_SLOTS].clear(); } inline function setCustomValue(index, value) { MessageCustomObject[Message.getEventId() % NUM_SLOTS][index] = value; } inline function setCustomValueForId(id, index, value) { MessageCustomObject[id % NUM_SLOTS][index] = value; } inline function getCustomValue(index) { return MessageCustomObject[Message.getEventId() % NUM_SLOTS][index]; } inline function getCustomValueForId(id, index) { return MessageCustomObject[id % NUM_SLOTS][index]; } }
Usage is to call MessageCustom.clearForId() first and then setCustomValue or setCustomValueForId() which depends whether youre setting it for the current message or for the one you launched with Synth.play in a previous line of code.
Then, anywhere in your project where you can query events, you can retrieve a value from this storage related to that event. So you store your panning info as you would with Message.setPan, and then in the script of the voice start modulator for Stereo FX, you simply call MessageCustom.getCustomValue(index) where the index is the same one you used to store the pan value.
It's as simple as it gets right now, as all you have to do before storing and recalling is>
- inlcude the external script wherever you want to use it
- clear for Id before setting values, to make
Clearing is mandatory when you have events which store different amounts of data and your get setup downstream always looks for everything (you can create some really cool stuff just by checking whether certain indexes are defined), as you don't want to apply values from different indexes for events that didn't use them.
Now that I put all of this in writing it occurs to me this can all be simplified with a single function that you can feed with an object and it clears for ID first and then sets indexes according to the object setup, though this might have additional overhead which could be of importance to your arp, depending on how many events youre launching
https://forum.hise.audio/topic/8497/message-setpan
https://forum.hise.audio//post/72831 -
@aaronventure yeah, unless I'm wrong (often occurs), that's almost the same as my fall back work around - except its tying the data we want to exchange to a global array and reading it on a note based event in a script voice start modulator.
Cant see the advantage here, as I can use my system to send arbitrary "pan instructions" at arbitrary times - that have nothing to do with note events, whereas voice start modulator requires some sort of note based event to function...
-
@Lindon what you do with the data is entirely up to you, you can still change the values by index even post-launch, but yes, the question is where and how would this be used other than for the voice start as script envelope doesn't care for event ID i.e. there's no code callback.
Would be great if the script envelope had some sort of process block callback where we can override the scriptnode part and return anything like with the voice start, except if we could query for note id, it opens up control over polyphonic modulation over time.
But yeah, back on topic, in your case sounds like you don't need polyphony so you can just pass artificial CC and control pan that way on your separate modules.