Kyma Forum
  Kyma Support
  creating array of sampleFileNamesInSameFolder durations

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   creating array of sampleFileNamesInSameFolder durations
Phi Curtis
Member
posted 21 February 2010 17:14         Edit/Delete Message   Reply w/Quote
Hi,

I would like to create an array containing the durations of files in a particular folder.

This is the code I have:

code:

| fileNamesArray durationsArray |

fileNamesArray := {'FilteredPulse' sampleFileNamesInSameFolder}.

durationsArray := {(1 to: (fileNamesArray size) collect: [ :i |
((i of: fileNamesArray) fileDuration removeUnits)])}.



It seems to want me to define fileNamesArray within the code that defines the durationsArray?

Any pointers would be appreciated.

Thanks,
Phil

[This message has been edited by Phi Curtis (edited 22 February 2010).]

IP: Logged

SSC
Administrator
posted 21 February 2010 18:41         Edit/Delete Message   Reply w/Quote
One way might be to combine the two operations together as:

code:

{'FilteredPulse' sampleFileNamesInSameFolder collect: [ :fn | fn sampleFileDuration removeUnits]}



IP: Logged

Phi Curtis
Member
posted 22 February 2010 08:54         Edit/Delete Message   Reply w/Quote
Thanks! I didn't realize you could iterate through a collection like that, without the do loop.

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c