Kyma Forum
  Kyma Support
  Script error message...

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

next newest topic | next oldest topic
Author Topic:   Script error message...
JackRosete
Member
posted 22 May 2007 13:54         Edit/Delete Message   Reply w/Quote
I'm getting the following error in a Script Sound:

The message #clipTo01, sent to 11.294126984127 s, an instance of class TimeInSeconds, was not understood.

I'm using the following code:

| sampleselect |

sampleselect := SamplesFile
fromOldFilename: (HostDriverInterface
getFileWithPrompt: 'Select a Sample'
fileTypes: HostDriverInterface sampleFileTypes
ifCancel: [^ self]).
sample start: 0 s
filename: sampleselect filename asString
loopend: sampleselect filename asString sampleFileDuration s

The strange thing is that if I use this code (adapted slightly) within the LoopEnd field of a Sample Sound, it works. What could be wrong?

Also, why do I need to use the Smalltalk 'filename' asString sampleFileDuration s? If I just use asString sampleFileDuration s after the sampleselect variable, the code doesn't work anymore...

Thanks!

IP: Logged

SSC
Administrator
posted 22 May 2007 14:18         Edit/Delete Message   Reply w/Quote
"The message #clipTo01, sent to 11.294126984127 s, an instance of class TimeInSeconds, was not understood."

The LoopEnd parameter does not expect a value in seconds. This error arises because you are supplying it with the value:

sampleselect filename asString sampleFileDuration s

"Also, why do I need to use the Smalltalk 'filename' asString sampleFileDuration s? If I just use asString sampleFileDuration s after the sampleselect variable, the code doesn't work anymore..."

Since sampleselect is a SamplesFile, you can send it the message

sampleFileDuration

directly--without any other conversions required.

IP: Logged

SSC
Administrator
posted 22 May 2007 14:21         Edit/Delete Message   Reply w/Quote
Setting LoopEnd to 11.294... s will always set LoopEnd to its maximum value of 1. If you put the value "1" in the field, it will have the same effect.

Perhaps you want the LoopEnd to be a fraction of the total file length? In this case, you could use a ratio:

!LoopDur s / sampleselect samplesFileDuration s

IP: Logged

JackRosete
Member
posted 22 May 2007 14:29         Edit/Delete Message   Reply w/Quote
Ooops, I forgot about LoopStart/End expecting values between 0 and 1, I can now see why the script wasn't working!

Thanks...

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