Package: pd-flite / 0.02.3-3

garray64.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Description: 64bit compatible access of arrays
Author: IOhannes m zmölnig
Forwarded: no
Last-Update: 2016-11-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- pd-flite.orig/flite.c
+++ pd-flite/flite.c
@@ -75,7 +75,7 @@
   cst_wave *wave;
   int i,vecsize;
   t_garray *a;
-  t_float *vec;
+  t_word *vec;
 
 # ifdef FLITE_DEBUG
   post("flite: got message 'synth'");
@@ -113,14 +113,16 @@
 # endif
 
   garray_resize(a, wave->num_samples);
-  if (!garray_getfloatarray(a, &vecsize, &vec))
+  if (!garray_getfloatwords(a, &vecsize, &vec))
     pd_error(x,"flite: bad template for write to array '%s'", x->x_arrayname->s_name);
+  if (wave->num_samples < vecsize)
+    vecsize = wave->num_samples;
 
 # ifdef FLITE_DEBUG
   post("flite: ->write to garray loop<-");
 # endif
-  for (i = 0; i < wave->num_samples; i++) {
-    *vec++ = wave->samples[i]/32767.0;
+  for (i = 0; i < vecsize; i++) {
+    vec[i].w_float = wave->samples[i]/32767.0;
   }
 
   // -- outlet synth-done-bang