b a r t o n | 1 Feb 08:27 2005

Re: [UNANSWERED] Question on adding new files to source

Yes I was adding the files to XCode.

I understand that remote debugging is difficult - I am going to see a 
friend in Palo Alto on Friday who is much more knowledgeable than I 
regarding Mac development, so will be trying to resolve that bug at 
that time.

Once I have the code fully integrated and working I will let you know.

Barton

On Jan 30, 2005, at 1:02 PM, James McCartney wrote:

>
> It is hard to determine what your problem is remotely. I assume you
> added Stack.h to the Xcode project.
>
> On Jan 29, 2005, at 8:31 PM, b a r t o n wrote:
>
>> I posted a question to the list about how to finalize the code I wrote
>> for SC3 on the 20 January. I have not received any responses. The
>> process for contributing to this project remains a mystery as does the
>> question of why adding a new set of files which compile in another
>> project breaks the compilation.
>>
>> I'm sure everyone is very busy with their own priorities but would
>> appreciate it if someone more knowledgeable about SC3 than myself
>> could take the time to help me out.
>>
>> Regards,
(Continue reading)

Till Bovermann | 2 Feb 13:57 2005

[approve] Color-asHSV

Hey,

I want to add this

+ Color {

	asHSV {
	var max, min, delta, hue, sat, val;
		
	max = [red,green,blue].maxItem;
       	min = [red,green,blue].minItem;
         	delta = max - min;
         	if (red == max, {hue = (green - blue) / delta});
         	if (green == max, {hue = (blue - red) / delta + 2});
         	if (blue == max, {hue = (red - green) / delta + 4});
         	hue = hue/6;
         	if (hue < 0, {hue = hue + 1});
         	sat = delta / max;
         	val = max;
	^[hue, sat, val, alpha]
	}
}

to the Color class.

any comments/suggestions?

regards
Till

(Continue reading)

Till Bovermann | 2 Feb 14:21 2005

Re: [approve] Color-asHSV

Sorry,

this is the correct verison (nan_error...)

---snip---
+ Color {

	asHSV {
		var max, min, delta, hue, sat, val;
		
		max = [red,green,blue].maxItem;
       	min = [red,green,blue].minItem;
	    	delta = max - min;
		if (delta == 0, {
			hue = 0;
		},{
	         	if (red == max, {hue = (green - blue) / delta});
	         	if (green == max, {hue = ((blue - red) / delta) + 2});
	         	if (blue == max, {hue = ((red - green) / delta) + 4});
		});
         	hue = hue/6;
         	if (hue < 0, {hue = hue + 1});
         	sat = delta / max;
         	val = max;
		^[hue, sat, val, alpha]
	}
}
---snap---

and the source:
(Continue reading)

Julian Rohrhuber | 2 Feb 15:35 2005
Picon

Re: [approve] Color-asHSV


trying the following:

(
a = Color.rand;
x = a.asHSV;
z = Color(*x);

[z, a]
)

I get a fairly large difference. Is that due to the incompatibility of the
color spaces?

>Sorry,
>
>this is the correct verison (nan_error...)
>
>---snip---
>+ Color {
>
>	asHSV {
>		var max, min, delta, hue, sat, val;
>
>		max = [red,green,blue].maxItem;
>       	min = [red,green,blue].minItem;
>	    	delta = max - min;
>		if (delta == 0, {
>			hue = 0;
>		},{
(Continue reading)

Till Bovermann | 2 Feb 16:22 2005

Re: [approve] Color-asHSV

No.

try this instead ;-)

(
a = Color.rand;
x = a.asHSV;
z = Color.hsv(*x);

[z, a]
)

Color represents the color as rgb internal. Color.new() uses r g b 
values.
You set them as h s v...
The Color.hcv() class method does what you want.

regards
Till

On 02 Feb 2005, at 15:35, Julian Rohrhuber wrote:

>
> trying the following:
>
> (
> a = Color.rand;
> x = a.asHSV;
> z = Color(*x);
>
(Continue reading)

James Harkins | 2 Feb 19:54 2005
Picon

[approve] doneAction: 13

I was just working on doneAction:13.

http://www.create.ucsb.edu/pipermail/sc-users/2005-January/015754.html

It now works locally on my build (tested with the scenario posted on 
list), nothing committed yet. I'm just posting code for approval, but I 
don't expect there will be any changes needed.

Suggestions? Thanks.
hjh

In SC_Node.cpp, Unit_DoneAction:

			// added by hjh: free all nodes within group
			// group remains in place
		case 13 :
		{
			Node* node = &unit->mParent->mNode;
			Node* next = node->mNext;
			while (node) {
				Node *prev = node->mPrev;
				Node_End(node);
				node = prev;
			};
			node = next;
			while (node) {
				Node *next = node->mNext;
				Node_End(node);
				node = next;
			}
(Continue reading)

James Harkins | 2 Feb 19:58 2005
Picon

[commit] fix for bug in Pcollect

Bug: Pcollect works fine if .asStream is called on it, but if it's 
embedded in another stream, the func doesn't get executed.

p = Pseq([Pshuf((1..10), 1).collect(_ * 10), Pshuf((100..109), 1)], 
inf).asStream;
p.nextN(30);
// 1st 10 should be multiples of 10
[ 7, 8, 2, 6, 10, 1, 3, 4, 5, 9, 108, 104, 106, 102, 101, 103, 105, 
107, 100, 109, 6, 5, 9, 2, 10, 8, 3, 4, 1, 7 ]

The fix is simple and will be committed very shortly.

In the file "embed methods.sc":

+Pcollect {
	embedInStream { arg inval;
		var stream, outval;
		stream = pattern.asStream;
		loop {
			outval = stream.next(inval);
			if (outval.isNil) { ^inval };
			inval = yield(outval);
		}
	}
}

Should be:

+Pcollect {
	embedInStream { arg inval;
(Continue reading)

James McCartney | 2 Feb 20:09 2005
Picon

Re: [approve] doneAction: 13


On Feb 2, 2005, at 10:54 AM, James Harkins wrote:

> I was just working on doneAction:13.
>
> http://www.create.ucsb.edu/pipermail/sc-users/2005-January/015754.html
>
> It now works locally on my build (tested with the scenario posted on 
> list), nothing committed yet. I'm just posting code for approval, but 
> I don't expect there will be any changes needed.
>
> Suggestions? Thanks.
> hjh
>
> In SC_Node.cpp, Unit_DoneAction:
>
> 			// added by hjh: free all nodes within group
> 			// group remains in place
> 		case 13 :
> 		{
> 			Node* node = &unit->mParent->mNode;
> 			Node* next = node->mNext;
> 			while (node) {
> 				Node *prev = node->mPrev;
> 				Node_End(node);
> 				node = prev;
> 			};
> 			node = next;
> 			while (node) {
> 				Node *next = node->mNext;
(Continue reading)

James McCartney | 2 Feb 20:11 2005
Picon

Re: [approve] Color-asHSV


ok

On Feb 2, 2005, at 5:21 AM, Till Bovermann wrote:

> this is the correct verison (nan_error...)
>
> ---snip---
> + Color {
>
> 	asHSV {
> 		var max, min, delta, hue, sat, val;
> 		
> 		max = [red,green,blue].maxItem;
>        	min = [red,green,blue].minItem;
> 	    	delta = max - min;
> 		if (delta == 0, {
> 			hue = 0;
> 		},{
> 	         	if (red == max, {hue = (green - blue) / delta});
> 	         	if (green == max, {hue = ((blue - red) / delta) + 2});
> 	         	if (blue == max, {hue = ((red - green) / delta) + 4});
> 		});
>          	hue = hue/6;
>          	if (hue < 0, {hue = hue + 1});
>          	sat = delta / max;
>          	val = max;
> 		^[hue, sat, val, alpha]
> 	}
> }
(Continue reading)

Julian Rohrhuber | 2 Feb 23:34 2005
Picon

Re: [approve] Color-asHSV

>No.
>
>try this instead ;-)
>
>(
>a = Color.rand;
>x = a.asHSV;
>z = Color.hsv(*x);
>
>[z, a]
>)

>Color represents the color as rgb internal. Color.new() uses r g b values.
>You set them as h s v...
>The Color.hcv() class method does what you want.

I knew something was wrong..
--

-- 

.

Gmane