Using outch and the mod opcode (mod 2) you can do this simply. Sorry not to give full solution -- up to my eyes in other code ==John Quoting Gleb : > Hi everybody! > > This time I am trying to spread each new incoming note between two channels, > i.e. first note goes to left channel, second one - to the right, third - to > the left again etc. > My solution is something like following: > > giPanMod = 1 > instr 1 > iveloc ampmidi 1 > iPanMod = 1 > if (iveloc >=0) then > giPanMod = -giPanMod > print giPanMod > endif > endin > > I use global giPanMod to prevent it re-initialization inside instr. Every > next incoming note sign of giPanMod changes so I can control if it is even > or odd. Sure could use mod() or something in this way, but in case there are > only two values, I think this solution is better. > > My question is anybody sees more optimal solution of given problem? > > Thank you dear Csounders! > > > > > ----- > Gleb Rogozinsky, PhD > Associated Professor > Interactive Arts Department > Saint-Petersburg University of Film and Television > > Deputy Director of Medialab > Saint-Petersburg University of Telecommunications > -- > View this message in context: > http://csound.1045644.n5.nabble.com/What-is-the-optimal-way-of-spreading-incoming-notes-b-w-channels-tp5731414.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug trackers > csound6: > https://sourceforge.net/p/csound/tickets/ > csound5: > https://sourceforge.net/p/csound/bugs/ > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body > "unsubscribe csound"