[PD] Re: pyext problem?

Michael Iber music at chemie.fu-berlin.de
Thu Jun 1 00:45:05 CEST 2006


Thank you Thomas and Frank.
Your solution, Frank, would have too much impact on too many other 
aspects of my project ....
I found another solution ....
Best,
Michael





Frank Barknecht wrote:
>Hallo,
>Frank Barknecht hat gesagt: // Frank Barknecht wrote:
>
>  
>>I think, for Michael's code it would be better to make "orchestra" a
>>real list of "Instrument"s like: 
>>
>>orchestra1 = [ ['x1','a',1], ['x2','c',11] ] # changed!
>>orchestra = []
>>
>>for i in orchestra1:
>>    tmp = Instrument(i[0], i[1], i[2])
>>    orchestra.append(tmp)
>>
>>
>>Then in the pyext class use in float_1 something like:
>>
>>    orchestra[index].setVal(f)
>>    
>
>I forgot to say: In this case, orchestra should be a class member
>like:
>
>class whatever(pyext._class):
>    
>    def __init__(self, archestra):
>        self.orchestra = []
>        for i in archestra:
>            tmp = Instrument(i[0], i[1], i[2])
>            self.orchestra.append(tmp)
>
>    def float_1(self,f):
>        if f > 10:
>            self.orchestra[0].setVal = f
>        else:
>            self.orchestra[1].setVal = f
>
>
>Ciao
>  

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: doesnt.py
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060601/747bfb06/attachment.txt>


More information about the Pd-list mailing list