Csound Csound-dev Csound-tekno Search About

[Csnd] Sample playback with cps pitch and buffer offset

Date2019-10-26 21:05
FromJosh Moore
Subject[Csnd] Sample playback with cps pitch and buffer offset
I'm looking for a way to take just a long function table and shift through it, with start and end points (like tablexkt/lphasor) but with a cycle per second control like regular old loscil.

Any suggestions on how to do this?
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-10-26 21:43
FromSteven Yi
SubjectRe: [Csnd] Sample playback with cps pitch and buffer offset
If you want to control by cps (idesired_freq), you need the base frequency (ibase) of the content you're playing back to calculate a playback rate, as well as the source sampling rate (isrc_sr) and target sampling rate (sr).  If you have that, then you should be able to use:

(idesired_freq / ibase) * (isrc_sr / sr)

so if you have a sample recorded at 44100, your project is 48000, the sample is at A440, and you want to play it back at 660 Hz, you get:

660/440 * 48000/44100



On Sat, Oct 26, 2019 at 4:05 PM Josh Moore <kh405.7h30ry@gmail.com> wrote:
I'm looking for a way to take just a long function table and shift through it, with start and end points (like tablexkt/lphasor) but with a cycle per second control like regular old loscil.

Any suggestions on how to do this?
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