Csound Csound-dev Csound-tekno Search About

[Csnd] Syncgrain Question

Date2022-10-28 21:54
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] Syncgrain Question
The .csd below works fine for me except for the fact that sample iterations do not maintain their initial pitch when a (random) pitch change is introduced. The pitch of ALL sounding iterations change. (Either this or the iteration stops - it's a bit difficult to tell.)

I have adapted this example from Victor's in the Csound manual, making only necessary changes that apply to my context. Note that the entire sample is the grain, and iterations follow regularly one after the other. My desired result (i.e., pitch remaining constant for the duration of an iteration) is the default behavior exhibited by grain2 and grain3. Is it possible to achieve it with syncgrain?

So, can anyone, especially Victor, suggest a remedy? I am not averse to using grain2 or grain3, but they seem to take me down a dark rabbit hole from which it is difficult to emerge (especially with such complex/abstruse examples).

All suggestions much appreciated.

==================================
<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
0dbfs  = 1
nchnls = 2

instr 1

iolaps  = 100
iFoxLen filelen "fox.wav"
igrsize = iFoxLen
ifreq = 1
iprate = 0

ipitch  = p4   /* pitchscale */
krpitch randh .2, ifreq, 0

asig syncgrain 1, ifreq, ipitch + krpitch, igrsize, iprate, 1, 2, iolaps
outs  asig, asig

endin
</CsInstruments>
<CsScore>
f1 0 0 1 "fox.wav" 0 0 0 ;deferred table
f2   0   8192   20   2   1

i1 0 20 1
e
</CsScore>
</CsoundSynthesizer> 
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-10-28 22:30
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Syncgrain Question
The simple answer is that the pitch will
vary continuously inside a grain, that's how syncgrain works.

You should try the FOF family, fof, fof2, fog.
Off the top of my head I know that FOF at least has a mode where pitch is kept constant for each grain. Not sure if the others keep this mode/option.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 28 Oct 2022, at 21:55, Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

The .csd below works fine for me except for the fact that sample iterations do not maintain their initial pitch when a (random) pitch change is introduced. The pitch of ALL sounding iterations change. (Either this or the iteration stops - it's a bit difficult to tell.)

I have adapted this example from Victor's in the Csound manual, making only necessary changes that apply to my context. Note that the entire sample is the grain, and iterations follow regularly one after the other. My desired result (i.e., pitch remaining constant for the duration of an iteration) is the default behavior exhibited by grain2 and grain3. Is it possible to achieve it with syncgrain?

So, can anyone, especially Victor, suggest a remedy? I am not averse to using grain2 or grain3, but they seem to take me down a dark rabbit hole from which it is difficult to emerge (especially with such complex/abstruse examples).

All suggestions much appreciated.

==================================
<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
0dbfs  = 1
nchnls = 2

instr 1

iolaps  = 100
iFoxLen filelen "fox.wav"
igrsize = iFoxLen
ifreq = 1
iprate = 0

ipitch  = p4   /* pitchscale */
krpitch randh .2, ifreq, 0

asig syncgrain 1, ifreq, ipitch + krpitch, igrsize, iprate, 1, 2, iolaps
outs  asig, asig

endin
</CsInstruments>
<CsScore>
f1 0 0 1 "fox.wav" 0 0 0 ;deferred table
f2   0   8192   20   2   1

i1 0 20 1
e
</CsScore>
</CsoundSynthesizer> 
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here