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

Re: [sc-users] more dumb stream questions




just in case you don't know, arrays in sc are indexed beginning with 0
not 1.

Yes. So I skip 0 and start with 1 for clarity. In fact, there are 53 patterns.


your array should be an array of 53 elements in that case.

that's a very bad habit which you do best to discard.
for instance, when you iterate over the array with do
you are iterating over a nil element, that is a waste
of time, but more importantly it means if you wanted
send say the message 'floor' to all the objects you'd have
a nil there telling you it doesn't understand the message.

this kind of code is extremely common in sc:

a.do({ arg item;
	item.floor;
})

and lastly if you share your code with others it will be less, not more clear.

2¢,
_c