The problem is that the printks is inside a conditional, which inhibits any printout until the release phase of the note. However, when it *is* de-inhibited, it prints a line for every 1/10 second since the *beginning* of the note! But *not* every 1/10 of a second. It prints once every k-cycle. (Look at the time values in the first few lines. They're a millisec apart, not 1/10. Only the final -- correctly output -- values are 1/10 sec apart.) There is nothing wrong wit the printf line. (And as I noted, this didn't happen in Csound 5.19.) -- Pete -- On Wed, May 15, 2019 at 05:26:28PM +0100, john wrote: > I keep reasding this and cannot see what is your problem. printf only > runs when the trigger ois nt zero and different from the previos value > according to the manual so it appears once. printks prints every 0.1sec > as you see. > > > > On Wed, 8 May 2019, Pete Goodeve wrote: > > >Hi, > > > >Following the FoF discussion, I wanted to clarify my understanding > >of instrument duration and release under MIDI, so I made this test > >file: > > > > > > > >-m0 -d -L stdin -odac > > > > > > > >sr = 48000 > >ksmps = 48 > >0dbfs = 1.0 > >nchnls = 2 > > > >instr 1 > > prints "instr start\n" > > itim times > > midinoteonkey, p4, p5 ; dummy to activate MIDI > > kadsr madsr 0.1, 0.2, 1.0, 0.5 > > krel release > > if krel > 0 then > > ktim times > > printf "release at %f\n", krel, ktim - itim > > printks "ramp %f at %f\n", 0.1, kadsr, ktim - itim > > endif > >endin > > > > > > > > > > > > > > > > > > > >The idea was to show me the time course of the extended > >release time (with the half-second adsr). When I run it (under > >Csound 6.12 or 6.13) I actually get this: > > > >instr start > >release at 0.519000 > >ramp 1.000000 at 0.519000 > >ramp 0.998000 at 0.520000 > >ramp 0.996000 at 0.521000 > >ramp 0.994000 at 0.522000 > >ramp 0.992000 at 0.523000 > >ramp 0.990000 at 0.524000 > >ramp 0.836000 at 0.601000 > >ramp 0.636000 at 0.701000 > >ramp 0.436000 at 0.801000 > >ramp 0.236000 at 0.901000 > >ramp 0.036000 at 1.001000 > >instr start > >release at 1.046000 > >ramp 1.000000 at 1.046000 > >ramp 0.998000 at 1.047000 > >ramp 0.996000 at 1.048000 > >ramp 0.994000 at 1.049000 > >ramp 0.992000 at 1.050000 > >ramp 0.990000 at 1.051000 > >ramp 0.988000 at 1.052000 > >ramp 0.986000 at 1.053000 > >ramp 0.984000 at 1.054000 > >ramp 0.982000 at 1.055000 > >ramp 0.980000 at 1.056000 > >ramp 0.890000 at 1.101000 > >ramp 0.690000 at 1.201000 > >ramp 0.490000 at 1.301000 > >ramp 0.290000 at 1.401000 > >ramp 0.090000 at 1.501000 > > > >with some unexpected initial printouts -- at 1 per k-cycle -- > >before it prints the expected release ramp every 1/10 sec. > >(If I change ksmps, the number of lines changes appropriately.) > > > >I went back to Csound 5, and there I just see the expected > >printouts for the release phase only. > > > >I guess this is a bug? > > > > -- Pete -- > > > > > >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 > > > > 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 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