## MODIFICATION OF A REFERENCE SIGNAL
data(tico)
env.tico <- env(tico, f=22050, plot=FALSE)
ifreq.tico <- ifreq(tico, f=22050, plot=FALSE)$f[,2]
# recover the original signal
synth2(env=env.tico, ifreq=ifreq.tico*1000, f=22050, plot=TRUE)
# original signal with instantaneous frequency reversed
synth2(env=env.tico, ifreq=rev(ifreq.tico)*1000, f=22050, plot=TRUE)
# original signal with a +1000 Hz linear frequency shift
synth2(env=env.tico, ifreq=ifreq.tico*1000+1000, f=22050, plot=TRUE)
# original signal with instantaneous frequency multiplied by 2
synth2(env=env.tico, ifreq=ifreq.tico*1000*2, f=22050, plot=TRUE)
# original signal with a linear instantaneous frequency at 2000 Hz
synth2(env=env.tico, ifreq=rep(2000, times=length(tico@left)), f=22050, plot=TRUE)
## DE NOVO SYNTHESIS
# instantaneous frequency increasing by step of 500 Hz
synth2(ifreq=rep(c(500,1000,1500,2000,2500,3000,3500,4000), each=2000), f=16000, plot=TRUE)
# square function of the instantaenous frequency
synth2(ifreq=500+seq(-50,50, length.out=8000)^2, f=8000, plot=TRUE, ovlp=85)
# linear increase of the amplitude envelope
synth2(env=seq(0,1,length=8000), ifreq=rep(2000,8000), f=8000, plot=TRUE, ovlp=85, osc=TRUE)
# square-root increase of the amplitude envelope
synth2(env=sqrt(seq(0,1,length=8000)), ifreq=rep(2000,8000), f=8000, plot=TRUE, ovlp=85, osc=TRUE)
# square-root increase and decrease of the amplitude envelope
synth2(env=c(sqrt(seq(0,1,length=4000)), sqrt(seq(1,0,length=4000))),
ifreq=rep(2000,8000), f=8000, plot=TRUE, ovlp=85, osc=TRUE)
# amplitude envelope and instantaneous frequency following a normal density shape
norm <- rep(dnorm(-4000:3999, sd=1000), 2)
toto <- synth2(env=norm, ifreq=500+(norm/max(norm))*1000, f=8000, plot=TRUE, osc=TRUE, ovlp=85)
Run the code above in your browser using DataLab