Nice! These seems to be valuable for a lot of things, nested conditional score loops ..., combined with score event generating instruments. As you said, yes, some care might be needed not to shoot oneself in the foot ;-) Oeyvind 2008/8/2, victor : > > I have added a couple of opcodes to control the score readout position, > these are experimental and should be used with care. They simply wrap > up API calls, > > setscorepos isecs > scorerewind > > Both are init-time only. > > My main aim was to use it with MIDI files, but they seem to work with the > standard numeric score. However, I had the > occasional problem in different experiments which I was not able to locate, > so it is not fool-proof. > > Here is an example that loops forever. > > > > sr = 44100 > ksmps = 10 > nchnls = 2 > > instr 100 > setscorepos p4 > turnoff > endin > > instr 1 > i1 cpsmidi > k1 linsegr 1, 0.5, 0.1, 0.01, 0.02 > k2 expon 1,p3,0.0001 > a1 phasor cpspch(p4) > aout = -k2*10000*cos((a1^k1)*$M_PI) > outs aout,aout > endin > > > > f0 6000 > f1 0 4096 10 1 > i1 0 1 8.00 > i1 + 1 8.03 > i1 + 1 8.04 > i1 + 1 8.07 > i1 + 1 8.09 > i1 + 1 8.10 > i1 + 1 8.09 > i1 + 1 8.07 > i1 + 1 8.03 > i100 9 1 0 > e > > > > In CVS now, documentation to follow.