-o dac ; ============================================== sr = 48000 ksmps = 1 nchnls = 2 0dbfs = 1 #include "m_segk.udo" instr 1 kfin init 1 ; set to one, when m_segk has finished ktrig init 1 ; needs to be 1 so m_segk starts kndx init 0 ; index into table, reading start and end values kstart init 0 ; value at start of segment kend init 0 ; value at end of segment if kfin != 0 then ; if m_segk has finished prepare next segment know times ; only for debugging printks "\nnow: %f, fin is 1", 1/kr, know ; only for debugging if kndx == 3 then ; end of table, no more segments printks "\nAt end of points...", 1/kr ; debug kend = kstart ; make sure that we stay at final value else ; There are still points in the table ktrig = 1 ; make sure that a segment is triggered kstart table (kndx * 2), 5, 0 ; read new start value kend table ((kndx * 2) + 1), 5, 0 ; read new end value printks "\nread line: %d from %f to %f", 1/kr, kndx, kstart, kend ; debug kndx += 1 ; increase index endif endif ; call m_segk to generate the changing signal from the segments ; it will start when ktrig is 1 and output kfin = 1 upon its completion kres, kfin m_segk kstart, 2, kend, 2, ktrig, 1, 2, 3 a1 oscil 1, kres, 4 ; apply kres to frequency to hear the result outs a1, a1 ktrig = 0 ; set ktrig to 0, so only the next segment completion will trigger ; a new segment endin ; ============================================== f1 0 4096 23 "log.ftable" ; logarithmic ftable f2 0 4096 7 0 4096 1 ; linear ftable f3 0 4096 23 "exp.ftable" ; exponential ftable f4 0 32768 10 1 ; sinewave for the oscillator f5 0 6 -2 110 440 440 440 440 880 ; the points for the segments i1 0 10 ; should complete in 6 seconds and end in four seconds of static freq e Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here