Kyma Forum
  Kyma Support
  Caculating Sample Playback Position

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

next newest topic | next oldest topic
Author Topic:   Caculating Sample Playback Position
cristian_vogel
Member
posted 09 April 2006 05:37         Edit/Delete Message   Reply w/Quote
I want to try and make a realtime freeze sound, and when planning it, I think I need to figure out a way of storing in a variable the exact 'playhead' position within the sampleFile at the point of the freeze... it could be useful to have an expression that can calculate the playback position in samples or seconds, in many many different examples ... Can anyone help me figure out a function to calculate that? I guess it would be based on elapsed time, sample frequency, and sample rate....

IP: Logged

keph
Member
posted 09 April 2006 11:01         Edit/Delete Message   Reply w/Quote

if you are using something that states the index in a 0-1 value (like the sample sounds), the exact position can be grabbed via (('file name' sampleFileDuration s) * !index)

You can use samp for samples in that argument in place of s for seconds.

Now as it relates to a freezing sound. It guess it depends on how you want to do it, but I'd take a look at some of the grain cloud examples first and second I look at a resynth technique where you grab the amp/freq and feed that into a OSC bank. you could use a standard sample player with index points to feed the analyzer.

IP: Logged

cristian_vogel
Member
posted 09 April 2006 12:21         Edit/Delete Message   Reply w/Quote
I looked at Sample sound and I can't see where the !Index hot parameter would go to? It doesn't have a TimeIndex field, like the Morph Sound - I tried pasting the expression you suggested into the 'Start' field, but the compiler gives me an error...


IP: Logged

pete
Member
posted 09 April 2006 13:49         Edit/Delete Message   Reply w/Quote
Hi Cristian

Try putting this in the LoopStart field

!LoopSecs /(('count.aif' sampleFileDuration s) removeUnits )

and this in the LoopEnd field

(!LoopSecs+!LoopSizeSecs) /(('count.aif' sampleFileDuration s) removeUnits )

But you must replace the count.aif with the name of the sample file you are using.

Of cause this is not a very good freeze as there's no cross fade or overlapping. Even if there was it would still be a very basic way of creating a freeze in a sample and doesn't use all the sophisticated technics used in modern time stretching algorithms. Obviously simply stopping a sample at one point in time without the loop would be like placing the needle on a record on a turntable when the turntable wasn't moving, hence silents.

If you want it in terms of samples not seconds you would change the s to samp as Keph said

Hope This helps

Pete

[This message has been edited by pete (edited 09 April 2006).]

IP: Logged

SSC
Administrator
posted 09 April 2006 15:04         Edit/Delete Message   Reply w/Quote
The TauPlayer is another technique that allows for time-freezing. Use a TimeIndex instead of automatic live looping.

IP: Logged

keph
Member
posted 09 April 2006 18:16         Edit/Delete Message   Reply w/Quote

sorry about that, as pete notes, the Start / End and LoopStart / LoopEnd fields are the index fields in the sample player.

what I took it you were asking was how to extra the position of the of start (index) point. the most straightfoward example is to open up the "sample" sound and in the start field type !index or !start, etc.

then take a soundToGlobalController sound and add it to your chain via a mixer. in the value field type in the expression I noted in my first post making sure the parameter in the start field is the same as the hot parameter in the other expression. you may have to add in the removeUnits argument at the correct place, fyi. I always forget that one initially.

that will give you a read out of the position in seconds in the VCS (you may have to adjust the VCS ranges to account for values in excess of 1).

i don't have the capy with me so I can't bang out an example for you.

not sure if actually helps you your freeze sound but knowing the sampleFileDuration expression is usefully in many other examples.

IP: Logged

cristian_vogel
Member
posted 10 April 2006 03:55         Edit/Delete Message   Reply w/Quote
Thanks, it all helps - its all grist to the mill, as we say in the UK..

My problem with Tau is that , as I only have a basic rig , its too DSP hungry - also, it seems that TAU analysis takes a really long time, and I'm more interested in really long sample source, like minutes, not loops - Tau seems to be geared towards sources less than 10 - 20 seconds or so in length...

The playback index for a simple sample source is important, as even if i want to try and do a sophisticated freeze, like a switch to granular freeze or some other type of more sophisticated 'freeze' feeling of my own making, then I would want to be able to *store* the playback position, in order to either jump back to there if the freeze needs to scan forward, or skip from there to a re-entry point proportional to the freeze time... a transition in and out of a freeze needs to be well designed to give a convincing effect...

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