Dear maintainer, I've uploaded the following patch to csound to
delayed/2. Rationale for the short delay: we've already discussed the
change and you've reviewed my merge request, and the release team
requested that I upload in a timely manner.
diff --git a/debian/changelog b/debian/changelog
index 84a4831..72a6859 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+csound (1:6.12.2~dfsg-3.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix diskgrain, syncgrain and syncloop when sample rate of sample
+ differs from orchestra, Closes: #924260
+
+ -- Sam Hartman <hartmans@debian.org> Thu, 21 Mar 2019 10:31:29 -0400
+
csound (1:6.12.2~dfsg-3) unstable; urgency=medium
* Fix FTBFS on mips by avoiding a deadlock
diff --git a/debian/patches/applied-diskgrain-fix-to-syncgrain-andsyncloop.patch b/debian/patches/applied-diskgrain-fix-to-syncgrain-andsyncloop.patch
new file mode 100644
index 0000000..d5f3033
--- /dev/null
+++ b/debian/patches/applied-diskgrain-fix-to-syncgrain-andsyncloop.patch
@@ -0,0 +1,58 @@
+From: veplaini <victor.lazzarini@nuim.ie>
+Date: Mon, 11 Mar 2019 09:11:40 +0000
+Subject: applied diskgrain fix to syncgrain andsyncloop
+
+---
+ Opcodes/syncgrain.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/Opcodes/syncgrain.c b/Opcodes/syncgrain.c
+index cb0b2bd..1dc1973 100644
+--- a/Opcodes/syncgrain.c
++++ b/Opcodes/syncgrain.c
+@@ -96,15 +96,16 @@ static int32_t syncgrain_process(CSOUND *csound, syncgrain *p)
+ int32_t numstreams = p->numstreams, olaps = p->olaps;
+ int32_t count = p->count, j, newstream;
+ int32_t datasize = p->datasize, envtablesize = p->envtablesize;
++ MYFLT pscale = p->sfunc->gen01args.sample_rate/CS_ESR;
+
+- pitch = *p->pitch * p->sfunc->gen01args.sample_rate/CS_ESR;
++ pitch = *p->pitch * pscale;
+ fperiod = FABS(p->sfunc->gen01args.sample_rate/(*p->fr));
+ //if (UNLIKELY(fperiod < 0)) fperiod = -fperiod;
+ amp = *p->amp;
+ grsize = p->sfunc->gen01args.sample_rate * *p->grsize;
+ if (UNLIKELY(grsize<1)) goto err1;
+ envincr = envtablesize/grsize;
+- prate = *p->prate;
++ prate = *p->prate * pscale;
+
+ if (UNLIKELY(offset)) memset(output, '\0', offset*sizeof(MYFLT));
+ if (UNLIKELY(early)) {
+@@ -249,7 +250,7 @@ static int32_t syncgrainloop_process(CSOUND *csound, syncgrainloop *p)
+ int32_t loopsize;
+ int32_t firsttime = p->firsttime;
+ MYFLT sr = p->sfunc->gen01args.sample_rate;
+-
++ MYFLT pscale = sr/CS_ESR;
+ /* loop points & checks */
+ loop_start = (int32_t) (*p->loop_start*sr);
+ loop_end = (int32_t) (*p->loop_end*sr);
+@@ -260,7 +261,7 @@ static int32_t syncgrainloop_process(CSOUND *csound, syncgrainloop *p)
+ /*csound->Message(csound, "st:%d, end:%d, loopsize=%d\n",
+ loop_start, loop_end, loopsize); */
+
+- pitch = *p->pitch * sr/CS_ESR;;
++ pitch = *p->pitch * pscale;
+ fperiod = FABS(sr/(*p->fr));
+ //if (UNLIKELY(fperiod < 0)) fperiod = -fperiod;
+ amp = *p->amp;
+@@ -268,7 +269,7 @@ static int32_t syncgrainloop_process(CSOUND *csound, syncgrainloop *p)
+ if (UNLIKELY(grsize<1)) goto err1;
+ if (loopsize <= 0) loopsize = grsize;
+ envincr = envtablesize/grsize;
+- prate = *p->prate;
++ prate = *p->prate * pscale;
+
+ if (UNLIKELY(offset)) memset(output, '\0', offset*sizeof(MYFLT));
+ if (UNLIKELY(early)) {
diff --git a/debian/patches/diskgrain-prate-scaling.patch b/debian/patches/diskgrain-prate-scaling.patch
new file mode 100644
index 0000000..9f21a6e
--- /dev/null
+++ b/debian/patches/diskgrain-prate-scaling.patch
@@ -0,0 +1,30 @@
+From: veplaini <victor.lazzarini@nuim.ie>
+Date: Sat, 9 Mar 2019 14:03:22 +0000
+Subject: diskgrain prate scaling
+
+---
+ Opcodes/syncgrain.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Opcodes/syncgrain.c b/Opcodes/syncgrain.c
+index d7c461e..cb0b2bd 100644
+--- a/Opcodes/syncgrain.c
++++ b/Opcodes/syncgrain.c
+@@ -455,7 +455,7 @@ static int32_t filegrain_init(CSOUND *csound, filegrain *p)
+ p->pscale = p->sr/CS_ESR;
+
+ if (*p->ioff >= 0)
+- sf_seek(p->sf,*p->ioff * CS_ESR, SEEK_SET);
++ sf_seek(p->sf,*p->ioff * p->sr, SEEK_SET);
+
+ if (LIKELY(sf_read_MYFLT(p->sf,buffer,p->dataframes*p->nChannels/2) != 0)) {
+ p->read1 = 1;
+@@ -518,7 +518,7 @@ static int32_t filegrain_process(CSOUND *csound, filegrain *p)
+ if (UNLIKELY(grsize<1)) goto err1;
+ if (grsize > hdataframes) grsize = hdataframes;
+ envincr = envtablesize/grsize;
+- prate = *p->prate;
++ prate = *p->prate * p->pscale;
+
+ if (UNLIKELY(offset)) memset(output, '\0', offset*sizeof(MYFLT));
+ if (UNLIKELY(early)) {
diff --git a/debian/patches/series b/debian/patches/series
index 2af9652..8d460a0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,5 @@ fix-n-and-m-in-score-strings.patch
debian-specific/lua-link.diff
ctcsound-import-the-SOVERSIONed-library.patch
csPerfThread-stop-the-recording-thread-before-the-perf-th.patch
+diskgrain-prate-scaling.patch
+applied-diskgrain-fix-to-syncgrain-andsyncloop.patch
Attachment:
signature.asc
Description: PGP signature