Csound Csound-dev Csound-tekno Search About

[Csnd] loscil problem

Date2008-05-20 11:44
FromDarren Nelsen
Subject[Csnd] loscil problem
Hello.

I'm trying to loop a 13-minute wav file using loscil/GEN01. When I run  
my csd, only the first 7 seconds of the wav are played and looped. Can  
someone please advise me on how to get the full soundfile looped?  
Here's my source. The soundfile, btw, is at a 11025 sampling rate. I  
figure I have to use a low sampling rate to fit into GEN01. Thanks!



sr	=	44100
ksmps	=	10
nchnls	=	2

gi_sample_1	ftgen	0,	0,	0,	1,	"Declaration_of_Independence- 
Read_by_DJD.wav",	0,	0,	0

instr	DecInd
	kamp	=	p4
	;kamp	chanctrl	1,	2,	0,	p4
	kcps	=	1
	ifn	=	gi_sample_1
	ibas	=	1
	a1	loscil	kamp,	kcps,	ifn,	ibas,	1
	outs	a1,	a1
endin



;	parameter1	p2	p3	p4
;	instrument	strt	dur	amp
i	"DecInd"	0	999	30000

e




Version: 3
Render: Real
Ask: No
Functions: ioObject
Listing: ioObject
WindowBounds: 519 44 1742 1105
CurrentView: orc
IOViewEdit: Off
Options: -b128 -A -o/Users/darren/Music/Csound/Fourth of July/Fourth  
of July.aif -f -m135 -R --midi-velocity-amp=4 --midi-key-cps=5


ioView background {60108, 65535, 63132}
ioListing {511, 17} {578, 634}
ioGraph {26, 17} {483, 634}








Date2008-05-20 12:39
FromIain McCurdy
Subject[Csnd] RE: loscil problem
Have you considered using diskin2? You won't have to reduce the sampling rate so drastically  with it.
loscil can be a bit flakey with very long deferred size GEN 1 tables. You could read it instead with table3:

    andx    phasor    sr/(nsamp(ifn)*4)
    a1    table3    andx*nsamp(ifn), ifn
    a1    =    a1*kamp

You can't use a deferred size table with this so you need to give your table a size of 16777217 . The '4' in the first line is to compensate for the mismatch between the sample rate of the audio file and the orchestra sample rate.
Bye,
Iain

> From: darren@curiomusic.com
> To: csound@lists.bath.ac.uk
> Date: Tue, 20 May 2008 06:44:31 -0400
> Subject: [Csnd] loscil problem
>
> Hello.
>
> I'm trying to loop a 13-minute wav file using loscil/GEN01. When I run
> my csd, only the first 7 seconds of the wav are played and looped. Can
> someone please advise me on how to get the full soundfile looped?
> Here's my source. The soundfile, btw, is at a 11025 sampling rate. I
> figure I have to use a low sampling rate to fit into GEN01. Thanks!
>
> <CsoundSynthesizer>
> <CsInstruments>
> sr = 44100
> ksmps = 10
> nchnls = 2
>
> gi_sample_1 ftgen 0, 0, 0, 1, "Declaration_of_Independence-
> Read_by_DJD.wav", 0, 0, 0
>
> instr DecInd
> kamp = p4
> ;kamp chanctrl 1, 2, 0, p4
> kcps = 1
> ifn = gi_sample_1
> ibas = 1
> a1 loscil kamp, kcps, ifn, ibas, 1
> outs a1, a1
> endin
>
> </CsInstruments>
> <CsScore>
> ; parameter1 p2 p3 p4
> ; instrument strt dur amp
> i "DecInd" 0 999 30000
>
> e
> </CsScore>
>
> </CsoundSynthesizer>
> <MacOptions>
> Version: 3
> Render: Real
> Ask: No
> Functions: ioObject
> Listing: ioObject
> WindowBounds: 519 44 1742 1105
> CurrentView: orc
> IOViewEdit: Off
> Options: -b128 -A -o/Users/darren/Music/Csound/Fourth of July/Fourth
> of July.aif -f -m135 -R --midi-velocity-amp=4 --midi-key-cps=5
> </MacOptions>
> <MacGUI>
> ioView background {60108, 65535, 63132}
> ioListing {511, 17} {578, 634}
> ioGraph {26, 17} {483, 634}
> </MacGUI>
>
>
>
>
>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Keep your kids safer online with Windows Live Family Safety. Help protect your kids.

Date2008-05-20 22:22
FromDarren Nelsen
Subject[Csnd] Re: RE: loscil problem
Thanks. I will give that a shot and let you know how it works out.
Darren

On May 20, 2008, at 7:39 AM, Iain McCurdy wrote:

Have you considered using diskin2? You won't have to reduce the sampling rate so drastically  with it.
loscil can be a bit flakey with very long deferred size GEN 1 tables. You could read it instead with table3:

    andx    phasor    sr/(nsamp(ifn)*4)
    a1    table3    andx*nsamp(ifn), ifn
    a1    =    a1*kamp

You can't use a deferred size table with this so you need to give your table a size of 16777217 . The '4' in the first line is to compensate for the mismatch between the sample rate of the audio file and the orchestra sample rate.
Bye,
Iain 


Date2008-05-26 13:13
FromDarren Nelsen
Subject[Csnd] Re: RE: loscil problem
Thanks, Iain. diskin2 works best for my purposes. I appreciate it!
--
Darren

On May 20, 2008, at 7:39 AM, Iain McCurdy wrote:

Have you considered using diskin2? You won't have to reduce the sampling rate so drastically  with it.
loscil can be a bit flakey with very long deferred size GEN 1 tables. You could read it instead with table3:

    andx    phasor    sr/(nsamp(ifn)*4)
    a1    table3    andx*nsamp(ifn), ifn
    a1    =    a1*kamp

You can't use a deferred size table with this so you need to give your table a size of 16777217 . The '4' in the first line is to compensate for the mismatch between the sample rate of the audio file and the orchestra sample rate.
Bye,
Iain 

> From: darren@curiomusic.com
> To: csound@lists.bath.ac.uk
> Date: Tue, 20 May 2008 06:44:31 -0400
> Subject: [Csnd] loscil problem
> 
> Hello.
> 
> I'm trying to loop a 13-minute wav file using loscil/GEN01. When I run 
> my csd, only the first 7 seconds of the wav are played and looped. Can 
> someone please advise me on how to get the full soundfile looped? 
> Here's my source. The soundfile, btw, is at a 11025 sampling rate. I 
> figure I have to use a low sampling rate to fit into GEN01. Thanks!
> 
> <CsoundSynthesizer>
> <CsInstruments>
> sr = 44100
> ksmps = 10
> nchnls = 2
> 
> gi_sample_1 ftgen 0, 0, 0, 1, "Declaration_of_Independence- 
> Read_by_DJD.wav", 0, 0, 0
> 
> instr DecInd
> kamp = p4
> ;kamp chanctrl 1, 2, 0, p4
> kcps = 1
> ifn = gi_sample_1
> ibas = 1
> a1 loscil kamp, kcps, ifn, ibas, 1
> outs a1, a1
> endin
> 
> </CsInstruments>
> <CsScore>
> ; parameter1 p2 p3 p4
> ; instrument strt dur amp
> i "DecInd" 0 999 30000
> 
> e
> </CsScore>
> 
> </CsoundSynthesizer>
> <MacOptions>
> Version: 3
> Render: Real
> Ask: No
> Functions: ioObject
> Listing: ioObject
> WindowBounds: 519 44 1742 1105
> CurrentView: orc
> IOViewEdit: Off
> Options: -b128 -A -o/Users/darren/Music/Csound/Fourth of July/Fourth 
> of July.aif -f -m135 -R --midi-velocity-amp=4 --midi-key-cps=5
> </MacOptions>
> <MacGUI>
> ioView background {60108, 65535, 63132}
> ioListing {511, 17} {578, 634}
> ioGraph {26, 17} {483, 634}
> </MacGUI>
> 
> 
> 
> 
> 
> 
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Keep your kids safer online with Windows Live Family Safety. Help protect your kids.