Csound Csound-dev Csound-tekno Search About

[Csnd] Re: for all the budding popstars out there

Date2010-09-01 22:37
FromJacob Joaquin
Subject[Csnd] Re: for all the budding popstars out there
I can't wait to play with this!

Best,
Jake

Date2010-09-01 22:39
FromVictor Lazzarini
Subject[Csnd] for all the budding popstars out there
Attachmentsautotune.csd  
 From an original idea by Brian Carty, and with apologies to our  
microtonalist friends, here's an indispensable
tool for all the budding popstars among us: an autotune + harmoniser.  
Hours of fun for all the family.

Victor



-b128 -B256



sr = 44100
ksmps = 64
nchnls = 1

opcode  PitchShifter, a, akkii
         setksmps  1                   ; kr=sr
asig,kpitch,kfdb,idel,iwin  xin
kdelrate = (kpitch-1)/idel
avdel   phasor -kdelrate               ; 1 to 0
avdel2  phasor -kdelrate, 0.5          ; 1/2 buffer offset
afade  tablei avdel, iwin, 1, 0, 1     ; crossfade windows
afade2 tablei avdel2,iwin, 1, 0, 1
adump  delayr idel
atap1  deltapi avdel*idel           ; variable delay taps
atap2  deltapi avdel2*idel
amix   =   atap1*afade + atap2*afade2  ; fade in/out the delay taps
        delayw  asig+amix*kfdb          ; in+feedback signals
        xout  amix
endop

/**** autotune  ***********************************/
/* aout Autotune asig,ism,ikey,ifn[,imeth]           */
/* asig -  
input                                                           */
/* ism - smoothing time in secs                            */
/* ikey - key (0 = C,... ,11 = B    		                   */
/* ifn - table containing scale pitch classes (7)  */
/* imeth - pitch track method: 0 - pitch (default) */
/*         1 - ptrack, 2 - pitchamdf                              */
/***************************************************/

opcode Autotune, a, aiiio

iwinsize = 1024
ibase = 440
ibasemidi = 69

asig,ism,itrans,ifn,im  xin

if im == 0 then
kfr, kamp pitch asig,0.1,6.00,9.00,0
kfr = cpsoct(kfr)
elseif im == 1 then
kfr, kamp ptrack asig, 1024
else
kfr, kamp pitchamdf asig,130,1040
endif

if (kfr > 10) kgoto ok
kfr = 440
ok:

ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
ktet = round(ktemp)

kpos init 0
itrans = 2
test:
knote table kpos, ifn     ; get a pitch class from table
ktest = ktet % 12       ;  note mod 12
knote = (knote+itrans) % 12 ; plus transpose interval mod 12
if ktest == knote kgoto next ; test if note matches pitch class +  
transposition
kpos = kpos + 1           ; increment table pos
if kpos >= 7  kgoto shift ; if more than or pitch class set we need to  
shift it
kgoto test                ; loop back

shift:
if (ktemp >= ktet) kgoto plus
ktet = ktet - 1
kgoto next
plus:
ktet = ktet + 1

next:
kpos = 0
ktarget = ibase * (2 ^ ((ktet - ibasemidi) / 12))
kratio = ktarget/kfr
kratioport port kratio, ism, ibase

aout PitchShifter asig,kratioport,0,0.1,5

       xout     aout
endop

instr 1

ain inch 1

interv1 = 2^(p6/12)
interv2 = 2^(p7/12)
	
ain2 	PitchShifter ain*0.5,interv1,0,0.1,5
ain3  PitchShifter ain*0.5,interv2,0,0.1,5

aout 	Autotune 	ain,0.01,p4,p5
aout2 Autotune	ain2,0.01,p4,p5
aout3 Autotune 	ain3,0.01,p4,p5

	out 		(aout+aout2+aout3)*0.5

endin




f3 0 8 -2  0 2 4 5 7 9 11 12 ; major mode
f4 0 8 -2  0 2 3 5 7 8 10 12 ; minor mode
f5 0 16384 20 1

;       key mode intvl1 intvl2(semitones)
i1 0 60 0    3   -5     4  ; C major 6-4 harmonies
i1 + 60 0    4   -3     5  ; C minor (natural) 6-3 harmonies





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"



Date2010-09-01 23:11
FromRichard Dobson
Subject[Csnd] Re: for all the budding popstars out there
Very cool! And not an fsig in sight. The question is - will the absence 
of a hyphen be enough to keep the Antares lawyers happy?
:-)

Richard Dobson

On 01/09/2010 22:39, Victor Lazzarini wrote:
...
..
> opcode Autotune, a, aiiio
>



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"

Date2010-09-01 23:21
FromVictor Lazzarini
Subject[Csnd] Re: for all the budding popstars out there
Attachmentsautotune1.csd  
and before anyone asks, here's a phase vocoder version (closer to  
Brian's original), perhaps more Cher-like, if you're so inclined...



-B512 -b256


sr = 44100
ksmps = 64
nchnls = 1
opcode PitchShifter, a, akkii
setksmps 1 ; kr=sr
asig,kpitch,kfdb,idel,iwin xin
kdelrate = (kpitch-1)/idel
avdel phasor -kdelrate ; 1 to 0
avdel2 phasor -kdelrate, 0.5 ; 1/2 buffer offset
afade tablei avdel, iwin, 1, 0, 1 ; crossfade windows
afade2 tablei avdel2,iwin, 1, 0, 1
adump delayr idel
atap1 deltapi avdel*idel ; variable delay taps
atap2 deltapi avdel2*idel
amix = atap1*afade + atap2*afade2 ; fade in/out the delay taps
delayw asig+amix*kfdb ; in+feedback signals
xout amix
endop
opcode Autotune, ak, aiii
ifftsize = 512
iwtype = 1
ibase = 440
ibasemidi = 69
asig,ism,itrans,ifn xin
fsig pvsanal	asig, ifftsize, ifftsize / 4, ifftsize, iwtype;
kfr, kamp pitchamdf asig, 130, 1040
if (kfr > 10) kgoto ok
kfr = 440
ok:
ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
kmidi = round(ktemp)
kpos init 0
itrans = 2
test:
knote table kpos, ifn ; get a pitch class
ktest = kmidi % 12 ; note mod 12
knote = (knote+itrans) % 12
if ktest == knote kgoto next ; test if note matches pitch class +  
transposition
kpos = kpos + 1 ; increment table pos
if kpos >= 7 kgoto shift ; if more than or pitch class set we need to  
shift it
kgoto test ; loop back
shift:
if (ktemp >= kmidi) kgoto plus
kmidi = kmidi - 1
kgoto next
plus:
kmidi = kmidi + 1
next:
kpos = 0
ktarget = ibase * (2 ^ ((kmidi - ibasemidi) / 12))
kratio = ktarget/kfr
kratioport port kratio, ism, ibase
fauto pvscale fsig, kratioport ; transpose it (optional param: formants)
aout pvsynth fauto
xout aout, kfr
endop
instr 1
ain inch 1
interv1 = 2^(p4/12)
interv2 = 2^(p5/12)
ain2 PitchShifter ain*0.5,interv1,0,0.1,5
ain3 PitchShifter ain*0.5,interv2,0,0.1,5
aout, kfr Autotune ain, 0.01,2,4
aout2, kfr Autotune	ain2, 0.01,2,4
aout3, kfr Autotune ain3, 0.01,2,4
out (aout+aout2+aout3)*0.3
endin


f3 0 8 -2 0 2 4 5 7 9 11 12
f4 0 8 -2 0 2 3 5 7 8 10 12
f5 0 16384 20 1
i1 0 60 -5 4



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"




Date2010-09-01 23:25
FromVictor Lazzarini
Subject[Csnd] Re: Re: for all the budding popstars out there
For fsigs, see the next version...
As for Antares, that is indeed a good question! So let's keep the  
hyphen out, just to be safe...

Victor
On 1 Sep 2010, at 23:11, Richard Dobson wrote:

> Very cool! And not an fsig in sight. The question is - will the  
> absence of a hyphen be enough to keep the Antares lawyers happy?
> :-)
>
> Richard Dobson
>
> On 01/09/2010 22:39, Victor Lazzarini wrote:
> ...
> ..
>> opcode Autotune, a, aiiio
>>
>
>
>
> 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"

Date2010-09-01 23:42
FromDave Seidel
Subject[Csnd] Re: for all the budding popstars out there
Very cool, Victor, I'm looking forward to seeing to what nefarious use I 
might out it.  Could also be interesting to implement a non-12TET tuning 
algorithm...

- Dave

On 9/1/2010 5:39 PM, Victor Lazzarini wrote:
>
>  From an original idea by Brian Carty, and with apologies to our
> microtonalist friends, here's an indispensable
> tool for all the budding popstars among us: an autotune + harmoniser.
> Hours of fun for all the family.
>
> Victor
>
> 
> 
> -b128 -B256
> 
> 
>
> sr = 44100
> ksmps = 64
> nchnls = 1
>
> opcode PitchShifter, a, akkii
> setksmps 1 ; kr=sr
> asig,kpitch,kfdb,idel,iwin xin
> kdelrate = (kpitch-1)/idel
> avdel phasor -kdelrate ; 1 to 0
> avdel2 phasor -kdelrate, 0.5 ; 1/2 buffer offset
> afade tablei avdel, iwin, 1, 0, 1 ; crossfade windows
> afade2 tablei avdel2,iwin, 1, 0, 1
> adump delayr idel
> atap1 deltapi avdel*idel ; variable delay taps
> atap2 deltapi avdel2*idel
> amix = atap1*afade + atap2*afade2 ; fade in/out the delay taps
> delayw asig+amix*kfdb ; in+feedback signals
> xout amix
> endop
>
> /**** autotune ***********************************/
> /* aout Autotune asig,ism,ikey,ifn[,imeth] */
> /* asig - input */
> /* ism - smoothing time in secs */
> /* ikey - key (0 = C,... ,11 = B */
> /* ifn - table containing scale pitch classes (7) */
> /* imeth - pitch track method: 0 - pitch (default) */
> /* 1 - ptrack, 2 - pitchamdf */
> /***************************************************/
>
> opcode Autotune, a, aiiio
>
> iwinsize = 1024
> ibase = 440
> ibasemidi = 69
>
> asig,ism,itrans,ifn,im xin
>
> if im == 0 then
> kfr, kamp pitch asig,0.1,6.00,9.00,0
> kfr = cpsoct(kfr)
> elseif im == 1 then
> kfr, kamp ptrack asig, 1024
> else
> kfr, kamp pitchamdf asig,130,1040
> endif
>
> if (kfr > 10) kgoto ok
> kfr = 440
> ok:
>
> ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
> ktet = round(ktemp)
>
> kpos init 0
> itrans = 2
> test:
> knote table kpos, ifn ; get a pitch class from table
> ktest = ktet % 12 ; note mod 12
> knote = (knote+itrans) % 12 ; plus transpose interval mod 12
> if ktest == knote kgoto next ; test if note matches pitch class +
> transposition
> kpos = kpos + 1 ; increment table pos
> if kpos >= 7 kgoto shift ; if more than or pitch class set we need to
> shift it
> kgoto test ; loop back
>
> shift:
> if (ktemp >= ktet) kgoto plus
> ktet = ktet - 1
> kgoto next
> plus:
> ktet = ktet + 1
>
> next:
> kpos = 0
> ktarget = ibase * (2 ^ ((ktet - ibasemidi) / 12))
> kratio = ktarget/kfr
> kratioport port kratio, ism, ibase
>
> aout PitchShifter asig,kratioport,0,0.1,5
>
> xout aout
> endop
>
> instr 1
>
> ain inch 1
>
> interv1 = 2^(p6/12)
> interv2 = 2^(p7/12)
>
> ain2 PitchShifter ain*0.5,interv1,0,0.1,5
> ain3 PitchShifter ain*0.5,interv2,0,0.1,5
>
> aout Autotune ain,0.01,p4,p5
> aout2 Autotune ain2,0.01,p4,p5
> aout3 Autotune ain3,0.01,p4,p5
>
> out (aout+aout2+aout3)*0.5
>
> endin
>
> 
> 
>
> f3 0 8 -2 0 2 4 5 7 9 11 12 ; major mode
> f4 0 8 -2 0 2 3 5 7 8 10 12 ; minor mode
> f5 0 16384 20 1
>
> ; key mode intvl1 intvl2(semitones)
> i1 0 60 0 3 -5 4 ; C major 6-4 harmonies
> i1 + 60 0 4 -3 5 ; C minor (natural) 6-3 harmonies
>
>
> 
> 
>
> 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"

Date2010-09-02 00:24
FromGreg Schroeder
Subject[Csnd] Re: Re: for all the budding popstars out there
This indeed looks cool.
More of this, please!
Greg

On Thu, Sep 2, 2010 at 7:42 AM, Dave Seidel  wrote:
> Very cool, Victor, I'm looking forward to seeing to what nefarious use I
> might out it.  Could also be interesting to implement a non-12TET tuning
> algorithm...
>
> - Dave
>
> On 9/1/2010 5:39 PM, Victor Lazzarini wrote:
>>
>>  From an original idea by Brian Carty, and with apologies to our
>> microtonalist friends, here's an indispensable
>> tool for all the budding popstars among us: an autotune + harmoniser.
>> Hours of fun for all the family.
>>
>> Victor
>>
>> 
>> 
>> -b128 -B256
>> 
>> 
>>
>> sr = 44100
>> ksmps = 64
>> nchnls = 1
>>
>> opcode PitchShifter, a, akkii
>> setksmps 1 ; kr=sr
>> asig,kpitch,kfdb,idel,iwin xin
>> kdelrate = (kpitch-1)/idel
>> avdel phasor -kdelrate ; 1 to 0
>> avdel2 phasor -kdelrate, 0.5 ; 1/2 buffer offset
>> afade tablei avdel, iwin, 1, 0, 1 ; crossfade windows
>> afade2 tablei avdel2,iwin, 1, 0, 1
>> adump delayr idel
>> atap1 deltapi avdel*idel ; variable delay taps
>> atap2 deltapi avdel2*idel
>> amix = atap1*afade + atap2*afade2 ; fade in/out the delay taps
>> delayw asig+amix*kfdb ; in+feedback signals
>> xout amix
>> endop
>>
>> /**** autotune ***********************************/
>> /* aout Autotune asig,ism,ikey,ifn[,imeth] */
>> /* asig - input */
>> /* ism - smoothing time in secs */
>> /* ikey - key (0 = C,... ,11 = B */
>> /* ifn - table containing scale pitch classes (7) */
>> /* imeth - pitch track method: 0 - pitch (default) */
>> /* 1 - ptrack, 2 - pitchamdf */
>> /***************************************************/
>>
>> opcode Autotune, a, aiiio
>>
>> iwinsize = 1024
>> ibase = 440
>> ibasemidi = 69
>>
>> asig,ism,itrans,ifn,im xin
>>
>> if im == 0 then
>> kfr, kamp pitch asig,0.1,6.00,9.00,0
>> kfr = cpsoct(kfr)
>> elseif im == 1 then
>> kfr, kamp ptrack asig, 1024
>> else
>> kfr, kamp pitchamdf asig,130,1040
>> endif
>>
>> if (kfr > 10) kgoto ok
>> kfr = 440
>> ok:
>>
>> ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
>> ktet = round(ktemp)
>>
>> kpos init 0
>> itrans = 2
>> test:
>> knote table kpos, ifn ; get a pitch class from table
>> ktest = ktet % 12 ; note mod 12
>> knote = (knote+itrans) % 12 ; plus transpose interval mod 12
>> if ktest == knote kgoto next ; test if note matches pitch class +
>> transposition
>> kpos = kpos + 1 ; increment table pos
>> if kpos >= 7 kgoto shift ; if more than or pitch class set we need to
>> shift it
>> kgoto test ; loop back
>>
>> shift:
>> if (ktemp >= ktet) kgoto plus
>> ktet = ktet - 1
>> kgoto next
>> plus:
>> ktet = ktet + 1
>>
>> next:
>> kpos = 0
>> ktarget = ibase * (2 ^ ((ktet - ibasemidi) / 12))
>> kratio = ktarget/kfr
>> kratioport port kratio, ism, ibase
>>
>> aout PitchShifter asig,kratioport,0,0.1,5
>>
>> xout aout
>> endop
>>
>> instr 1
>>
>> ain inch 1
>>
>> interv1 = 2^(p6/12)
>> interv2 = 2^(p7/12)
>>
>> ain2 PitchShifter ain*0.5,interv1,0,0.1,5
>> ain3 PitchShifter ain*0.5,interv2,0,0.1,5
>>
>> aout Autotune ain,0.01,p4,p5
>> aout2 Autotune ain2,0.01,p4,p5
>> aout3 Autotune ain3,0.01,p4,p5
>>
>> out (aout+aout2+aout3)*0.5
>>
>> endin
>>
>> 
>> 
>>
>> f3 0 8 -2 0 2 4 5 7 9 11 12 ; major mode
>> f4 0 8 -2 0 2 3 5 7 8 10 12 ; minor mode
>> f5 0 16384 20 1
>>
>> ; key mode intvl1 intvl2(semitones)
>> i1 0 60 0 3 -5 4 ; C major 6-4 harmonies
>> i1 + 60 0 4 -3 5 ; C minor (natural) 6-3 harmonies
>>
>>
>> 
>> 
>>
>> 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"
>
>


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"


Date2010-09-05 14:07
FromRichard Boulanger
Subject[Csnd] Re: for all the budding popstars out there
Victor,

Thanks for making and posting these "autotune" instruments.  
(And thanks also to Brian Carty for inspiring them.)

In this week's "first" Csound class at Berklee, I will definitely be "singing" some part of the lesson!

Dr.B.

On Sep 1, 2010, at 5:39 PM, Victor Lazzarini wrote:

> 
> From an original idea by Brian Carty, and with apologies to our microtonalist friends, here's an indispensable
> tool for all the budding popstars among us: an autotune + harmoniser. Hours of fun for all the family.
> 
> Victor
> 
> 
> 
> -b128 -B256
> 
> 
> 
> sr = 44100
> ksmps = 64
> nchnls = 1
> 
> opcode  PitchShifter, a, akkii
>        setksmps  1                   ; kr=sr
> asig,kpitch,kfdb,idel,iwin  xin
> kdelrate = (kpitch-1)/idel
> avdel   phasor -kdelrate               ; 1 to 0
> avdel2  phasor -kdelrate, 0.5          ; 1/2 buffer offset
> afade  tablei avdel, iwin, 1, 0, 1     ; crossfade windows
> afade2 tablei avdel2,iwin, 1, 0, 1
> adump  delayr idel
> atap1  deltapi avdel*idel           ; variable delay taps
> atap2  deltapi avdel2*idel
> amix   =   atap1*afade + atap2*afade2  ; fade in/out the delay taps
>       delayw  asig+amix*kfdb          ; in+feedback signals
>       xout  amix
> endop
> 
> /**** autotune  ***********************************/
> /* aout Autotune asig,ism,ikey,ifn[,imeth]           */
> /* asig - input                                                           */
> /* ism - smoothing time in secs                            */
> /* ikey - key (0 = C,... ,11 = B    		                   */
> /* ifn - table containing scale pitch classes (7)  */
> /* imeth - pitch track method: 0 - pitch (default) */
> /*         1 - ptrack, 2 - pitchamdf                              */
> /***************************************************/
> 
> opcode Autotune, a, aiiio
> 
> iwinsize = 1024
> ibase = 440
> ibasemidi = 69
> 
> asig,ism,itrans,ifn,im  xin
> 
> if im == 0 then
> kfr, kamp pitch asig,0.1,6.00,9.00,0
> kfr = cpsoct(kfr)
> elseif im == 1 then
> kfr, kamp ptrack asig, 1024
> else
> kfr, kamp pitchamdf asig,130,1040
> endif
> 
> if (kfr > 10) kgoto ok
> kfr = 440
> ok:
> 
> ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
> ktet = round(ktemp)
> 
> kpos init 0
> itrans = 2
> test:
> knote table kpos, ifn     ; get a pitch class from table
> ktest = ktet % 12       ;  note mod 12
> knote = (knote+itrans) % 12 ; plus transpose interval mod 12
> if ktest == knote kgoto next ; test if note matches pitch class + transposition
> kpos = kpos + 1           ; increment table pos
> if kpos >= 7  kgoto shift ; if more than or pitch class set we need to shift it
> kgoto test                ; loop back
> 
> shift:
> if (ktemp >= ktet) kgoto plus
> ktet = ktet - 1
> kgoto next
> plus:
> ktet = ktet + 1
> 
> next:
> kpos = 0
> ktarget = ibase * (2 ^ ((ktet - ibasemidi) / 12))
> kratio = ktarget/kfr
> kratioport port kratio, ism, ibase
> 
> aout PitchShifter asig,kratioport,0,0.1,5
> 
>      xout     aout
> endop
> 
> instr 1
> 
> ain inch 1
> 
> interv1 = 2^(p6/12)
> interv2 = 2^(p7/12)
> 	
> ain2 	PitchShifter ain*0.5,interv1,0,0.1,5
> ain3  PitchShifter ain*0.5,interv2,0,0.1,5
> 
> aout 	Autotune 	ain,0.01,p4,p5
> aout2 Autotune	ain2,0.01,p4,p5
> aout3 Autotune 	ain3,0.01,p4,p5
> 
> 	out 		(aout+aout2+aout3)*0.5
> 
> endin
> 
> 
> 
> 
> f3 0 8 -2  0 2 4 5 7 9 11 12 ; major mode
> f4 0 8 -2  0 2 3 5 7 8 10 12 ; minor mode
> f5 0 16384 20 1
> 
> ;       key mode intvl1 intvl2(semitones)
> i1 0 60 0    3   -5     4  ; C major 6-4 harmonies
> i1 + 60 0    4   -3     5  ; C minor (natural) 6-3 harmonies
> 
> 
> 
> 
> 
> 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"


Date2010-09-05 16:01
FromVictor Lazzarini
Subject[Csnd] Re: Re: for all the budding popstars out there
For the PV-based one, you can trying changing the fftsize from 512 to  
1024 for a more recognisable vocoder effect.
Victor
On 5 Sep 2010, at 14:07, Richard Boulanger wrote:

> Victor,
>
> Thanks for making and posting these "autotune" instruments.
> (And thanks also to Brian Carty for inspiring them.)
>
> In this week's "first" Csound class at Berklee, I will definitely be  
> "singing" some part of the lesson!
>
> Dr.B.
>
> On Sep 1, 2010, at 5:39 PM, Victor Lazzarini wrote:
>
>>
>> From an original idea by Brian Carty, and with apologies to our  
>> microtonalist friends, here's an indispensable
>> tool for all the budding popstars among us: an autotune +  
>> harmoniser. Hours of fun for all the family.
>>
>> Victor
>>
>> 
>> 
>> -b128 -B256
>> 
>> 
>>
>> sr = 44100
>> ksmps = 64
>> nchnls = 1
>>
>> opcode  PitchShifter, a, akkii
>>       setksmps  1                   ; kr=sr
>> asig,kpitch,kfdb,idel,iwin  xin
>> kdelrate = (kpitch-1)/idel
>> avdel   phasor -kdelrate               ; 1 to 0
>> avdel2  phasor -kdelrate, 0.5          ; 1/2 buffer offset
>> afade  tablei avdel, iwin, 1, 0, 1     ; crossfade windows
>> afade2 tablei avdel2,iwin, 1, 0, 1
>> adump  delayr idel
>> atap1  deltapi avdel*idel           ; variable delay taps
>> atap2  deltapi avdel2*idel
>> amix   =   atap1*afade + atap2*afade2  ; fade in/out the delay taps
>>      delayw  asig+amix*kfdb          ; in+feedback signals
>>      xout  amix
>> endop
>>
>> /**** autotune  ***********************************/
>> /* aout Autotune asig,ism,ikey,ifn[,imeth]           */
>> /* asig -  
>> input                                                           */
>> /* ism - smoothing time in secs                            */
>> /* ikey - key (0 = C,... ,11 = B    		                   */
>> /* ifn - table containing scale pitch classes (7)  */
>> /* imeth - pitch track method: 0 - pitch (default) */
>> /*         1 - ptrack, 2 - pitchamdf                              */
>> /***************************************************/
>>
>> opcode Autotune, a, aiiio
>>
>> iwinsize = 1024
>> ibase = 440
>> ibasemidi = 69
>>
>> asig,ism,itrans,ifn,im  xin
>>
>> if im == 0 then
>> kfr, kamp pitch asig,0.1,6.00,9.00,0
>> kfr = cpsoct(kfr)
>> elseif im == 1 then
>> kfr, kamp ptrack asig, 1024
>> else
>> kfr, kamp pitchamdf asig,130,1040
>> endif
>>
>> if (kfr > 10) kgoto ok
>> kfr = 440
>> ok:
>>
>> ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
>> ktet = round(ktemp)
>>
>> kpos init 0
>> itrans = 2
>> test:
>> knote table kpos, ifn     ; get a pitch class from table
>> ktest = ktet % 12       ;  note mod 12
>> knote = (knote+itrans) % 12 ; plus transpose interval mod 12
>> if ktest == knote kgoto next ; test if note matches pitch class +  
>> transposition
>> kpos = kpos + 1           ; increment table pos
>> if kpos >= 7  kgoto shift ; if more than or pitch class set we need  
>> to shift it
>> kgoto test                ; loop back
>>
>> shift:
>> if (ktemp >= ktet) kgoto plus
>> ktet = ktet - 1
>> kgoto next
>> plus:
>> ktet = ktet + 1
>>
>> next:
>> kpos = 0
>> ktarget = ibase * (2 ^ ((ktet - ibasemidi) / 12))
>> kratio = ktarget/kfr
>> kratioport port kratio, ism, ibase
>>
>> aout PitchShifter asig,kratioport,0,0.1,5
>>
>>     xout     aout
>> endop
>>
>> instr 1
>>
>> ain inch 1
>>
>> interv1 = 2^(p6/12)
>> interv2 = 2^(p7/12)
>> 	
>> ain2 	PitchShifter ain*0.5,interv1,0,0.1,5
>> ain3  PitchShifter ain*0.5,interv2,0,0.1,5
>>
>> aout 	Autotune 	ain,0.01,p4,p5
>> aout2 Autotune	ain2,0.01,p4,p5
>> aout3 Autotune 	ain3,0.01,p4,p5
>>
>> 	out 		(aout+aout2+aout3)*0.5
>>
>> endin
>>
>> 
>> 
>>
>> f3 0 8 -2  0 2 4 5 7 9 11 12 ; major mode
>> f4 0 8 -2  0 2 3 5 7 8 10 12 ; minor mode
>> f5 0 16384 20 1
>>
>> ;       key mode intvl1 intvl2(semitones)
>> i1 0 60 0    3   -5     4  ; C major 6-4 harmonies
>> i1 + 60 0    4   -3     5  ; C minor (natural) 6-3 harmonies
>>
>>
>> 
>> 
>>
>> 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"
>



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"

Date2010-09-19 12:36
FromAndres Cabrera
Subject[Csnd] Re: Re: Re: for all the budding popstars out there
AttachmentsAutotuner.csd  
Hi,

I've made a QuteCsound version, and I've included it in the examples.
Is that OK with you Victor?

Cheers,
Andrés

On Sun, Sep 5, 2010 at 4:01 PM, Victor Lazzarini
 wrote:
> For the PV-based one, you can trying changing the fftsize from 512 to 1024
> for a more recognisable vocoder effect.
> Victor
> On 5 Sep 2010, at 14:07, Richard Boulanger wrote:
>
>> Victor,
>>
>> Thanks for making and posting these "autotune" instruments.
>> (And thanks also to Brian Carty for inspiring them.)
>>
>> In this week's "first" Csound class at Berklee, I will definitely be
>> "singing" some part of the lesson!
>>
>> Dr.B.
>>
>> On Sep 1, 2010, at 5:39 PM, Victor Lazzarini wrote:
>>
>>>
>>> From an original idea by Brian Carty, and with apologies to our
>>> microtonalist friends, here's an indispensable
>>> tool for all the budding popstars among us: an autotune + harmoniser.
>>> Hours of fun for all the family.
>>>
>>> Victor
>>>
>>> 
>>> 
>>> -b128 -B256
>>> 
>>> 
>>>
>>> sr = 44100
>>> ksmps = 64
>>> nchnls = 1
>>>
>>> opcode  PitchShifter, a, akkii
>>>      setksmps  1                   ; kr=sr
>>> asig,kpitch,kfdb,idel,iwin  xin
>>> kdelrate = (kpitch-1)/idel
>>> avdel   phasor -kdelrate               ; 1 to 0
>>> avdel2  phasor -kdelrate, 0.5          ; 1/2 buffer offset
>>> afade  tablei avdel, iwin, 1, 0, 1     ; crossfade windows
>>> afade2 tablei avdel2,iwin, 1, 0, 1
>>> adump  delayr idel
>>> atap1  deltapi avdel*idel           ; variable delay taps
>>> atap2  deltapi avdel2*idel
>>> amix   =   atap1*afade + atap2*afade2  ; fade in/out the delay taps
>>>     delayw  asig+amix*kfdb          ; in+feedback signals
>>>     xout  amix
>>> endop
>>>
>>> /**** autotune  ***********************************/
>>> /* aout Autotune asig,ism,ikey,ifn[,imeth]           */
>>> /* asig - input
>>> */
>>> /* ism - smoothing time in secs                            */
>>> /* ikey - key (0 = C,... ,11 = B                                   */
>>> /* ifn - table containing scale pitch classes (7)  */
>>> /* imeth - pitch track method: 0 - pitch (default) */
>>> /*         1 - ptrack, 2 - pitchamdf                              */
>>> /***************************************************/
>>>
>>> opcode Autotune, a, aiiio
>>>
>>> iwinsize = 1024
>>> ibase = 440
>>> ibasemidi = 69
>>>
>>> asig,ism,itrans,ifn,im  xin
>>>
>>> if im == 0 then
>>> kfr, kamp pitch asig,0.1,6.00,9.00,0
>>> kfr = cpsoct(kfr)
>>> elseif im == 1 then
>>> kfr, kamp ptrack asig, 1024
>>> else
>>> kfr, kamp pitchamdf asig,130,1040
>>> endif
>>>
>>> if (kfr > 10) kgoto ok
>>> kfr = 440
>>> ok:
>>>
>>> ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
>>> ktet = round(ktemp)
>>>
>>> kpos init 0
>>> itrans = 2
>>> test:
>>> knote table kpos, ifn     ; get a pitch class from table
>>> ktest = ktet % 12       ;  note mod 12
>>> knote = (knote+itrans) % 12 ; plus transpose interval mod 12
>>> if ktest == knote kgoto next ; test if note matches pitch class +
>>> transposition
>>> kpos = kpos + 1           ; increment table pos
>>> if kpos >= 7  kgoto shift ; if more than or pitch class set we need to
>>> shift it
>>> kgoto test                ; loop back
>>>
>>> shift:
>>> if (ktemp >= ktet) kgoto plus
>>> ktet = ktet - 1
>>> kgoto next
>>> plus:
>>> ktet = ktet + 1
>>>
>>> next:
>>> kpos = 0
>>> ktarget = ibase * (2 ^ ((ktet - ibasemidi) / 12))
>>> kratio = ktarget/kfr
>>> kratioport port kratio, ism, ibase
>>>
>>> aout PitchShifter asig,kratioport,0,0.1,5
>>>
>>>    xout     aout
>>> endop
>>>
>>> instr 1
>>>
>>> ain inch 1
>>>
>>> interv1 = 2^(p6/12)
>>> interv2 = 2^(p7/12)
>>>
>>> ain2    PitchShifter ain*0.5,interv1,0,0.1,5
>>> ain3  PitchShifter ain*0.5,interv2,0,0.1,5
>>>
>>> aout    Autotune        ain,0.01,p4,p5
>>> aout2 Autotune  ain2,0.01,p4,p5
>>> aout3 Autotune  ain3,0.01,p4,p5
>>>
>>>        out             (aout+aout2+aout3)*0.5
>>>
>>> endin
>>>
>>> 
>>> 
>>>
>>> f3 0 8 -2  0 2 4 5 7 9 11 12 ; major mode
>>> f4 0 8 -2  0 2 3 5 7 8 10 12 ; minor mode
>>> f5 0 16384 20 1
>>>
>>> ;       key mode intvl1 intvl2(semitones)
>>> i1 0 60 0    3   -5     4  ; C major 6-4 harmonies
>>> i1 + 60 0    4   -3     5  ; C minor (natural) 6-3 harmonies
>>>
>>>
>>> 
>>> 
>>>
>>> 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"
>>
>
>
>
> 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"
>
>



-- 


Andrés

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"


Date2010-09-19 12:40
FromVictor Lazzarini
Subject[Csnd] Re: Re: Re: Re: for all the budding popstars out there
Of course, my pleasure.
On 19 Sep 2010, at 12:36, Andres Cabrera wrote:

> Hi,
>
> I've made a QuteCsound version, and I've included it in the examples.
> Is that OK with you Victor?
>
> Cheers,
> Andrés
>
> On Sun, Sep 5, 2010 at 4:01 PM, Victor Lazzarini
>  wrote:
>> For the PV-based one, you can trying changing the fftsize from 512  
>> to 1024
>> for a more recognisable vocoder effect.
>> Victor
>> On 5 Sep 2010, at 14:07, Richard Boulanger wrote:
>>
>>> Victor,
>>>
>>> Thanks for making and posting these "autotune" instruments.
>>> (And thanks also to Brian Carty for inspiring them.)
>>>
>>> In this week's "first" Csound class at Berklee, I will definitely be
>>> "singing" some part of the lesson!
>>>
>>> Dr.B.
>>>
>>> On Sep 1, 2010, at 5:39 PM, Victor Lazzarini wrote:
>>>
>>>>
>>>> From an original idea by Brian Carty, and with apologies to our
>>>> microtonalist friends, here's an indispensable
>>>> tool for all the budding popstars among us: an autotune +  
>>>> harmoniser.
>>>> Hours of fun for all the family.
>>>>
>>>> Victor
>>>>
>>>> 
>>>> 
>>>> -b128 -B256
>>>> 
>>>> 
>>>>
>>>> sr = 44100
>>>> ksmps = 64
>>>> nchnls = 1
>>>>
>>>> opcode  PitchShifter, a, akkii
>>>>      setksmps  1                   ; kr=sr
>>>> asig,kpitch,kfdb,idel,iwin  xin
>>>> kdelrate = (kpitch-1)/idel
>>>> avdel   phasor -kdelrate               ; 1 to 0
>>>> avdel2  phasor -kdelrate, 0.5          ; 1/2 buffer offset
>>>> afade  tablei avdel, iwin, 1, 0, 1     ; crossfade windows
>>>> afade2 tablei avdel2,iwin, 1, 0, 1
>>>> adump  delayr idel
>>>> atap1  deltapi avdel*idel           ; variable delay taps
>>>> atap2  deltapi avdel2*idel
>>>> amix   =   atap1*afade + atap2*afade2  ; fade in/out the delay taps
>>>>     delayw  asig+amix*kfdb          ; in+feedback signals
>>>>     xout  amix
>>>> endop
>>>>
>>>> /**** autotune  ***********************************/
>>>> /* aout Autotune asig,ism,ikey,ifn[,imeth]           */
>>>> /* asig - input
>>>> */
>>>> /* ism - smoothing time in secs                            */
>>>> /* ikey - key (0 = C,... ,11 =  
>>>> B                                   */
>>>> /* ifn - table containing scale pitch classes (7)  */
>>>> /* imeth - pitch track method: 0 - pitch (default) */
>>>> /*         1 - ptrack, 2 - pitchamdf                               
>>>> */
>>>> /***************************************************/
>>>>
>>>> opcode Autotune, a, aiiio
>>>>
>>>> iwinsize = 1024
>>>> ibase = 440
>>>> ibasemidi = 69
>>>>
>>>> asig,ism,itrans,ifn,im  xin
>>>>
>>>> if im == 0 then
>>>> kfr, kamp pitch asig,0.1,6.00,9.00,0
>>>> kfr = cpsoct(kfr)
>>>> elseif im == 1 then
>>>> kfr, kamp ptrack asig, 1024
>>>> else
>>>> kfr, kamp pitchamdf asig,130,1040
>>>> endif
>>>>
>>>> if (kfr > 10) kgoto ok
>>>> kfr = 440
>>>> ok:
>>>>
>>>> ktemp = 12 * (log(kfr / ibase) / log(2)) + ibasemidi
>>>> ktet = round(ktemp)
>>>>
>>>> kpos init 0
>>>> itrans = 2
>>>> test:
>>>> knote table kpos, ifn     ; get a pitch class from table
>>>> ktest = ktet % 12       ;  note mod 12
>>>> knote = (knote+itrans) % 12 ; plus transpose interval mod 12
>>>> if ktest == knote kgoto next ; test if note matches pitch class +
>>>> transposition
>>>> kpos = kpos + 1           ; increment table pos
>>>> if kpos >= 7  kgoto shift ; if more than or pitch class set we  
>>>> need to
>>>> shift it
>>>> kgoto test                ; loop back
>>>>
>>>> shift:
>>>> if (ktemp >= ktet) kgoto plus
>>>> ktet = ktet - 1
>>>> kgoto next
>>>> plus:
>>>> ktet = ktet + 1
>>>>
>>>> next:
>>>> kpos = 0
>>>> ktarget = ibase * (2 ^ ((ktet - ibasemidi) / 12))
>>>> kratio = ktarget/kfr
>>>> kratioport port kratio, ism, ibase
>>>>
>>>> aout PitchShifter asig,kratioport,0,0.1,5
>>>>
>>>>    xout     aout
>>>> endop
>>>>
>>>> instr 1
>>>>
>>>> ain inch 1
>>>>
>>>> interv1 = 2^(p6/12)
>>>> interv2 = 2^(p7/12)
>>>>
>>>> ain2    PitchShifter ain*0.5,interv1,0,0.1,5
>>>> ain3  PitchShifter ain*0.5,interv2,0,0.1,5
>>>>
>>>> aout    Autotune        ain,0.01,p4,p5
>>>> aout2 Autotune  ain2,0.01,p4,p5
>>>> aout3 Autotune  ain3,0.01,p4,p5
>>>>
>>>>        out             (aout+aout2+aout3)*0.5
>>>>
>>>> endin
>>>>
>>>> 
>>>> 
>>>>
>>>> f3 0 8 -2  0 2 4 5 7 9 11 12 ; major mode
>>>> f4 0 8 -2  0 2 3 5 7 8 10 12 ; minor mode
>>>> f5 0 16384 20 1
>>>>
>>>> ;       key mode intvl1 intvl2(semitones)
>>>> i1 0 60 0    3   -5     4  ; C major 6-4 harmonies
>>>> i1 + 60 0    4   -3     5  ; C minor (natural) 6-3 harmonies
>>>>
>>>>
>>>> 
>>>> 
>>>>
>>>> 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"
>>>
>>
>>
>>
>> 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"
>>
>>
>
>
>
> -- 
>
>
> Andrés
>
> 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"