Skip to content

Commit 504451e

Browse files
committed
Fix glitch in printk
1 parent 7509cfa commit 504451e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

OOps/ugrw1.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ int printkset(CSOUND *csound, PRINTK *p)
747747
/* Set up ctime so that if it was 0 or negative, it is set to a low value
748748
* to ensure that the print cycle happens every k cycle. This low value is
749749
* 1 / ekr */
750+
/* Not sure this mattersin revised version. Would just work! -- JPff */
750751
if (*p->ptime < CS_ONEDKR)
751752
p->ctime = FL(0.0);
752753
else
@@ -761,11 +762,8 @@ int printkset(CSOUND *csound, PRINTK *p)
761762
else if (UNLIKELY(p->pspace > 120L))
762763
p->pspace = 120L;
763764

764-
/* Set the initime variable - how many seconds in absolute time
765-
* when this instance of the instrument was initialised. */
766-
767765
//printf("printkset: ctime = %f\n", p->ctime);
768-
p->printat = FL(0.0);
766+
p->printat = CS_KCNT;
769767
p->initialised = -1;
770768
return OK;
771769
}
@@ -782,7 +780,7 @@ int printk(CSOUND *csound, PRINTK *p)
782780

783781
//printf("printk: KCNT = %lu\n", CS_KCNT);
784782
//printf("printat = %lf\n", p->printat);
785-
783+
/* Now test if the cycle number has reached the next print time */
786784
if (p->printat <= CS_KCNT-1) {
787785
/* Do the print cycle.
788786
* Print instrument number and time. Instrument number stuff from
@@ -1135,7 +1133,7 @@ int printks(CSOUND *csound, PRINTKS *p)
11351133
sarg = ((STRINGDAT*)p->ifilcod)->data;
11361134
if (sarg == NULL)
11371135
return csoundPerfError(csound, p->h.insdshead, Str("null string\n"));
1138-
if (strcmp(sarg, p->old) != 0) {
1136+
if (strcmp(sarg, p->old) != 0) {
11391137
printksset_(csound, p, sarg);
11401138
csound->Free(csound, p->old);
11411139
p->old = cs_strdup(csound, sarg);

0 commit comments

Comments
 (0)