[Csnd] ftlen (samples to seconds)
| Date | 2011-11-09 17:35 |
| From | Gavin Ohning |
| Subject | [Csnd] ftlen (samples to seconds) |
| Attachments | ftpvoc.csd |
|
Hey. I'm trying to write some C code that uses the phase vocoder in csound. I need to determine the length of any audio file the code runs in seconds, so I'm trying to use ftlen in Csound to accomplish this instead of writing a function in C. However, I can't figure out how to get the output of ftlen and use it in the pvoc opcode. I essentially want Csound to take the ift output, divide that by the sample rate to produce the length in seconds, and use that value for ktime in pvoc. I'm attaching a simple .csd file that uses ftlen with pvoc. Thanks! |
| Date | 2011-11-09 17:45 |
| From | k_o_m_p |
| Subject | Re: [Csnd] ftlen (samples to seconds) |
|
ift = ftlen(p4) / sr print ift ktime line 0, p3, ift ;9.29 is where I want ift/sr to be. is this what you are looking for? luis Am 09.11.11 18:35, schrieb Gavin Ohning:
|
| Date | 2011-11-09 17:49 |
| From | Gavin Ohning |
| Subject | RE: [Csnd] ftlen (samples to seconds) |
|
Great! That's exactly what I was trying to do. Thanks! Date: Wed, 9 Nov 2011 18:45:56 +0100 From: k_o_m_p@yahoo.de To: csound@lists.bath.ac.uk Subject: Re: [Csnd] ftlen (samples to seconds) ift = ftlen(p4) / sr print ift ktime line 0, p3, ift ;9.29 is where I want ift/sr to be. is this what you are looking for? luis Am 09.11.11 18:35, schrieb Gavin Ohning:
|