Kyma Forum
  Tips & Techniques
  determining duration in script

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

next newest topic | next oldest topic
Author Topic:   determining duration in script
Douglas Kraul
Member
posted 15 August 2004 11:03         Edit/Delete Message   Reply w/Quote
I am creating a script that generates a sequence of sounds. The number of sounds created is determined by the duration of the overall script. So, for example, if the composite sound generates 10 subsounds per second I would like the script to generate 100 if the duration is set to 10. Up until now I've used a user input dialog to set the duration but I would like to have it done automatically when the sound is placed on the Timeline, including reflecting any changes due to lengthening the Timeline rectangle later.

Is there an accessor method on Self that can be used to discover the duration? If not is there any other way of programmatically determining the duration when the script is executing?

Somewhat related question: when I place a sound with user prompts onto the Timeline it prompts me immediately for the inputs. It also asks a second time when the sound is first compiled as part of a Timeline run. Is there any way to suppress the redundant second transaction?

Thanks in advance!

Doug

Douglas Kraul

IP: Logged

SSC
Administrator
posted 15 August 2004 15:03         Edit/Delete Message   Reply w/Quote
If you were to use a MIDIVoice script, you could, for example, start a fixed number of events per second. That way, if you stretched or compressed the duration of the Sound in the Timeline, you would get more or fewer of the events.

For the moment, there is not a way to surpress the second translation of the Script, sorry.

IP: Logged

Douglas Kraul
Member
posted 16 August 2004 05:53         Edit/Delete Message   Reply w/Quote
Actually that was the road I initially headed down but unfortunately the "instrument" I am creating does not lend itself to using the event-oriented approach that the MidiVoice fosters. Let me explain.

I am algorithmicly constructing a series of sounds, one per event. Each of these contains elements that need changing from event to event that are not reachable via "hot" variables. For example each event may be playing back a segment from a different sample file, files that may be too long to fit in DSP RAM, or too many files to choose between in the working set. Also the effects processing on each event is variable. Probably the closest analog would be the various random sound constructors in 'scripts.kym'.

The composite sound forms the actual performance piece and it typically contains on the order of 150 or more of the "events" I just outlined, a total duration in the neighborhood of 10 minutes.

I am currently using a script to generate the sounds and schedule them for play, and it really is working fine except for control over the total piece's duration. I'd very much like to make this sound reusable and friendly to being used on the Timeline.

As it stands though I have tried two methods of setting the overall sounds duration: by prompting for a duration, or setting a maximum possible duration and then let other means (like a timeline) determine the actual duration. Each has its problems, the 2nd one in particular can result in very long compile times and I've even experienced runtime errors.

So I am looking for a more elegant solution that is not quite so fragile.

Doug

IP: Logged

SSC
Administrator
posted 16 August 2004 09:52         Edit/Delete Message   Reply w/Quote
For now, the best thing to do would be to make all of the durations in the Script depend on a single green ?variable for the total duration and to continue setting it from the dialog as you are now.

We will look at whether it is possible to make a change to Kyma that would allow the timeline to set that green variable for you when you change the length of a bar. Without this change, I don't think there is any way to do this.

IP: Logged

Douglas Kraul
Member
posted 16 August 2004 10:14         Edit/Delete Message   Reply w/Quote
OK, I had already done that so I'll just wait and see what develops.

As an aside I headed down this path primarily because there is no way to play a sample back from any point in the file, if the start is to be "hot", unless you make in RAM resident. This of course only works for samples that fit in one DSP's RAM. Perhaps there could be a prototype that would make the start point into the file "hot"?

Also (probably a wacky idea) I also tried to solve the duration issue by making a class out of my sound. This did not work out because it seems that the "class from example" expands the script before using that as the basis of the new class (makes sense). What would be cool is if you could defer the expansion until the actual instantiation of the object. This would give Kyma a facility akin to templates in C++, macros in LISP, etc.

Of course I am probably abusing the whole script thing but it is one of the cool (possibly neglected) Kyma features.

Thanks for the help!

Doug

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