« Return to Thread: Buffer-accessing units fail silently; maybe less silent?

Re: Buffer-accessing units fail silently; maybe less silent?

by Josh Parmenter :: Rate this Message:

Reply to Author | View in Thread

great!

Josh

On Apr 28, 2008, at 8:07 AM, Dan Stowell wrote:

> Hi -
>
>> From the PlayBuf helpfile: "warning: if you supply a bufnum of a
> buffer that has a different numChannels then you have specified to the
> PlayBuf, it will fail silently."
>
> Why silently? Wouldn't it be more helpful to warn?
>
> Here's a patch that adds a warning (to the macros used by PlayBuf,
> BufRd, RecordBuf, BufWr, ScopeOut). Warning can be suppressed using
> server verbosity flag. Thoughts?
>
> Dan
>
>
> Index: /Users/danstowell/SuperCollider3/source/plugins/DelayUGens.cpp
> ===================================================================
> --- /Users/danstowell/SuperCollider3/source/plugins/DelayUGens.cpp
> (revision 7343)
> +++ /Users/danstowell/SuperCollider3/source/plugins/DelayUGens.cpp
> (working copy)
> @@ -609,6 +609,9 @@
> #define SETUP_OUT \
>        uint32 numOutputs = unit->mNumOutputs; \
>        if (numOutputs > bufChannels) { \
> +               if(unit->mWorld->mVerbosity > -1 && !unit->mDone){ \
> +                       Print("buffer-reading unit channel mismatch:
> numOutputs %i, buf has %i channels\n", numOutputs, bufChannels); \
> +               } \
>                 unit->mDone = true; \
>                ClearUnitOutputs(unit, inNumSamples); \
>                return; \
> @@ -619,6 +622,9 @@
> #define SETUP_IN(offset) \
>        uint32 numInputs = unit->mNumInputs - (uint32)offset; \
>        if (numInputs != bufChannels) { \
> +               if(unit->mWorld->mVerbosity > -1 && !unit->mDone){ \
> +                       Print("buffer-writing unit channel mismatch:
> numInputs %i, buf has %i channels\n", numInputs, bufChannels); \
> +               } \
>                 unit->mDone = true; \
>                ClearUnitOutputs(unit, inNumSamples); \
>                return; \
> <
> WarnChannelMismatch
> .patch.txt>_______________________________________________
> Sc-devel mailing list
> Sc-devel@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own  
interpretation of how modern society is structured: whether actively  
or passively, consciously or unconsciously, he makes choices in this  
regard. He may be conservative or he may subject himself to continual  
renewal; or he may strive for a revolutionary, historical or social  
palingenesis." - Luigi Nono
*/

_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

 « Return to Thread: Buffer-accessing units fail silently; maybe less silent?

LightInTheBox - Buy quality products at wholesale price