Skip to content

Commit

Permalink
move pd functions out of the worker thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucarda committed Jun 11, 2022
1 parent 8650c53 commit c032258
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
8 changes: 6 additions & 2 deletions flite-help.pd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#N canvas 297 24 793 679 10;
#X text 25 4 flite : text-to-speech synthesis with libflite;
#N canvas 0 0 450 300 (subpatch) 0;
#X array words2 109628 float 0;
#X coords 0 1 109627 -1 100 70 1;
#X array words2 1.60234e+07 float 0;
#X coords 0 1 1.60234e+07 -1 100 70 1;
#X restore 648 276 graph;
#X obj 29 640 print flite-synth-done;
#X text 51 35 ARRAYNAME - initial array name;
Expand Down Expand Up @@ -132,6 +132,8 @@ playing., f 46;
#X connect 2 0 1 0;
#X coords 0 -1 1 1 90 25 2 100 100;
#X restore 369 408 pd get-voices;
#X obj 698 226 noise~;
#X obj 698 247 *~ 0.1;
#X connect 9 0 62 0;
#X connect 10 0 62 0;
#X connect 11 0 62 0;
Expand Down Expand Up @@ -170,3 +172,5 @@ playing., f 46;
#X connect 62 0 2 0;
#X connect 63 0 16 0;
#X connect 63 0 16 1;
#X connect 67 0 68 0;
#X connect 68 0 16 1;
34 changes: 18 additions & 16 deletions flite.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,24 @@ static void flite_synth(t_flite *x) {
cst_wave_resample(x->wave,sys_getsr());








clock_delay(x->x_clock, 0);

//return;
}

/*--------------------------------------------------------------------
* flite_clock_tick : clock
*--------------------------------------------------------------------*/

static void flite_clock_tick(t_flite *x)
{

/*----------- <fooblock> : if I place all this "fooblock" in the clock function
*------------------------------I get audio pops even in not graphical arrays */

Expand Down Expand Up @@ -211,22 +229,6 @@ static void flite_synth(t_flite *x) {
x->x_inprogress = 0;

/*------------- </ fooblock> */





clock_delay(x->x_clock, 0);

//return;
}

/*--------------------------------------------------------------------
* flite_clock_tick : clock
*--------------------------------------------------------------------*/

static void flite_clock_tick(t_flite *x)
{

outlet_bang(x->x_bangout);

Expand Down

0 comments on commit c032258

Please sign in to comment.