Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Midi instrument and pitch shifting

Date2019-11-23 23:32
Fromjoachim heintz
SubjectRe: [Csnd] Midi instrument and pitch shifting
hi bernard -

i have two ideas on this.

1. why not simply read the tables slower or faster?  this should give 
fair result if the pitch shifting interval is not too big.  loscilx 
might give the best results.

2. if you want to use FFT instead, you can try pvstanal which reads 
directly from a table and offers direct transposition control (kpitch).

best -
	joachim



On 23/11/2019 23:33, Bernard Geyer wrote:
> I have made a midi sampler instruments, where the samples are stored in
> tables and played with loscil. It works very well, with envelopes too, but
> now I want also the possibility to use pitch shifting.
> 
> I tried to do it with the pvsanal/pvscale/pvsynth opcodes, it works when
> there are not too much notes.
> With fast notes on 4 channels and with long release envelopes, or by using
> the sustain pedal, it is already too much for my computer, it makes strange
> distortions and irregular rhythms.
> 
> I guess it's the analysis that takes too much time. In fact, it is really
> not necessary that the analysis has to be repeated each time, so my question
> is : is it possible to analyse the sound files, store the analysis in a
> file, f.e. with pvanal, and later load the analysis files in tables to be
> processed in realtime with pvscale and pvsynth ?
> 
> Best,
> Bernard
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> 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
> 

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

Date2019-11-23 23:33
FromBernard Geyer
Subject[Csnd] Midi instrument and pitch shifting
I have made a midi sampler instruments, where the samples are stored in
tables and played with loscil. It works very well, with envelopes too, but
now I want also the possibility to use pitch shifting.

I tried to do it with the pvsanal/pvscale/pvsynth opcodes, it works when
there are not too much notes.
With fast notes on 4 channels and with long release envelopes, or by using
the sustain pedal, it is already too much for my computer, it makes strange
distortions and irregular rhythms.

I guess it's the analysis that takes too much time. In fact, it is really
not necessary that the analysis has to be repeated each time, so my question
is : is it possible to analyse the sound files, store the analysis in a
file, f.e. with pvanal, and later load the analysis files in tables to be
processed in realtime with pvscale and pvsynth ?

Best,
Bernard



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-11-24 12:06
FromBernard Geyer
SubjectRe: [Csnd] Midi instrument and pitch shifting
Thank you for your answer, but:

> 1. why not simply read the tables slower or faster? 
I always do that, but with long sounds that evaluate in time, the speed and
length difference disturbs me.
And I have a project with vocal sounds, so I need formant preservation

> you can try pvstanal
I tried pvstanal, there is the same problem, sometimes even worse. 

When I use pvoc (that reads a pvx file), I don't have this problem, but
there are clicks
(but I'm also not sure how "line" works here)





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-11-24 13:48
Fromjoachim heintz
SubjectRe: [Csnd] Midi instrument and pitch shifting
you can also try pvsbufread:
https://csound.com/docs/manual/pvsbufread.html

i would guess that the performance is better than reading a file, but 
maybe i am wrong.

instead of pvread you could also use pvsdiskin:
https://csound.com/docs/manual/pvsdiskin.html

	j



On 24/11/2019 12:06, Bernard Geyer wrote:
> Thank you for your answer, but:
> 
>> 1. why not simply read the tables slower or faster?
> I always do that, but with long sounds that evaluate in time, the speed and
> length difference disturbs me.
> And I have a project with vocal sounds, so I need formant preservation
> 
>> you can try pvstanal
> I tried pvstanal, there is the same problem, sometimes even worse.
> 
> When I use pvoc (that reads a pvx file), I don't have this problem, but
> there are clicks
> (but I'm also not sure how "line" works here)
> 
> 
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> 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
> 

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

Date2019-11-25 01:05
FromBernard Geyer
SubjectRe: [Csnd] Midi instrument and pitch shifting
Thank you, Joachim!

While pvoc has clicks and has a too dull sound, pvsfread and pvsdiskin have
strange attacks, and sound too thin.

But pvsbufread works perfectly, (thanks to your wonderfull FileToPvsBuf
UDO), it sounds like the realtime pvsanal/pvscale/pvsynth, what is not
surprising, because the same opcodes are used. Excepted the overhead to make
the same analysis again and again is gone.

So, I can store the analysis of my sound files in buffers when starting
csound and call pvsbufread from different instruments. 

Great!




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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