Hi,
This is preallocated for speed, and you may think of something better.
What you might try is setting it up the table indexing using the
looping opcodes inside of a UDO space. This implementation is reading
each point individually, of course with 8 points in the table it's not
such a problem but it will quickly prove inadequate with larger sized
tables. I tried reading the table using the phasor to index it over
time, but the results are not fast and if your ultimate implementation
requires you to get the values "now" for realtime performance, this
may not do. The extra bonus in here to answer your question is the use
of Anthony Kozar's "max" opcode.
-m0 -odac -iadc -d -b128 -B256 -Mhw:2,0 -+rtaudio=alsa -+rtmidi=null
sr = 44100
ksmps = 128
nchnls = 2
giTab ftgen 1, 0, 8, -2, 1, 5, 2, -4, -9, 8, 0, 4
/*--- ---*/
instr 1
;kndx1 phasor 1/(ftlen(1))
;kndx1 = kndx1 * ftlen(1)
ktab1 table 1, 1
ktab2 table 2, 1
ktab3 table 3, 1
ktab4 table 4, 1
ktab5 table 5, 1
ktab6 table 6, 1
ktab7 table 7, 1
ktab8 table 8, 1
kmax max ktab1, ktab2, ktab3, ktab4, ktab5, ktab6, ktab7, ktab8
printk2 kmax
endin
/*--- ---*/
i1 0 100
On Sun, Jul 6, 2008 at 1:58 PM, joachim heintz wrote:
> Hello all -
>
> is there an opcode to get the maximum value of a function table? E.g. for
> the table
> giTab ftgen 0, 0, 8, -2, 1, 5, 2, -4, -9, 8, 0, 4
> it should return 8.
>
> Thanks -
>
> joachim
>