Dan Stowell | 1 May 2007 14:13
Picon

[Propose] ArrayedCollection:plot can accept array arguments to minval & maxval

Hi -

I often collect data into multichannel Buffers and then use
Buffer:plot to view them. However, if the ranges of the channels are
very different this isn't easy because the scaling is the same for
each channel (even with user-specified minval/maxval). Yes, I could
re-scale the values manually before writing to the Buffer. But that's
the wrong way to go about it when for example you want one channel to
be frequency values in Hertz, and one channel to be dB values.

It's a simple modification to allow "minval" and "maxval" to be
arrays, allowing the user to specify different ranges for each
channel. Modified version of GUI/PlusGUI/Math/SignalPlusGUI.sc
attached (also a patch; not sure which format people prefer in
general).

Example:

// 3-channel interlaced data
b = [{1.0.rand}.dup(50), {20.0.rand - 30}.dup(50),
{10.0.rand}.dup(50)].lace(150);

// Compare the results of these two - gives either common or separate rescaling
b.plot(numChannels:3, minval: nil, maxval: nil);
b.plot(numChannels:3, minval: [nil, nil, nil], maxval: [nil, nil, nil]);

Any thoughts on this? Would like to commit if acceptable.

Dan
(Continue reading)

Dan Stowell | 2 May 2007 12:23
Picon

[commit] RecordBuf/PlayBuf macro bug

Hi -

In the following examples, setting the number of channels to any
number higher than 19 crashes my SC server. The apparent reason, and a
suggested fix, is below...

// Rec
s.boot;
~chans = 19;
b = Buffer.alloc(s, 250, ~chans);
(
x = {
	RecordBuf.ar({LFNoise1.ar}.dup(~chans), b.bufnum)
}.play;
)
x.free;

// Playback
s.boot;
~chans = 19;
b = Buffer.alloc(s, 250, ~chans);
(
x = {
	PlayBuf.ar(~chans, b.bufnum)
}.play;
)
x.free;

It seems to be because the SETUP_OUT and SETUP_IN macros in
DelayUGens.cpp define output/input arrays hard-coded to a size of 16.
(Continue reading)

Sciss | 2 May 2007 12:37
Picon
Gravatar

Re: [commit] RecordBuf/PlayBuf macro bug

i had posted this ago (it also affects BufRd):

http://www.create.ucsb.edu/pipermail/sc-dev/2006-July/thread.html#10534

james mccartney said float *out[numOutputs]; is not proper C++, i  
don't know ... would be cool to fix anyways!

ciao, -sciss-


Am 02.05.2007 um 12:23 schrieb Dan Stowell:

> Hi -
>
> In the following examples, setting the number of channels to any
> number higher than 19 crashes my SC server. The apparent reason, and a
> suggested fix, is below...
>
> // Rec
> s.boot;
> ~chans = 19;
> b = Buffer.alloc(s, 250, ~chans);
> (
> x = {
> 	RecordBuf.ar({LFNoise1.ar}.dup(~chans), b.bufnum)
> }.play;
> )
> x.free;
>
>
(Continue reading)

Sciss | 2 May 2007 18:19
Picon
Gravatar

Re: [commit] RecordBuf/PlayBuf macro bug

p.s. also this comment :

http://www.create.ucsb.edu/pipermail/sc-dev/2006-July/010597.html

so if it's really not portable, maybe for now increase all hardcoded  
max chan.nums to like 128 and put that info in the help files so  
people know about possible problems >128 ? if you go commit something  
could you check the other examples i had posted (BufRd, PanAz ... ) -  
thanks

ciao, -sciss-


Am 02.05.2007 um 12:37 schrieb Sciss:

> i had posted this ago (it also affects BufRd):
>
> http://www.create.ucsb.edu/pipermail/sc-dev/2006-July/ 
> thread.html#10534
>
> james mccartney said float *out[numOutputs]; is not proper C++, i  
> don't know ... would be cool to fix anyways!
>
> ciao, -sciss-
>
>
> Am 02.05.2007 um 12:23 schrieb Dan Stowell:
>
>> Hi -
>>
(Continue reading)

Dan Stowell | 2 May 2007 23:57
Picon

Re: [commit] RecordBuf/PlayBuf macro bug

OK, thanks for pointing out the previous discussion.

Better solution, then: PlayBuf, RecordBuf and their friends should
RTAlloc the "out"/"in" arrays, rather than creating them every time
_next is called.

If this sounds OK I'll prepare a patch. (The UGens will need Dtors etc
so it'll be a bit more of a change.)

Dan

2007/5/2, Sciss <contact@...>:
> p.s. also this comment :
>
> http://www.create.ucsb.edu/pipermail/sc-dev/2006-July/010597.html
>
> so if it's really not portable, maybe for now increase all hardcoded
> max chan.nums to like 128 and put that info in the help files so
> people know about possible problems >128 ? if you go commit something
> could you check the other examples i had posted (BufRd, PanAz ... ) -
> thanks
>
> ciao, -sciss-
>
>
> Am 02.05.2007 um 12:37 schrieb Sciss:
>
> > i had posted this ago (it also affects BufRd):
> >
> > http://www.create.ucsb.edu/pipermail/sc-dev/2006-July/
(Continue reading)

Dan Stowell | 3 May 2007 14:00
Picon

Re: [Propose] ArrayedCollection:plot can accept array arguments to minval & maxval

Committed. Also added general help doc for the "plot" method.

Dan

2007/5/1, Dan Stowell <danstowell@...>:
> Hi -
>
> I often collect data into multichannel Buffers and then use
> Buffer:plot to view them. However, if the ranges of the channels are
> very different this isn't easy because the scaling is the same for
> each channel (even with user-specified minval/maxval). Yes, I could
> re-scale the values manually before writing to the Buffer. But that's
> the wrong way to go about it when for example you want one channel to
> be frequency values in Hertz, and one channel to be dB values.
>
> It's a simple modification to allow "minval" and "maxval" to be
> arrays, allowing the user to specify different ranges for each
> channel. Modified version of GUI/PlusGUI/Math/SignalPlusGUI.sc
> attached (also a patch; not sure which format people prefer in
> general).
>
>
> Example:
>
> // 3-channel interlaced data
> b = [{1.0.rand}.dup(50), {20.0.rand - 30}.dup(50),
> {10.0.rand}.dup(50)].lace(150);
>
> // Compare the results of these two - gives either common or separate rescaling
> b.plot(numChannels:3, minval: nil, maxval: nil);
(Continue reading)

joshpar | 6 May 2007 17:17
Picon

SF.net SVN: supercollider: [5991] trunk/build/Help/UGens/Control/Control. html

Revision: 5991
          http://svn.sourceforge.net/supercollider/?rev=5991&view=rev
Author:   joshpar
Date:     2007-05-06 08:17:28 -0700 (Sun, 06 May 2007)

Log Message:
-----------
add Node Object examples

Modified Paths:
--------------
    trunk/build/Help/UGens/Control/Control.html

Modified: trunk/build/Help/UGens/Control/Control.html
===================================================================
--- trunk/build/Help/UGens/Control/Control.html	2007-05-03 11:59:51 UTC (rev 5990)
+++ trunk/build/Help/UGens/Control/Control.html	2007-05-06 15:17:28 UTC (rev 5991)
 <at>  <at>  -12,12 +12,16  <at>  <at> 
 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
-p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #a71e12}
-span.s1 {color: #0019b7}
+p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #92251d}
+p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #606060}
+p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
+span.s1 {color: #0024ae}
 span.s2 {color: #606060}
 span.s3 {color: #000000}
-span.s4 {color: #326f17}
(Continue reading)

Hairi Vogel | 6 May 2007 23:46
Picon

3 bugs

hi. 
trying to deploy a little software i wrote with an older build (PPC) i used the UB version i found on sourceforge (Wesley).
the following bugs occur that are not in the older version:

( var categoryList = [], namesArray = [], linx, arr;


PathName.new("~/*").pathMatch.do({
arg item, i;
var category, name;
category = PathName.new(item).fileName;
("folder"+category).postln; // the variable category is empty
PathName.new(item++"*").pathMatch.do({ arg iitem;
name = PathName.new(iitem).fileName.split(".".first).first;
("\t"++name).postln;
if(categoryList.includes(category),{
linx = categoryList.indexOf(category);
arr = namesArray.at(linx).add(name);
namesArray.put(linx,arr);


},{
categoryList = categoryList.add(category); namesArray = namesArray.add([name]);



});


});
});
)



//**********************
f = { arg ...args; "OK ".post; args.postln; };
g = { arg ...args; "CANCEL ".post; args.postln; };
File.saveDialog(successFunc: f, cancelFunc: g); // the path is not given to the successFunc


this is the same in the old (2006) PPC build

//**********************
s.boot;
r = { arg longparametername = 220, spn = 1;SinOsc.ar(longparametername,spn); }.play
r.get(\spn,{ arg ...args; args.postln; }); // OK
r.get(\longparametername,{ arg ...args; args.postln; }); // never answers


as always yours
hairi



_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://www.create.ucsb.edu/mailman/listinfo/sc-devel
James Harkins | 8 May 2007 03:21
Picon

Re: 3 bugs

Since no one has looked at these yet...

1. I'm not sure this is a bug -- actually, it might have been a bug before. If the pathname is a directory -- "/Users/dewdrop/Applications/" is the first thing that comes up in my installation -- the path is not the name of a specific file, so the filename returned is empty. In that case, folderName would return the last item.

I don't know why the difference in behavior, but I think the current behavior is justifiable.

2. That's a bona fide bug. The method GUI.use was added recently, and it's now used for file dialogs; unfortunately, it doesn't have any mechanism to pass arguments into the function. That qualifies as a design flaw. I can see how to fix it, but sciss is the owner of that code and maybe he would like to take a crack at it first.

3. Looks like a 16 character limitation on synth control names. I'm not sure if that's really a "bug" either, maybe just an undocumented gotcha.

hjh

On May 6, 2007, at 5:46 PM, Hairi Vogel wrote:

the following bugs occur that are not in the older version:

( var categoryList = [], namesArray = [], linx, arr;

PathName.new("~/*").pathMatch.do({
arg item, i;
var category, name;
category = PathName.new(item).fileName;
("folder"+category).postln; // the variable category is empty
PathName.new(item++"*").pathMatch.do({ arg iitem;
name = PathName.new(iitem).fileName.split(".".first).first;
("\t"++name).postln;
if(categoryList.includes(category),{
linx = categoryList.indexOf(category);
arr = namesArray.at(linx).add(name);
namesArray.put(linx,arr);

},{
categoryList = categoryList.add(category); namesArray = namesArray.add([name]);


});

});
});
)



//**********************
f = { arg ...args; "OK ".post; args.postln; };
g = { arg ...args; "CANCEL ".post; args.postln; };
File.saveDialog(successFunc: f, cancelFunc: g); // the path is not given to the successFunc


this is the same in the old (2006) PPC build

//**********************
s.boot;
r = { arg longparametername = 220, spn = 1;SinOsc.ar(longparametername,spn); }.play
r.get(\spn,{ arg ...args; args.postln; }); // OK
r.get(\longparametername,{ arg ...args; args.postln; }); // never answers


: H. James Harkins

: jamshark70-n2XjBy9Frl0FLkkUnhLBSV6hYfS7NtTn@public.gmane.org

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman


_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://www.create.ucsb.edu/mailman/listinfo/sc-devel
Sciss | 8 May 2007 11:25
Picon
Gravatar

Re: 3 bugs

woop, sorry. see attached corrected file. i wonder why for + File  
*openDialog, there is a maximum number of selectable files of 3, but  
the success func is just called with the first path? maybe change the  
max. to 1?

ciao, -sciss-

Am 08.05.2007 um 03:21 schrieb James Harkins:
[...]
>>
>> //**********************
>> f = { arg ...args; "OK ".post; args.postln; };
>> g = { arg ...args; "CANCEL ".post; args.postln; };
>> File.saveDialog(successFunc: f, cancelFunc: g); // the path is not  
>> given to the successFunc
>>

Attachment (FilePlusGUI.sc): application/octet-stream, 500 bytes
_______________________________________________
Sc-devel mailing list
Sc-devel@...
http://www.create.ucsb.edu/mailman/listinfo/sc-devel

Gmane