initializing classes

[email protected]
Newsgroups gmane.comp.audio.supercollider.user
Message-ID <[email protected]>
Hello, 

I´m trying to sort my objects, and would like to do that using Classes, but can’t get one thing right: 

This way I can’t initialize variables when creating the object:

MyClass : MySuperClass{
	var <>midinote = #[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
	var <>dur = 1;
	var <>legato=#[1, 0.1, 1];
	}
}

This way it works, but then I have to initialize ALL variables, otherwise they are nil

MyClass : MySuperClass{
	var <>midinote = #[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
	var <>dur = 1;
	var <>legato=#[1, 0.1, 1];

	*new { |midinote, dur, legato
		^super.newCopyArgs(midinote,dur, legato)
	}
}


Any hints how to make it work? 

Thanks and all the best, 

Maciej 

www.gamutinc.org <http://www.gamutinc.org/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.