Csound Csound-dev Csound-tekno Search About

[Csnd] set different start and stop playing a file

Date2011-11-18 16:00
FromMichele Nasti
Subject[Csnd] set different start and stop playing a file
Hi all, 
I am using 

gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1


to read a file into a function table. Then I pass this function table to 

fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh


to do some time-stretching operation. 


Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to  sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code. 

Ideas? suggestions? 


Michele 




Date2011-11-18 16:54
FromVictor Lazzarini
SubjectRe: [Csnd] set different start and stop playing a file
There is  no end loop code. Maybe what you need is something like mincer? It has a time position instead of a stretch factor. By controlling the time position you can loop to your content.

On 18 Nov 2011, at 16:00, Michele Nasti wrote:

Hi all, 
I am using 

gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1


to read a file into a function table. Then I pass this function table to 

fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh

to do some time-stretching operation. 

Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to  sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code. 
Ideas? suggestions? 

Michele 



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-11-18 17:06
FromMichele Nasti
SubjectRe: [Csnd] set different start and stop playing a file
What if I use a f-statement?  there is a time argoument.. but in the manual it is never specified what it is, and when I try to use it I get a "audio buffer underrun". 

2011/11/18 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
There is  no end loop code. Maybe what you need is something like mincer? It has a time position instead of a stretch factor. By controlling the time position you can loop to your content.

On 18 Nov 2011, at 16:00, Michele Nasti wrote:

Hi all, 
I am using 

gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1


to read a file into a function table. Then I pass this function table to 

fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh

to do some time-stretching operation. 

Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to  sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code. 
Ideas? suggestions? 

Michele 



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Date2011-11-18 17:44
FromVictor Lazzarini
SubjectRe: [Csnd] set different start and stop playing a file
The time means creation time, so it's the time the table is created. I don't think it's what you want.

On 18 Nov 2011, at 17:06, Michele Nasti wrote:

What if I use a f-statement?  there is a time argoument.. but in the manual it is never specified what it is, and when I try to use it I get a "audio buffer underrun". 

2011/11/18 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
There is  no end loop code. Maybe what you need is something like mincer? It has a time position instead of a stretch factor. By controlling the time position you can loop to your content.

On 18 Nov 2011, at 16:00, Michele Nasti wrote:

Hi all, 
I am using 

gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1


to read a file into a function table. Then I pass this function table to 

fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh

to do some time-stretching operation. 

Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to  sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code. 
Ideas? suggestions? 

Michele 



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-11-18 17:46
FromMichele Nasti
SubjectRe: [Csnd] set different start and stop playing a file

No.. i'all check the opcode you said. Thank you.

Il giorno 18/nov/2011 18:41, "Victor Lazzarini" <Victor.Lazzarini@nuim.ie> ha scritto:
The time means creation time, so it's the time the table is created. I don't think it's what you want.

On 18 Nov 2011, at 17:06, Michele Nasti wrote:

What if I use a f-statement?  there is a time argoument.. but in the manual it is never specified what it is, and when I try to use it I get a "audio buffer underrun". 

2011/11/18 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
There is  no end loop code. Maybe what you need is something like mincer? It has a time position instead of a stretch factor. By controlling the time position you can loop to your content.

On 18 Nov 2011, at 16:00, Michele Nasti wrote:

Hi all, 
I am using 

gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1


to read a file into a function table. Then I pass this function table to 

fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh

to do some time-stretching operation. 

Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to  sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code. 
Ideas? suggestions? 

Michele 



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




Date2011-11-19 10:39
FromMichele Nasti
SubjectRe: [Csnd] set different start and stop playing a file
The mincer opcode doesn't seem to do what I need.

Maybe I didn't express clearly my problem. I have to play only a part of a file and loop it, with time stretching. It seems impossible that Csound can't put only a part of the file in a ftable. Any  suggestions or ideas? 

2011/11/18 Michele Nasti <michele.nasti@gmail.com>

No.. i'all check the opcode you said. Thank you.

Il giorno 18/nov/2011 18:41, "Victor Lazzarini" <Victor.Lazzarini@nuim.ie> ha scritto:

The time means creation time, so it's the time the table is created. I don't think it's what you want.

On 18 Nov 2011, at 17:06, Michele Nasti wrote:

What if I use a f-statement?  there is a time argoument.. but in the manual it is never specified what it is, and when I try to use it I get a "audio buffer underrun". 

2011/11/18 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
There is  no end loop code. Maybe what you need is something like mincer? It has a time position instead of a stretch factor. By controlling the time position you can loop to your content.

On 18 Nov 2011, at 16:00, Michele Nasti wrote:

Hi all, 
I am using 

gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1


to read a file into a function table. Then I pass this function table to 

fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh

to do some time-stretching operation. 

Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to  sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code. 
Ideas? suggestions? 

Michele 



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Date2011-11-19 11:27
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] set different start and stop playing a file
AttachmentsNone  

Date2011-11-19 11:40
FromIain McCurdy
SubjectRE: [Csnd] set different start and stop playing a file
As Victor says, you can achieve what you describe using mincer and can then modulate the loop start and end points during performance if you like. If you really prefer to edit the audio stored in the function table you can still do this also. You can then loop and timestretch the whole function table using something like temposcal, as below.
instr 1iloopstart = 1;(in seconds)iloopend = 2ktimescal = 1 ;time scaling factorifile	ftgen  0,0,-(iloopend-iloopstart)*sr,1,"soundfile.wav",iloopstart,0,1idur = iloopend-iloopstarta1 temposcal ktimescal, 0.1, 1, ifile, 0out a1endin
Iain
> From: Victor.Lazzarini@nuim.ie
> To: csound@lists.bath.ac.uk
> Date: Sat, 19 Nov 2011 11:27:07 +0000
> Subject: Re: [Csnd] set different start and stop playing a file
> 
> Minced does exactly that , all you need to do is control its read position to start end or loop the playback
> 
> 
> 
> 
> ----- Original Message ----- From: Michele Nasti  Date: Saturday, November 19, 2011 10:39 am Subject: Re: [Csnd] set different start and stop playing a file To: csound@lists.bath.ac.uk > The mincer opcode doesn't seem to do what I need. > Maybe I didn't express clearly my problem. I have to play only a part of a file and loop it, with time stretching. It seems impossible that Csound can't put only a part of the file in a ftable. Any  suggestions or ideas?   > > 2011/11/18 Michele Nasti  > No.. i'all check the opcode you said. Thank you. Il giorno 18/nov/2011 18:41, "Victor Lazzarini"  ha scritto:   > The time means creation time, so it's the time the table is created. I don't think it's what you want. > On 18 Nov 2011, at 17:06, Michele Nasti wrote: > > What if I use a f-statement?  there is a time argoument.. but in the manual it is never specified what it is, and when I try to use it I get a "audio buffer underrun".  > 2011/11/18 Victor Lazzarini  > There is  no end loop code. Maybe what you need is something like mincer? It has a time position instead of a stretch factor. By controlling the time position you can loop to your content. > On 18 Nov 2011, at 16:00, Michele Nasti wrote:> > Hi all, I am using > > gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1 > > to read a file into a function table. Then I pass this function table to  > > fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh > > to do some time-stretching operation. > > Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to  sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code.  > Ideas? suggestions?  > > Michele  > > > > Dr Victor Lazzarini> Senior Lecturer> Dept. of Music> NUI Maynooth Ireland> tel.: +353 1 708 3545 > Victor dot Lazzarini AT nuim dot ie> > > > > > Dr Victor Lazzarini> Senior Lecturer> Dept. of Music> NUI Maynooth Ireland> tel.: +353 1 708 3545 > Victor dot Lazzarini AT nuim dot ie> > > > Dr Victor Lazzarini, Senior Lecturer, Dept. of Music, National University of Ireland, Maynooth
> 
> 
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
 		 	   		  

Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-19 11:45
FromIain McCurdy
SubjectRE: [Csnd] set different start and stop playing a file
oops, that didn't come out right, try this:

instr 1
iloopstart = 1;(in seconds)
iloopend = 2
ktimescal = 1 ;time scaling factor
ifile ftgen  0,0,-(iloopend-iloopstart)*sr,1,"ClassicalGuitar.wav",iloopstart,0,1
idur = iloopend-iloopstart
a1 temposcal ktimescal, 0.1, 1, ifile, 0
out a1
endin

----------------------------------------
> From: i_mccurdy@hotmail.com
> To: csound@lists.bath.ac.uk
> Date: Sat, 19 Nov 2011 11:40:15 +0000
> Subject: RE: [Csnd] set different start and stop playing a file
>
>
> As Victor says, you can achieve what you describe using mincer and can then modulate the loop start and end points during performance if you like. If you really prefer to edit the audio stored in the function table you can still do this also. You can then loop and timestretch the whole function table using something like temposcal, as below.
> instr 1iloopstart = 1;(in seconds)iloopend = 2ktimescal = 1 ;time scaling factorifile ftgen 0,0,-(iloopend-iloopstart)*sr,1,"soundfile.wav",iloopstart,0,1idur = iloopend-iloopstarta1 temposcal ktimescal, 0.1, 1, ifile, 0out a1endin
> Iain
> > From: Victor.Lazzarini@nuim.ie
> > To: csound@lists.bath.ac.uk
> > Date: Sat, 19 Nov 2011 11:27:07 +0000
> > Subject: Re: [Csnd] set different start and stop playing a file
> >
> > Minced does exactly that , all you need to do is control its read position to start end or loop the playback
> >
> >
> >
> >
> > ----- Original Message ----- From: Michele Nasti <michele.nasti@gmail.com> Date: Saturday, November 19, 2011 10:39 am Subject: Re: [Csnd] set different start and stop playing a file To: csound@lists.bath.ac.uk > The mincer opcode doesn't seem to do what I need. > Maybe I didn't express clearly my problem. I have to play only a part of a file and loop it, with time stretching. It seems impossible that Csound can't put only a part of the file in a ftable. Any suggestions or ideas? > > 2011/11/18 Michele Nasti <michele.nasti@gmail.com> > No.. i'all check the opcode you said. Thank you. Il giorno 18/nov/2011 18:41, "Victor Lazzarini" <Victor.Lazzarini@nuim.ie> ha scritto: > The time means creation time, so it's the time the table is created. I don't think it's what you want. > On 18 Nov 2011, at 17:06, Michele Nasti wrote: > > What if I use a f-statement? there is a time argoument.. but in the manual it is never specified what it is, and when I try to use it I get a "audio buffer underrun". > 2011/11/18 Victor Lazzarini <Victor.Lazzarini@nuim.ie> > There is no end loop code. Maybe what you need is something like mincer? It has a time position instead of a stretch factor. By controlling the time position you can loop to your content. > On 18 Nov 2011, at 16:00, Michele Nasti wrote:> > Hi all, I am using > > gifil0 ftgen 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1 > > to read a file into a function table. Then I pass this function table to > > fsig0 pvstanal kstretch, giamp, gipitch, gifil0, gidet, giwrap, giskip, gifftsiz, giovlp, githresh > > to do some time-stretching operation. > > Is it possible to set a custom start and stop point in the file? for example, if the file plays for 300 seconds, I want to play only from sec 15 to sec 30. I see the "giskip" to set the starting point; i can't however see the end loop code. > Ideas? suggestions? > > Michele > > > > Dr Victor Lazzarini> Senior Lecturer> Dept. of Music> NUI Maynooth Ireland> tel.: +353 1 708 3545 > Victor dot Lazzarini AT nuim dot ie> > > > > > Dr Victor Lazzarini> Senior Lecturer> Dept. of Music> NUI Maynooth Ireland> tel.: +353 1 708 3545 > Victor dot Lazzarini AT nuim dot ie> > > > Dr Victor Lazzarini, Senior Lecturer, Dept. of Music, National University of Ireland, Maynooth
> >
> >
> > Send bugs reports to the Sourceforge bug tracker
> > https://sourceforge.net/tracker/?group_id=81968&atid=564599
> > Discussions of bugs and features can be posted here
> > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> >
>
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Date2011-11-19 14:04
Fromk_o_m_p
SubjectRe: [Csnd] set different start and stop playing a file
If you prefer you could also use a table with 
phasor. With some maths it would do what you want.
Luis

Am 19.11.11 12:40, schrieb Iain McCurdy:
> As Victor says, you can achieve what you describe using mincer and can then modulate the loop start and end points during performance if you like. If you really prefer to edit the audio stored in the function table you can still do this also. You can then loop and timestretch the whole function table using something like temposcal, as below.
> instr 1iloopstart = 1;(in seconds)iloopend = 2ktimescal = 1 ;time scaling factorifile	ftgen  0,0,-(iloopend-iloopstart)*sr,1,"soundfile.wav",iloopstart,0,1idur = iloopend-iloopstarta1 temposcal ktimescal, 0.1, 1, ifile, 0out a1endin
> Iain
>> From: Victor.Lazzarini@nuim.ie
>> To: csound@lists.bath.ac.uk
>> Date: Sat, 19 Nov 2011 11:27:07 +0000
>> Subject: Re: [Csnd] set different start and stop playing a file
>>
>> Minced does exactly that , all you need to do is control its read position to start end or loop the playback
>>
>>
>>
>>

Date2011-11-19 15:48
FromVictor Lazzarini
SubjectRe: [Csnd] set different start and stop playing a file
But will not do timestretching.
On 19 Nov 2011, at 14:04, k_o_m_p wrote:

> If you prefer you could also use a table with phasor. With some maths it would do what you want.
> Luis
> 
> Am 19.11.11 12:40, schrieb Iain McCurdy:
>> As Victor says, you can achieve what you describe using mincer and can then modulate the loop start and end points during performance if you like. If you really prefer to edit the audio stored in the function table you can still do this also. You can then loop and timestretch the whole function table using something like temposcal, as below.
>> instr 1iloopstart = 1;(in seconds)iloopend = 2ktimescal = 1 ;time scaling factorifile	ftgen  0,0,-(iloopend-iloopstart)*sr,1,"soundfile.wav",iloopstart,0,1idur = iloopend-iloopstarta1 temposcal ktimescal, 0.1, 1, ifile, 0out a1endin
>> Iain
>>> From: Victor.Lazzarini@nuim.ie
>>> To: csound@lists.bath.ac.uk
>>> Date: Sat, 19 Nov 2011 11:27:07 +0000
>>> Subject: Re: [Csnd] set different start and stop playing a file
>>> 
>>> Minced does exactly that , all you need to do is control its read position to start end or loop the playback
>>> 
>>> 
>>> 
>>> 
> 
> -- 
> --
> http://luisantunespena.eu
> 
> 
> 
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-19 17:15
FromTito Latini
SubjectRe: [Csnd] set different start and stop playing a file
AttachmentsNone  

Date2011-11-19 18:00
FromTito Latini
SubjectRe: [Csnd] set different start and stop playing a file
AttachmentsNone  

Date2011-11-19 19:20
FromMichele Nasti
SubjectRe: [Csnd] set different start and stop playing a file

The fact is that I have already build a very complex program and I generate the csd on the fly, so if I can integrate this loop part with the code I wrote before it is great, else I have to rebuild/rewrite a big part of my program only for this (that means debug etc.). I have to experiment all your suggestions; I hope tomorrow or Monday I will try your codes.

The csound community is great!

Michele Nasti

Sent from my Android phone

Il giorno 19/nov/2011 18:58, "Tito Latini" <tito.01beta@gmail.com> ha scritto:
Sorry, 1/p3 is calculated 4 times in the previous csd file

<CsoundSynthesizer>
<CsInstruments>
 sr     = 44100
 ksmps  = 10
 nchnls = 2

instr 1
 iamp        = ampdb(p4)
 itransp     = powoftwo(p5/120)  ; p5 is halftones/10
 ichunk      = p6*0.001
 iprecession = p7*0.01
 ilooplen    = p8*0.001          ; p8 in msec
 idur        = 1/p3

 achunk       oscili ichunk,      idur, 2
 aprecession  oscili iprecession, idur, 3
 alooplen     oscili ilooplen,    idur, 4
 atransp      oscili itransp,     idur, 5
 afrq = (atransp-aprecession) / achunk

 aphs1 phasor afrq                    ; phasor 1
 aphs2 wrap aphs1+0.5, 0, 1           ; phasor 2
 aphs3 phasor aprecession / alooplen  ; phasor for the read position
 areadpt = aphs3*alooplen             ; read position

 atrig1 diff -aphs1   ; trigger 1
 atrig2 diff -aphs2   ; trigger 2

 achunk1 samphold achunk, atrig1
 achunk2 samphold achunk, atrig2

 ;; cos envs in sync
 aenv1 = iamp*cos((aphs1-0.5)*$M_PI)
 aenv2 = iamp*cos((aphs2-0.5)*$M_PI)

 a1 table3 (achunk1*aphs1+areadpt)*sr, 1
 a2 table3 (achunk2*aphs2+areadpt)*sr, 1

 aout  butterhp a1*aenv1+a2*aenv2, 5

 outs aout, aout

endin
</CsInstruments>
<CsScore>
;; table lookup
f1      0       [@44100]        1       "voice.wav" 0 0 0
;; chunk size
f2      0       8       7       .25 3 .25 3 1 2 .25
;; precession
f3      0       8       7       0 8 1
;; loop length
f4      0       8       7       1 2 1 4 0.25 2 1
;; trasposition
f5      0       8       7       0 5 50 2 -50 1 0

;;                      amp     transp  chunk   prec    looplen
i1      0       60      80      1       100     100     900
e
</CsScore>
</CsoundSynthesizer>

tito


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-20 01:15
FromJustin Glenn Smith
SubjectRe: [Csnd] set different start and stop playing a file
mincer does what you want - just provide the right signal for atimpt

for example if you want to loop a table from 1.0 to 2.0 seconds repeatedly:

istart = 1.0 ; the offset in seconds for the starting point
iend   = 2.0 ; the offset in seconds for the ending point
ioffset = istart
idur = iend - istart
ispeed = 0.5 ; play back at half speed
aphs   phasor (1/idur)*ispeed ; play back at half speed
atimpt = ioffset + (idur * aphs) ; our actual desired index


Michele Nasti wrote:
> The mincer opcode doesn't seem to do what I need.
> 
> Maybe I didn't express clearly my problem. I have to play only a part of a
> file and loop it, with time stretching. It seems impossible that Csound
> can't put only a part of the file in a ftable. Any  suggestions or ideas?
> 
> 2011/11/18 Michele Nasti 
> 
>> No.. i'all check the opcode you said. Thank you.
>> Il giorno 18/nov/2011 18:41, "Victor Lazzarini" 
>> ha scritto:
>>
>>  The time means creation time, so it's the time the table is created. I
>>> don't think it's what you want.
>>>
>>> On 18 Nov 2011, at 17:06, Michele Nasti wrote:
>>>
>>> What if I use a f-statement?  there is a *time* argoument.. but in the
>>> manual it is never specified what it is, and when I try to use it I get a
>>> "audio buffer underrun".
>>>
>>> 2011/11/18 Victor Lazzarini 
>>>
>>>> There is  no end loop code. Maybe what you need is something like
>>>> mincer? It has a time position instead of a stretch factor. By controlling
>>>> the time position you can loop to your content.
>>>>
>>>> On 18 Nov 2011, at 16:00, Michele Nasti wrote:
>>>>
>>>> Hi all,
>>>> I am using
>>>>
>>>> gifil0 *ftgen* 0, 0, 0, 1, "GioPro01.aif", 0, 0, 1
>>>>
>>>>
>>>> to read a file into a function table. Then I pass this function table to
>>>>
>>>> fsig0 *pvstanal* kstretch, giamp, gipitch, gifil0, gidet, giwrap,
>>>> giskip, gifftsiz, giovlp, githresh
>>>>
>>>> to do some time-stretching operation.
>>>>
>>>> Is it possible to set a custom start and stop point in the file? for
>>>> example, if the file plays for 300 seconds, I want to play only from sec 15
>>>> to  sec 30. I see the "giskip" to set the starting point; i can't however
>>>> see the end loop code.
>>>> Ideas? suggestions?
>>>>
>>>> Michele
>>>>
>>>>
>>>>
>>>>  Dr Victor Lazzarini
>>>> Senior Lecturer
>>>> Dept. of Music
>>>> NUI Maynooth Ireland
>>>> tel.: +353 1 708 3545
>>>> Victor dot Lazzarini AT nuim dot ie
>>>>
>>>>
>>>>
>>>>
>>>  Dr Victor Lazzarini
>>> Senior Lecturer
>>> Dept. of Music
>>> NUI Maynooth Ireland
>>> tel.: +353 1 708 3545
>>> Victor dot Lazzarini AT nuim dot ie
>>>
>>>
>>>
>>>
> 
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-11-21 15:17
FromMichele Nasti
SubjectRe: [Csnd] set different start and stop playing a file
Hi Justin, 
your code is helping me a lot. 
I only have a problem, I have to set ispeed, istart and iend dinamically via chnget. How can this be done, since they are i-variables?
(sorry for the easy question if this is easy, but it's only 2 months that I am playing with csound!!) 
Michele 


2011/11/20 Justin Glenn Smith <noisesmith@gmail.com>
mincer does what you want - just provide the right signal for atimpt

for example if you want to loop a table from 1.0 to 2.0 seconds repeatedly:

istart = 1.0 ; the offset in seconds for the starting point
iend   = 2.0 ; the offset in seconds for the ending point
ioffset = istart
idur = iend - istart
ispeed = 0.5 ; play back at half speed
aphs   phasor (1/idur)*ispeed ; play back at half speed
atimpt = ioffset + (idur * aphs) ; our actual desired index



Date2011-11-21 16:59
FromVictor Lazzarini
SubjectRe: [Csnd] set different start and stop playing a file
just make them kvars and it will be fine.
On 21 Nov 2011, at 15:17, Michele Nasti wrote:

Hi Justin, 
your code is helping me a lot. 
I only have a problem, I have to set ispeed, istart and iend dinamically via chnget. How can this be done, since they are i-variables?
(sorry for the easy question if this is easy, but it's only 2 months that I am playing with csound!!) 
Michele 


2011/11/20 Justin Glenn Smith <noisesmith@gmail.com>
mincer does what you want - just provide the right signal for atimpt

for example if you want to loop a table from 1.0 to 2.0 seconds repeatedly:

istart = 1.0 ; the offset in seconds for the starting point
iend   = 2.0 ; the offset in seconds for the ending point
ioffset = istart
idur = iend - istart
ispeed = 0.5 ; play back at half speed
aphs   phasor (1/idur)*ispeed ; play back at half speed
atimpt = ioffset + (idur * aphs) ; our actual desired index



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-11-21 17:04
FromMichele Nasti
SubjectRe: [Csnd] set different start and stop playing a file
Yes Victor, in the end I did it and it was working. 
My last problem is a way to stop the loop via a variable. Something like, if I set loop to 0, it should not loop it and play the file only once. If gkloop is set to 1, it should loop.

I can't find the place where to put it. 
This is my code now, it plays two files and mixes it to the output:


instr 1


gkstart =15.0;

gkend = 20.0;

gkspeed = 3;

gkloop = 0;

kpitch = 1; il pitch è l'altezza della frequenza

klock = 1; lock sul pitch ?

kamp = 1; segnale di amplificazione

koffset = gkstart

kdur = gkend - gkstart


aphs phasor (1/kdur)*gkspeed; play back at gispeed speed

atimpt = koffset + (kdur * aphs) ; our actual desired index


aout0 mincer atimpt , kamp, kpitch, 1, klock

aout1 mincer atimpt , kamp, kpitch, 2, klock

outch 1, aout0, 1, aout1

endin


suggestions? 

2011/11/21 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
just make them kvars and it will be fine.

On 21 Nov 2011, at 15:17, Michele Nasti wrote:

Hi Justin, 
your code is helping me a lot. 
I only have a problem, I have to set ispeed, istart and iend dinamically via chnget. How can this be done, since they are i-variables?
(sorry for the easy question if this is easy, but it's only 2 months that I am playing with csound!!) 
Michele 


2011/11/20 Justin Glenn Smith <noisesmith@gmail.com>
mincer does what you want - just provide the right signal for atimpt

for example if you want to loop a table from 1.0 to 2.0 seconds repeatedly:

istart = 1.0 ; the offset in seconds for the starting point
iend   = 2.0 ; the offset in seconds for the ending point
ioffset = istart
idur = iend - istart
ispeed = 0.5 ; play back at half speed
aphs   phasor (1/idur)*ispeed ; play back at half speed
atimpt = ioffset + (idur * aphs) ; our actual desired index



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Date2011-11-21 18:21
FromVictor Lazzarini
SubjectRe: [Csnd] set different start and stop playing a file
What you need then is two things

1) switch out the phasor sig
2) construct a line from the current position to the end position in the current duration


To do 1), you can 

if gkloop == 0 then
....
else
aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index
endif

To do 2) you will need a UDO like this (I don't think there's any opcode that can do the job):

opcode OnlyOnce,a,akk

kval init 0
kend1 init 0
setksmps 1
apos,kdur,kend xin

if kval == 0 then
kval downsamp apos
kpos = kval
kincr = (kend-kpos)/kdur
kend1 = kend
endif

kval = kval + kincr/kr
if kval > kend1 then
kval = kend1
endif

aval upsamp kval

xout aval

endop

which will be called

if gkloop == 0 then
atimpt OnlyOnce  atimpt, kdur, gkend
else
...
endif

I think this should work

Victor

On 21 Nov 2011, at 17:04, Michele Nasti wrote:

Yes Victor, in the end I did it and it was working. 
My last problem is a way to stop the loop via a variable. Something like, if I set loop to 0, it should not loop it and play the file only once. If gkloop is set to 1, it should loop.

I can't find the place where to put it. 
This is my code now, it plays two files and mixes it to the output:

For

instr 1

gkstart =15.0;
gkend = 20.0;
gkspeed = 3;
gkloop = 0;
kpitch = 1; il pitch è l'altezza della frequenza
klock = 1; lock sul pitch ?
kamp = 1; segnale di amplificazione
koffset = gkstart
kdur = gkend - gkstart

aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index

aout0 mincer atimpt , kamp, kpitch, 1, klock
aout1 mincer atimpt , kamp, kpitch, 2, klock

outch 1, aout0, 1, aout1

endin

suggestions? 

2011/11/21 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
just make them kvars and it will be fine.

On 21 Nov 2011, at 15:17, Michele Nasti wrote:

Hi Justin, 
your code is helping me a lot. 
I only have a problem, I have to set ispeed, istart and iend dinamically via chnget. How can this be done, since they are i-variables?
(sorry for the easy question if this is easy, but it's only 2 months that I am playing with csound!!) 
Michele 


2011/11/20 Justin Glenn Smith <noisesmith@gmail.com>
mincer does what you want - just provide the right signal for atimpt

for example if you want to loop a table from 1.0 to 2.0 seconds repeatedly:

istart = 1.0 ; the offset in seconds for the starting point
iend   = 2.0 ; the offset in seconds for the ending point
ioffset = istart
idur = iend - istart
ispeed = 0.5 ; play back at half speed
aphs   phasor (1/idur)*ispeed ; play back at half speed
atimpt = ioffset + (idur * aphs) ; our actual desired index



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2011-11-22 16:01
FromMichele Nasti
SubjectRe: [Csnd] set different start and stop playing a file
Victor, pardon me if I only use your code and suggestions without really understanding completely them. The fact is that I need this code for my final project at university and I want it to work rapidly, otherwise I can't graduate :/ 
At the moment I have copied the opcode OnlyOnce you wrote me, and I have used it in this way: 

if gkloop == 1 then

aphs phasor (1/kdur)*gkspeed; play back at gispeed speed

atimpt = koffset + (kdur * aphs) ; our actual desired index

atimpt OnlyOnce atimpt, kdur, gkend

else

aphs phasor (1/kdur)*gkspeed; play back at gispeed speed

atimpt = koffset + (kdur * aphs) ; our actual desired index

endif


aout0 mincer atimpt , kamp, kpitch, 1, klock

aout1 mincer atimpt , kamp, kpitch, 2, klock


Using it this way, if I set gkloop = 1, The loop runs only once, but when it reaches the end it stops on the last audio signal runing forever. How can I avoid this? I want that if the end of the loop is reached, It has to stop completely.  

Maybe this is because I set the instrument to run for 3600 seconds? I did this because I need CSound stay alive while I modify some parameters with a Java application. 




2011/11/21 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
What you need then is two things

1) switch out the phasor sig
2) construct a line from the current position to the end position in the current duration


To do 1), you can 

if gkloop == 0 then
....
else
aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index
endif

To do 2) you will need a UDO like this (I don't think there's any opcode that can do the job):

opcode OnlyOnce,a,akk

kval init 0
kend1 init 0
setksmps 1
apos,kdur,kend xin

if kval == 0 then
kval downsamp apos
kpos = kval
kincr = (kend-kpos)/kdur
kend1 = kend
endif

kval = kval + kincr/kr
if kval > kend1 then
kval = kend1
endif

aval upsamp kval

xout aval

endop

which will be called

if gkloop == 0 then
atimpt OnlyOnce  atimpt, kdur, gkend
else
...
endif

I think this should work

Victor

On 21 Nov 2011, at 17:04, Michele Nasti wrote:

Yes Victor, in the end I did it and it was working. 
My last problem is a way to stop the loop via a variable. Something like, if I set loop to 0, it should not loop it and play the file only once. If gkloop is set to 1, it should loop.

I can't find the place where to put it. 
This is my code now, it plays two files and mixes it to the output:

For

instr 1

gkstart =15.0;
gkend = 20.0;
gkspeed = 3;
gkloop = 0;
kpitch = 1; il pitch è l'altezza della frequenza
klock = 1; lock sul pitch ?
kamp = 1; segnale di amplificazione
koffset = gkstart
kdur = gkend - gkstart

aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index

aout0 mincer atimpt , kamp, kpitch, 1, klock
aout1 mincer atimpt , kamp, kpitch, 2, klock

outch 1, aout0, 1, aout1

endin

suggestions? 

2011/11/21 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
just make them kvars and it will be fine.

On 21 Nov 2011, at 15:17, Michele Nasti wrote:

Hi Justin, 
your code is helping me a lot. 
I only have a problem, I have to set ispeed, istart and iend dinamically via chnget. How can this be done, since they are i-variables?
(sorry for the easy question if this is easy, but it's only 2 months that I am playing with csound!!) 
Michele 


2011/11/20 Justin Glenn Smith <noisesmith@gmail.com>
mincer does what you want - just provide the right signal for atimpt

for example if you want to loop a table from 1.0 to 2.0 seconds repeatedly:

istart = 1.0 ; the offset in seconds for the starting point
iend   = 2.0 ; the offset in seconds for the ending point
ioffset = istart
idur = iend - istart
ispeed = 0.5 ; play back at half speed
aphs   phasor (1/idur)*ispeed ; play back at half speed
atimpt = ioffset + (idur * aphs) ; our actual desired index



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Date2011-11-22 16:16
FromAdam Puckett
SubjectRe: [Csnd] set different start and stop playing a file
You can use

f0 3600

in the score and it will run for 1 hour, and you can create a JButton
whenever you want the instrument activated.

On 11/22/11, Michele Nasti  wrote:
> Victor, pardon me if I only use your code and suggestions without really
> understanding completely them. The fact is that I need this code for my
> final project at university and I want it to work rapidly, otherwise I
> can't graduate :/
> At the moment I have copied the opcode OnlyOnce you wrote me, and I have
> used it in this way:
>
> if gkloop == 1 then
>
> aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
>
> atimpt = koffset + (kdur * aphs) ; our actual desired index
>
> * atimpt OnlyOnce atimpt, kdur, gkend*
>
> else
>
> aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
>
> atimpt = koffset + (kdur * aphs) ; our actual desired index
>
> endif
>
>
> aout0 mincer atimpt , kamp, kpitch, 1, klock
>
> aout1 mincer atimpt , kamp, kpitch, 2, klock
>
>
> Using it this way, if I set gkloop = 1, The loop runs only once, but when
> it reaches the end it stops on the last audio signal runing forever. How
> can I avoid this? I want that if the end of the loop is reached, It has to
> stop completely.
>
> Maybe this is because I set the instrument to run for 3600 seconds? I did
> this because I need CSound stay alive while I modify some parameters with a
> Java application.
>
>
>
>
> 2011/11/21 Victor Lazzarini 
>
>> What you need then is two things
>>
>> 1) switch out the phasor sig
>> 2) construct a line from the current position to the end position in the
>> current duration
>>
>>
>> To do 1), you can
>>
>> if gkloop == 0 then
>> ....
>> else
>> aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
>> atimpt = koffset + (kdur * aphs) ; our actual desired index
>> endif
>>
>> To do 2) you will need a UDO like this (I don't think there's any opcode
>> that can do the job):
>>
>> opcode OnlyOnce,a,akk
>>
>> kval init 0
>> kend1 init 0
>> setksmps 1
>> apos,kdur,kend xin
>>
>> if kval == 0 then
>> kval downsamp apos
>> kpos = kval
>> kincr = (kend-kpos)/kdur
>> kend1 = kend
>> endif
>>
>> kval = kval + kincr/kr
>> if kval > kend1 then
>> kval = kend1
>> endif
>>
>> aval upsamp kval
>>
>> xout aval
>>
>> endop
>>
>> which will be called
>>
>> if gkloop == 0 then
>> atimpt OnlyOnce  atimpt, kdur, gkend
>> else
>> ...
>> endif
>>
>> I think this should work
>>
>> Victor
>>
>> On 21 Nov 2011, at 17:04, Michele Nasti wrote:
>>
>> Yes Victor, in the end I did it and it was working.
>> My last problem is a way to stop the loop via a variable. Something like,
>> if I set loop to 0, it should not loop it and play the file only once. If
>> gkloop is set to 1, it should loop.
>>
>> I can't find the place where to put it.
>> This is my code now, it plays two files and mixes it to the output:
>>
>> For
>>
>> instr 1
>>
>> gkstart =15.0;
>> gkend = 20.0;
>> gkspeed = 3;
>> *gkloop = 0;*
>> kpitch = 1; il pitch è l'altezza della frequenza
>> klock = 1; lock sul pitch ?
>> kamp = 1; segnale di amplificazione
>> koffset = gkstart
>> kdur = gkend - gkstart
>>
>> aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
>> atimpt = koffset + (kdur * aphs) ; our actual desired index
>>
>> aout0 mincer atimpt , kamp, kpitch, 1, klock
>> aout1 mincer atimpt , kamp, kpitch, 2, klock
>>
>>  outch 1, aout0, 1, aout1
>>
>> endin
>>
>> suggestions?
>>
>> 2011/11/21 Victor Lazzarini 
>>
>>> just make them kvars and it will be fine.
>>>
>>> On 21 Nov 2011, at 15:17, Michele Nasti wrote:
>>>
>>> Hi Justin,
>>> your code is helping me a lot.
>>> I only have a problem, I have to set ispeed, istart and iend dinamically
>>> via chnget. How can this be done, since they are i-variables?
>>> (sorry for the easy question if this is easy, but it's only 2 months that
>>> I am playing with csound!!)
>>> Michele
>>>
>>>
>>> 2011/11/20 Justin Glenn Smith 
>>>
>>>> mincer does what you want - just provide the right signal for atimpt
>>>>
>>>> for example if you want to loop a table from 1.0 to 2.0 seconds
>>>> repeatedly:
>>>>
>>>> istart = 1.0 ; the offset in seconds for the starting point
>>>> iend   = 2.0 ; the offset in seconds for the ending point
>>>> ioffset = istart
>>>> idur = iend - istart
>>>> ispeed = 0.5 ; play back at half speed
>>>> aphs   phasor (1/idur)*ispeed ; play back at half speed
>>>> atimpt = ioffset + (idur * aphs) ; our actual desired index
>>>>
>>>>
>>>>
>>>  Dr Victor Lazzarini
>>> Senior Lecturer
>>> Dept. of Music
>>> NUI Maynooth Ireland
>>> tel.: +353 1 708 3545
>>> Victor dot Lazzarini AT nuim dot ie
>>>
>>>
>>>
>>>
>>
>> Dr Victor Lazzarini
>> Senior Lecturer
>> Dept. of Music
>> NUI Maynooth Ireland
>> tel.: +353 1 708 3545
>> Victor dot Lazzarini AT nuim dot ie
>>
>>
>>
>>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-22 17:14
FromVictor Lazzarini
SubjectRe: [Csnd] set different start and stop playing a file
yes, I think the problem is that mincer will keep playing the last frame at time position kpos. What you need to do is to switch the mincer off at that point with
another conditional. Maybe

kstop init 1
if gkloop == 1 then
...
ktimpt downsamp atimpt
  if ktimpt >= kpos then
    kstop = 0
    kstop port kstop, 0.01
  endif
else
...
endif

aout0  ...
aout1  ...

aout0 = aout0*kstop
aout1 = aout1*kstop



On 22 Nov 2011, at 16:01, Michele Nasti wrote:

Victor, pardon me if I only use your code and suggestions without really understanding completely them. The fact is that I need this code for my final project at university and I want it to work rapidly, otherwise I can't graduate :/ 
At the moment I have copied the opcode OnlyOnce you wrote me, and I have used it in this way: 

if gkloop == 1 then
aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index
atimpt OnlyOnce atimpt, kdur, gkend
else
aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index
endif

aout0 mincer atimpt , kamp, kpitch, 1, klock
aout1 mincer atimpt , kamp, kpitch, 2, klock

Using it this way, if I set gkloop = 1, The loop runs only once, but when it reaches the end it stops on the last audio signal runing forever. How can I avoid this? I want that if the end of the loop is reached, It has to stop completely.  
Maybe this is because I set the instrument to run for 3600 seconds? I did this because I need CSound stay alive while I modify some parameters with a Java application. 




2011/11/21 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
What you need then is two things

1) switch out the phasor sig
2) construct a line from the current position to the end position in the current duration


To do 1), you can 

if gkloop == 0 then
....
else
aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index
endif

To do 2) you will need a UDO like this (I don't think there's any opcode that can do the job):

opcode OnlyOnce,a,akk

kval init 0
kend1 init 0
setksmps 1
apos,kdur,kend xin

if kval == 0 then
kval downsamp apos
kpos = kval
kincr = (kend-kpos)/kdur
kend1 = kend
endif

kval = kval + kincr/kr
if kval > kend1 then
kval = kend1
endif

aval upsamp kval

xout aval

endop

which will be called

if gkloop == 0 then
atimpt OnlyOnce  atimpt, kdur, gkend
else
...
endif

I think this should work

Victor

On 21 Nov 2011, at 17:04, Michele Nasti wrote:

Yes Victor, in the end I did it and it was working. 
My last problem is a way to stop the loop via a variable. Something like, if I set loop to 0, it should not loop it and play the file only once. If gkloop is set to 1, it should loop.

I can't find the place where to put it. 
This is my code now, it plays two files and mixes it to the output:

For

instr 1

gkstart =15.0;
gkend = 20.0;
gkspeed = 3;
gkloop = 0;
kpitch = 1; il pitch è l'altezza della frequenza
klock = 1; lock sul pitch ?
kamp = 1; segnale di amplificazione
koffset = gkstart
kdur = gkend - gkstart

aphs phasor (1/kdur)*gkspeed; play back at gispeed speed
atimpt = koffset + (kdur * aphs) ; our actual desired index

aout0 mincer atimpt , kamp, kpitch, 1, klock
aout1 mincer atimpt , kamp, kpitch, 2, klock

outch 1, aout0, 1, aout1

endin

suggestions? 

2011/11/21 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
just make them kvars and it will be fine.

On 21 Nov 2011, at 15:17, Michele Nasti wrote:

Hi Justin, 
your code is helping me a lot. 
I only have a problem, I have to set ispeed, istart and iend dinamically via chnget. How can this be done, since they are i-variables?
(sorry for the easy question if this is easy, but it's only 2 months that I am playing with csound!!) 
Michele 


2011/11/20 Justin Glenn Smith <noisesmith@gmail.com>
mincer does what you want - just provide the right signal for atimpt

for example if you want to loop a table from 1.0 to 2.0 seconds repeatedly:

istart = 1.0 ; the offset in seconds for the starting point
iend   = 2.0 ; the offset in seconds for the ending point
ioffset = istart
idur = iend - istart
ispeed = 0.5 ; play back at half speed
aphs   phasor (1/idur)*ispeed ; play back at half speed
atimpt = ioffset + (idur * aphs) ; our actual desired index



Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie