Perhaps Miller would have a better answer but I try: When the graph is compiled, the dsp_phase value is used to set up the x_phase value of the block. Thereafter, this x_phase value is used to determine if the block should be performed or not. So I didn't test it but perhaps should try to use it with several subpatches with their own block sizes. For example, if the block size of a subpatch is 128 samples, then perhaps you'll stop the dsp in the main process at 64 samples before this subpatch was performed and when you'll restart the dsp, the block will wait only 64 samples (instead of 128) to execute its chain because dsp_phase%128 would be 64.
2016-11-18 14:12 GMT+01:00 Nicolas Danet nicolas.danet@free.fr:
Hi,
Ah Ah, you are right... but that is precisely the part i understand ;-)
In all the tests i did, at the time it initializes the block value phase, the (dsp_phase % block_size) result is always zero (ditto for inlet prolog). The only code where it is not zero is in the outlet epilog at < https://sourceforge.net/p/pure-data/pure-data/ci/master/ tree/src/g_io.c#l518 >. But the result seems weird.
a/ i did a mistake in my modified code. b/ it is used only by the one shot dsp-chain feature (that i removed in my code). c/ it doesn't do anything. d/ ...
Anyway, thanks for your reply.
e/ I will try to remove that stuff and wait for an hypothetical crash!
----- Mail d'origine ----- De: Pierre Guillot guillotpierre6@gmail.com À: Nicolas Danet nicolas.danet@free.fr Cc: pd-dev@lists.iem.at Envoyé: Fri, 18 Nov 2016 13:37:20 +0100 (CET) Objet: Re: [PD-dev] More info about dsp_phase in d_ugen.c
Hi Nicolas, I'm not sure but I think it's the total amount of dsp ticks since the opening of PD and it's mostly used by the block objects to know when to run their DSP blocks (something like if dsp_phase%block_size==0 then perform).
2016-11-18 7:55 GMT+01:00 Nicolas Danet nicolas.danet@free.fr:
Hello,
I really have hard time to understand what's the dsp_phase variable (d_ugen.c) is supposed to do. I obtain always zero or weird values in the prolog / epilog calls. Is it related to the one shot tick feature provided by the block object? Thanks for clues or links to any information/discussion.
< https://sourceforge.net/p/pure-data/pure-data/ci/master/ tree/src/d_ugen.c#l101 > < https://sourceforge.net/p/pure-data/pure-data/ci/master/ tree/src/g_io.c#l518 >
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
That's true, i probably need to make more extensive tests. Now i see why that state is absolutely required (and why throwing it away is a no go). TBH what's put me in trouble was the inlet/outlets codes. It looks very complex. I'll investigate more.
----- Mail d'origine ----- De: Pierre Guillot guillotpierre6@gmail.com À: Nicolas Danet nicolas.danet@free.fr Cc: pd-dev@lists.iem.at Envoyé: Fri, 18 Nov 2016 14:32:36 +0100 (CET) Objet: Re: Re : Re: [PD-dev] More info about dsp_phase in d_ugen.c
Perhaps Miller would have a better answer but I try: When the graph is compiled, the dsp_phase value is used to set up the x_phase value of the block. Thereafter, this x_phase value is used to determine if the block should be performed or not. So I didn't test it but perhaps should try to use it with several subpatches with their own block sizes. For example, if the block size of a subpatch is 128 samples, then perhaps you'll stop the dsp in the main process at 64 samples before this subpatch was performed and when you'll restart the dsp, the block will wait only 64 samples (instead of 128) to execute its chain because dsp_phase%128 would be 64.
2016-11-18 14:12 GMT+01:00 Nicolas Danet nicolas.danet@free.fr:
Hi,
Ah Ah, you are right... but that is precisely the part i understand ;-)
In all the tests i did, at the time it initializes the block value phase, the (dsp_phase % block_size) result is always zero (ditto for inlet prolog). The only code where it is not zero is in the outlet epilog at < https://sourceforge.net/p/pure-data/pure-data/ci/master/ tree/src/g_io.c#l518 >. But the result seems weird.
a/ i did a mistake in my modified code. b/ it is used only by the one shot dsp-chain feature (that i removed in my code). c/ it doesn't do anything. d/ ...
Anyway, thanks for your reply.
e/ I will try to remove that stuff and wait for an hypothetical crash!
----- Mail d'origine ----- De: Pierre Guillot guillotpierre6@gmail.com À: Nicolas Danet nicolas.danet@free.fr Cc: pd-dev@lists.iem.at Envoyé: Fri, 18 Nov 2016 13:37:20 +0100 (CET) Objet: Re: [PD-dev] More info about dsp_phase in d_ugen.c
Hi Nicolas, I'm not sure but I think it's the total amount of dsp ticks since the opening of PD and it's mostly used by the block objects to know when to run their DSP blocks (something like if dsp_phase%block_size==0 then perform).
2016-11-18 7:55 GMT+01:00 Nicolas Danet nicolas.danet@free.fr:
Hello,
I really have hard time to understand what's the dsp_phase variable (d_ugen.c) is supposed to do. I obtain always zero or weird values in the prolog / epilog calls. Is it related to the one shot tick feature provided by the block object? Thanks for clues or links to any information/discussion.
< https://sourceforge.net/p/pure-data/pure-data/ci/master/ tree/src/d_ugen.c#l101 > < https://sourceforge.net/p/pure-data/pure-data/ci/master/ tree/src/g_io.c#l518 >
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev