Csound Csound-dev Csound-tekno Search About

[Csnd] File not looping correctly with phasor and mincer

Date2013-05-04 17:12
FromAndrew Ikenberry
Subject[Csnd] File not looping correctly with phasor and mincer
Hello List!

I am having trouble looping a sound file.
The file is being put into a table using gen 1.
I am using phasor as the read pointer, and mincer is reading through the table.
My problem is that there is a small gap of silence at the end of the table when it wraps around to the beginning which is very perceptible when I am using drum loops.
Any help would be greatly appreciated!!!

<CsoundSynthesizer>

<CsOptions>

-odac

</CsOptions>

<CsInstruments>


sr = 44100

ksmps = 1

nchnls = 1

0dbfs = 1



instr 1

; Speed of Playback

itimescale = .7

iamp = .8


ilength filelen "amenMono.wav"

gifile ftgen 1, 0, 0, 1, "amenMono.wav", 0, 0, 0


; Table Read Pointer

aphs phasor (1/ilength)*itimescale

atimpt = ilength *aphs


asig mincer atimpt, iamp, 1, 1, 1


out asig


endin

</CsInstruments>

<CsScore>


i1 0 100


</CsScore>

</CsoundSynthesizer>



Date2013-05-04 19:59
Frompeiman khosravi
SubjectRe: [Csnd] File not looping correctly with phasor and mincer
Just a wild guess but the table size is not being rounded to the nearest power of two is it? Can you print the table size and compare it with the file size in samples? 






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 17:12, Andrew Ikenberry <aikenberry@berklee.edu> wrote:
Hello List!

I am having trouble looping a sound file.
The file is being put into a table using gen 1.
I am using phasor as the read pointer, and mincer is reading through the table.
My problem is that there is a small gap of silence at the end of the table when it wraps around to the beginning which is very perceptible when I am using drum loops.
Any help would be greatly appreciated!!!

<CsoundSynthesizer>

<CsOptions>

-odac

</CsOptions>

<CsInstruments>


sr = 44100

ksmps = 1

nchnls = 1

0dbfs = 1



instr 1

; Speed of Playback

itimescale = .7

iamp = .8


ilength filelen "amenMono.wav"

gifile ftgen 1, 0, 0, 1, "amenMono.wav", 0, 0, 0


; Table Read Pointer

aphs phasor (1/ilength)*itimescale

atimpt = ilength *aphs


asig mincer atimpt, iamp, 1, 1, 1


out asig


endin

</CsInstruments>

<CsScore>


i1 0 100


</CsScore>

</CsoundSynthesizer>




Date2013-05-04 20:05
Frompeiman khosravi
SubjectRe: [Csnd] File not looping correctly with phasor and mincer
I just tested your csd and it works fine here. And I can confirm that the table length is deferred: 

opening AIFF infile /Applications/Max6/examples/sounds/blah.aif
  defer length 56715 

So it must be something to do with your file. Which Csound version are you using?

P

Date2013-05-04 20:08
Frompeiman khosravi
SubjectRe: [Csnd] File not looping correctly with phasor and mincer
If you send me your file I can try it here. 

P






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 20:05, peiman khosravi <peimankhosravi@gmail.com> wrote:
I just tested your csd and it works fine here. And I can confirm that the table length is deferred: 

opening AIFF infile /Applications/Max6/examples/sounds/blah.aif
  defer length 56715 

So it must be something to do with your file. Which Csound version are you using?

P


Date2013-05-04 20:20
Frompeiman khosravi
SubjectRe: [Csnd] File not looping correctly with phasor and mincer
OK I see, I can hear a gap. It becomes noticeable when time stretching. 

I tried subtracting a second from the table to make sure it's not a silence at the end of the file:

ilength = ilength-1

And it's still there. It seems that mincer might be doing some internal rounding?

P  






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 20:08, peiman khosravi <peimankhosravi@gmail.com> wrote:
If you send me your file I can try it here. 

P






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 20:05, peiman khosravi <peimankhosravi@gmail.com> wrote:
I just tested your csd and it works fine here. And I can confirm that the table length is deferred: 

opening AIFF infile /Applications/Max6/examples/sounds/blah.aif
  defer length 56715 

So it must be something to do with your file. Which Csound version are you using?

P



Date2013-05-05 02:58
Fromzohar argaman
SubjectRe: [Csnd] File not looping correctly with phasor and mincer
AttachmentsNone  None  

Date2013-05-05 03:32
FromAndrew Ikenberry
SubjectRe: [Csnd] File not looping correctly with phasor and mincer
Thanks for the responses!
I'm not sure I understand what you mean by "freezing" a specific spot. How would I go about doing that?

Thanks,
Andrew


On Sat, May 4, 2013 at 9:58 PM, zohar argaman <zoharargaman@gmail.com> wrote:
i had a related problem, trying to remember to position of a loop using phasor. it was not because of table size or ftable reading method (i used table3).
it was because of phasor was changing while it was being read by the ftable reader function. in your case, its a-time phase and it looks like you're not "freezing" a specific spot in time with your phasor. but maybe it has something to do with that.

On Sunday, May 5, 2013 at 4:20 AM, peiman khosravi wrote:

OK I see, I can hear a gap. It becomes noticeable when time stretching. 

I tried subtracting a second from the table to make sure it's not a silence at the end of the file:

ilength = ilength-1

And it's still there. It seems that mincer might be doing some internal rounding?

P  






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 20:08, peiman khosravi <peimankhosravi@gmail.com> wrote:
If you send me your file I can try it here. 

P






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 20:05, peiman khosravi <peimankhosravi@gmail.com> wrote:
I just tested your csd and it works fine here. And I can confirm that the table length is deferred: 

opening AIFF infile /Applications/Max6/examples/sounds/blah.aif
  defer length 56715 

So it must be something to do with your file. Which Csound version are you using?

P





Date2013-05-06 21:14
FromAndrew Ikenberry
SubjectRe: [Csnd] File not looping correctly with phasor and mincer
Does anybody know of an alternative opcode to mincer or perhaps an alternative method of reading a table that would prevent this?

Thanks,

Andrew


On Sat, May 4, 2013 at 10:32 PM, Andrew Ikenberry <aikenberry@berklee.edu> wrote:
Thanks for the responses!
I'm not sure I understand what you mean by "freezing" a specific spot. How would I go about doing that?

Thanks,
Andrew


On Sat, May 4, 2013 at 9:58 PM, zohar argaman <zoharargaman@gmail.com> wrote:
i had a related problem, trying to remember to position of a loop using phasor. it was not because of table size or ftable reading method (i used table3).
it was because of phasor was changing while it was being read by the ftable reader function. in your case, its a-time phase and it looks like you're not "freezing" a specific spot in time with your phasor. but maybe it has something to do with that.

On Sunday, May 5, 2013 at 4:20 AM, peiman khosravi wrote:

OK I see, I can hear a gap. It becomes noticeable when time stretching. 

I tried subtracting a second from the table to make sure it's not a silence at the end of the file:

ilength = ilength-1

And it's still there. It seems that mincer might be doing some internal rounding?

P  






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 20:08, peiman khosravi <peimankhosravi@gmail.com> wrote:
If you send me your file I can try it here. 

P






www.peimankhosravi.co.uk || Subscribe to RSS Feed

To receive emails about upcoming concerts visit this page & enter your email address in the 'follow' section.



On 4 May 2013 20:05, peiman khosravi <peimankhosravi@gmail.com> wrote:
I just tested your csd and it works fine here. And I can confirm that the table length is deferred: 

opening AIFF infile /Applications/Max6/examples/sounds/blah.aif
  defer length 56715 

So it must be something to do with your file. Which Csound version are you using?

P