Csound Csound-dev Csound-tekno Search About

[Csnd] Udo and tables

Date2010-07-08 01:28
Fromalgodon
Subject[Csnd] Udo and tables
Hello,

Is there a more efficient way of defining the following simplified udo that
I use as an array of tables ? I need to use several similar udos and I don't
want to load each table in the memory.

opcode Array1,i,i

inumber xin

;default table
ireturn ftgentmp
0,0,16,-2,0.25,189.0,0.5693443418,-170.0,145.0,-545.0,1150.0,170.0,745.0,-55.0,395.0,-520.0,-1130.0,-1140.0,370.0

if inumber == 0 then 
iretour ftgentmp
0,0,16,-2,0.25,391.0,0.1453588009,295.0,450.0,605.0,-1115.0,-1175.0,-570.0,825.0,365.0,205.0,-135.0,-290.0,-35.0

elseif inumber == 1 then
ireturn ftgentmp
0,0,16,-2,0.5,814.0,0.7337720394,1140.0,-730.0,180.0,740.0,545.0,895.0,305.0,435.0,-310.0,910.0,-1010.0,-735.0

elseif inumber == 2 then
ireturn ftgentmp
0,0,16,-2,2.75,795.0,0.6835337281,-1075.0,-140.0,-210.0,815.0,200.0,-610.0,50.0,-25.0,550.0,-585.0,630.0,370.0

elseif inumber == 3 then
ireturn ftgentmp
0,0,16,-2,3.0,824.0,0.1787540019,-350.0,-355.0,1155.0,-370.0,295.0,550.0,-995.0,-525.0,285.0,-925.0,-365.0,-140.0
endif

xout ireturn

endop

Thanks



-----
http://www.myspace.com/algodonciego

Date2010-07-08 03:06
FromSteven Yi
Subject[Csnd] Re: Udo and tables
I think the tricky part of what you're wanting to do is only loading
each table on demand.  Even in another programming language like C or
Python, loading an array on demand is going to involve some ugly code.

I'd probably just code to load each table into memory if the tables
are like these (16 length), and put the table numbers themselves in
another ftable. However, if your other array tables involve very large
data (long waveforms); is that the case?


On Wed, Jul 7, 2010 at 8:28 PM, algodon  wrote:
>
> Hello,
>
> Is there a more efficient way of defining the following simplified udo that
> I use as an array of tables ? I need to use several similar udos and I don't
> want to load each table in the memory.
>
> opcode Array1,i,i
>
> inumber xin
>
> ;default table
> ireturn ftgentmp
> 0,0,16,-2,0.25,189.0,0.5693443418,-170.0,145.0,-545.0,1150.0,170.0,745.0,-55.0,395.0,-520.0,-1130.0,-1140.0,370.0
>
> if inumber == 0 then
> iretour ftgentmp
> 0,0,16,-2,0.25,391.0,0.1453588009,295.0,450.0,605.0,-1115.0,-1175.0,-570.0,825.0,365.0,205.0,-135.0,-290.0,-35.0
>
> elseif inumber == 1 then
> ireturn ftgentmp
> 0,0,16,-2,0.5,814.0,0.7337720394,1140.0,-730.0,180.0,740.0,545.0,895.0,305.0,435.0,-310.0,910.0,-1010.0,-735.0
>
> elseif inumber == 2 then
> ireturn ftgentmp
> 0,0,16,-2,2.75,795.0,0.6835337281,-1075.0,-140.0,-210.0,815.0,200.0,-610.0,50.0,-25.0,550.0,-585.0,630.0,370.0
>
> elseif inumber == 3 then
> ireturn ftgentmp
> 0,0,16,-2,3.0,824.0,0.1787540019,-350.0,-355.0,1155.0,-370.0,295.0,550.0,-995.0,-525.0,285.0,-925.0,-365.0,-140.0
> endif
>
> xout ireturn
>
> endop
>
> Thanks
>
>
>
> -----
> http://www.myspace.com/algodonciego
> --
> View this message in context: http://old.nabble.com/Udo-and-tables-tp29100007p29100007.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-07-09 08:37
Fromalgodon
Subject[Csnd] Re: Udo and tables
My array tables involve small data, but I plan to use a large number of them.
I'm designing  a csound installation that should run for hours and the array
tables provide pitch patterns, duration patterns, filtering patterns... So
far, my udos work well with a small scale installation but I want to be sure
that a bigger installation will run flawlessly and that the lack of memory
won't be a problem.
That's the reason why I don't want to load all the tables in memory but only
when they are needed.


Steven Yi wrote:
> 
> I think the tricky part of what you're wanting to do is only loading
> each table on demand.  Even in another programming language like C or
> Python, loading an array on demand is going to involve some ugly code.
> 
> I'd probably just code to load each table into memory if the tables
> are like these (16 length), and put the table numbers themselves in
> another ftable. However, if your other array tables involve very large
> data (long waveforms); is that the case?
> 
> 
> On Wed, Jul 7, 2010 at 8:28 PM, algodon  wrote:
>>
>> Hello,
>>
>> Is there a more efficient way of defining the following simplified udo
>> that
>> I use as an array of tables ? I need to use several similar udos and I
>> don't
>> want to load each table in the memory.
>>
>> opcode Array1,i,i
>>
>> inumber xin
>>
>> ;default table
>> ireturn ftgentmp
>> 0,0,16,-2,0.25,189.0,0.5693443418,-170.0,145.0,-545.0,1150.0,170.0,745.0,-55.0,395.0,-520.0,-1130.0,-1140.0,370.0
>>
>> if inumber == 0 then
>> iretour ftgentmp
>> 0,0,16,-2,0.25,391.0,0.1453588009,295.0,450.0,605.0,-1115.0,-1175.0,-570.0,825.0,365.0,205.0,-135.0,-290.0,-35.0
>>
>> elseif inumber == 1 then
>> ireturn ftgentmp
>> 0,0,16,-2,0.5,814.0,0.7337720394,1140.0,-730.0,180.0,740.0,545.0,895.0,305.0,435.0,-310.0,910.0,-1010.0,-735.0
>>
>> elseif inumber == 2 then
>> ireturn ftgentmp
>> 0,0,16,-2,2.75,795.0,0.6835337281,-1075.0,-140.0,-210.0,815.0,200.0,-610.0,50.0,-25.0,550.0,-585.0,630.0,370.0
>>
>> elseif inumber == 3 then
>> ireturn ftgentmp
>> 0,0,16,-2,3.0,824.0,0.1787540019,-350.0,-355.0,1155.0,-370.0,295.0,550.0,-995.0,-525.0,285.0,-925.0,-365.0,-140.0
>> endif
>>
>> xout ireturn
>>
>> endop
>>
>> Thanks
>>
>>
>>
>> -----
>> http://www.myspace.com/algodonciego
>> --
>> View this message in context:
>> http://old.nabble.com/Udo-and-tables-tp29100007p29100007.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
> 
> 
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
> 
> 
> 


-----
http://www.myspace.com/algodonciego
-- 
View this message in context: http://old.nabble.com/Udo-and-tables-tp29100007p29114880.html
Sent from the Csound - General mailing list archive at Nabble.com.



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-07-09 13:31
FromMichael Gogins
Subject[Csnd] Re: Re: Udo and tables
How much memory will you need, and how much is available on the machine?

Usually, I find, a contemporary personal computer has scads more
memory than Csound uses. Suppose you have 2 gigabytes available in the
heap (this would be the case if you have 4 gigabytes or more on the
machine). Then you can have 30,000 64 kilobyte function tables. I'm
guessing your tables are smaller, and you don't need that many. With a
few thousand tables you can just forget about it.

Regards,
Mike

On Fri, Jul 9, 2010 at 3:37 AM, algodon  wrote:
>
> My array tables involve small data, but I plan to use a large number of them.
> I'm designing  a csound installation that should run for hours and the array
> tables provide pitch patterns, duration patterns, filtering patterns... So
> far, my udos work well with a small scale installation but I want to be sure
> that a bigger installation will run flawlessly and that the lack of memory
> won't be a problem.
> That's the reason why I don't want to load all the tables in memory but only
> when they are needed.
>
>
> Steven Yi wrote:
>>
>> I think the tricky part of what you're wanting to do is only loading
>> each table on demand.  Even in another programming language like C or
>> Python, loading an array on demand is going to involve some ugly code.
>>
>> I'd probably just code to load each table into memory if the tables
>> are like these (16 length), and put the table numbers themselves in
>> another ftable. However, if your other array tables involve very large
>> data (long waveforms); is that the case?
>>
>>
>> On Wed, Jul 7, 2010 at 8:28 PM, algodon  wrote:
>>>
>>> Hello,
>>>
>>> Is there a more efficient way of defining the following simplified udo
>>> that
>>> I use as an array of tables ? I need to use several similar udos and I
>>> don't
>>> want to load each table in the memory.
>>>
>>> opcode Array1,i,i
>>>
>>> inumber xin
>>>
>>> ;default table
>>> ireturn ftgentmp
>>> 0,0,16,-2,0.25,189.0,0.5693443418,-170.0,145.0,-545.0,1150.0,170.0,745.0,-55.0,395.0,-520.0,-1130.0,-1140.0,370.0
>>>
>>> if inumber == 0 then
>>> iretour ftgentmp
>>> 0,0,16,-2,0.25,391.0,0.1453588009,295.0,450.0,605.0,-1115.0,-1175.0,-570.0,825.0,365.0,205.0,-135.0,-290.0,-35.0
>>>
>>> elseif inumber == 1 then
>>> ireturn ftgentmp
>>> 0,0,16,-2,0.5,814.0,0.7337720394,1140.0,-730.0,180.0,740.0,545.0,895.0,305.0,435.0,-310.0,910.0,-1010.0,-735.0
>>>
>>> elseif inumber == 2 then
>>> ireturn ftgentmp
>>> 0,0,16,-2,2.75,795.0,0.6835337281,-1075.0,-140.0,-210.0,815.0,200.0,-610.0,50.0,-25.0,550.0,-585.0,630.0,370.0
>>>
>>> elseif inumber == 3 then
>>> ireturn ftgentmp
>>> 0,0,16,-2,3.0,824.0,0.1787540019,-350.0,-355.0,1155.0,-370.0,295.0,550.0,-995.0,-525.0,285.0,-925.0,-365.0,-140.0
>>> endif
>>>
>>> xout ireturn
>>>
>>> endop
>>>
>>> Thanks
>>>
>>>
>>>
>>> -----
>>> http://www.myspace.com/algodonciego
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Udo-and-tables-tp29100007p29100007.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>>
>
>
> -----
> http://www.myspace.com/algodonciego
> --
> View this message in context: http://old.nabble.com/Udo-and-tables-tp29100007p29114880.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-07-16 11:11
FromAlgodon
Subject[Csnd] Re: Re: Udo and tables
Thank you both for your advice. I rewrote my routines and found that it was
easier to load all my tables at once rather than load them at will.


-----
www.myspace.com/algodonciego