[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] For a more tolerant PlayBuf



2013/12/12 Julian Rohrhuber <julian.rohrhuber@xxxxxxxxxxxxxxxxxx>:
>
> On 12.12.2013, at 22:31, Dan Stowell <danstowell+sc3@xxxxxxxxx> wrote:
>
>> 2013/12/12 Julian Rohrhuber <julian.rohrhuber@xxxxxxxxxxxxxxxxxx>:
>>>
>>> On 12.12.2013, at 21:21, Dan Stowell <danstowell+sc3@xxxxxxxxx> wrote:
>>>
>>>> 2013/12/12 Julian Rohrhuber <julian.rohrhuber@xxxxxxxxxxxxxxxxxx>:
>>>>>
>>>>> On 12.12.2013, at 19:48, Scott Wilson <i@xxxxxxxxxxxxxx> wrote:
>>>>>
>>>>>> Would this be a good case for the rarely seen /cmd? We could turn this functionality and/or a warning on and off.
>>>>>
>>>>> Ah good idea - is there an example usage somewhere?
>>>>
>>>> Warning on by default please! There's some quite good stuff in the
>>>> right-hand channel of my stereo soundfiles ;)
>>>
>>> well what would you expect when you write:
>>> PlayBuf.ar(1, buf)
>>>
>>> Maybe you'd expect a mixdown?
>>
>> Not really - in some systems that would be a great idea, but it's not
>> really SC style. Instead I'd expect SC to remind me that I'm
>> potentially making a mistake. Whether that's in the form of an error
>> (as now) or a warning I don't mind.
>
> OK, I see, for now I'll just hardcode the warning. I was mainly asking because in many other cases, SC would assume that you knew what you were doing. Say you have a function:
>
> f = { |x| x * [1, 1.2] };
>
> and you call it:
>
> f.value([1, 1, 1]);
>
> You wouldn't expect this to throw a warning.
>
> Even Pan2 doesn't warn when you pass it an array (this is good).
>
> Maybe Buffer.read should throw a warning instead?
>
> I don't want to insist, it just doesn't seem as clear for me that you need to be warned.

I don't want to insist either :) but the argument from consistency is
kinda difficult sometimes in SC...

s.boot;
b = Buffer.alloc(s, 7);
b.set(18, 77); // FAILURE IN SERVER /b_set index out of range
b.setn((3..33)); // no error
b.getn(0, 12, (_.postln)); // FAILURE IN SERVER /b_getn index out of range


Anyway, I do just think the risk of user error is quite high if
channels are silently dropped by default when playing buffers, so
that's why my vote is that way.

Dan
-- 
http://www.mcld.co.uk

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/