[Csnd] question about pvshift
Date | 2010-11-28 08:49 |
From | Stefan Thomas |
Subject | [Csnd] question about pvshift |
Dear community, I've read in the manual: pvshift — Shift the frequency components of a pv stream, stretching/compressing its spectrum.But, as far I've understood, it adds (?) e.g. 100 Hz to all partials. Is it possible, to freely change the pitches of the partials in a way like, e.g. ioctave = 43/21(etc.) If I've understood it right, there is a tool available, which can do things like that see http://www.dynamictonality.com/spectools.htm I would be interested, if something like this can be done with csound. |
Date | 2010-11-28 10:39 |
From | Justin Glenn Smith |
Subject | [Csnd] Re: question about pvshift |
Stefan Thomas wrote: > Dear community, > I've read in the manual: > >> pvshift — Shift the frequency components of a pv stream, >> stretching/compressing its spectrum. >> > But, as far I've understood, it adds (?) e.g. 100 Hz to all partials. > Is it possible, to freely change the pitches of the partials in a way > like, e.g. > > ioctave = 43/21 >> ifund = icps*2 >> ipartial2 = icps*ioctave >> ipartial3 = icps*ioctave^(log10(3)/log10(2)) >> > (etc.) > > If I've understood it right, there is a tool available, which can do things > like that > see http://www.dynamictonality.com/spectools.htm > I would be interested, if something like this can be done with 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" > > The current way to do this is to write the fsig to a pair of tables with pvsftw, then manipulate the table data as you see fit with the many facilities provided for manipulating tables, then read from the tables with pvsftr. 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" |
Date | 2010-11-28 10:47 |
From | Victor Lazzarini |
Subject | [Csnd] Re: question about pvshift |
Maybe what you want to do is better done with pvsftr / pvsftw and tablew / table using function tables. But remember that pvs bins are not partials and their freq values cannot be wildly changed (it just won't work). The pvs opcodes shift and scale freqs, but data gets moved from one bin to another. Victor On 28 Nov 2010, at 08:49, Stefan Thomas wrote: Dear community, |
Date | 2010-11-28 11:33 |
From | peiman khosravi |
Subject | [Csnd] Re: Re: question about pvshift |
You may also want to look at the ATS opcodes for partial manipulation. P On 28 November 2010 11:47, Victor Lazzarini |
Date | 2010-11-28 13:05 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: question about pvshift |
Ok, I will have a look at the ats-opcodes. Which one would You recommand for my aim, ATScross or ATSsinnoi? 2010/11/28 peiman khosravi <peimankhosravi@gmail.com> You may also want to look at the ATS opcodes for partial manipulation. |
Date | 2010-11-28 23:34 |
From | peiman khosravi |
Subject | [Csnd] Re: Re: Re: Re: question about pvshift |
ATSpartialtap is probably the one. Use the output data to control an oscillator's frequency and amplitude. Note that you need to set 0dbfs=1 in the orchestra header. Best, Peiman On 28 November 2010 13:05, Stefan Thomas |
Date | 2010-11-29 09:06 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: question about pvshift |
Dear Peiman, Do I have to send the output to an oscil-opcode or is there another possibilitie? 2010/11/29 peiman khosravi <peimankhosravi@gmail.com> ATSpartialtap is probably the one. Use the output data to control an |
Date | 2010-11-29 10:53 |
From | peiman khosravi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: question about pvshift |
Yes one of the oscil opcodes. I'd use poscil3 for higher precision and better sound quality. You need to set the kr very high as well since the returned frequencies and amplitudes are control-rate. ;;;;;;;;;;;;; iduration ATSinfo 7, "filepath" ktime line 0, p3, iduration ATSbufread ktime, 1, "filepath", 20 kfreq1, kamp1 ATSpartialtap 1 kfreq2, kamp2 ATSpartialtap 10 kfreq3, kamp3 ATSpartialtap 20 kfreq1 = kfreq1 * 2 kfreq2 = kfreq2 * .5 kfreq3 = kfreq3 *3 apar1 poscil3 kamp1, kfreq1, 1 apar2 poscil3 kamp2, kfreq2, 1 apar3 poscil3 kamp3, kfreq3, 1 aout = apar1+apar2+apar3 out aout ;;;;;;;;;;;;;;;;;;;;; P On 29 November 2010 09:06, Stefan Thomas |
Date | 2010-11-29 12:57 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: question about pvshift |
Dear Peiman, thanks for Your tipp. For sure I will try Your code. But let me ask me one more question: Will ATSpartialtap also "know" the attack and decay times of the the individual partials? 2010/11/29 peiman khosravi <peimankhosravi@gmail.com> Yes one of the oscil opcodes. I'd use poscil3 for higher precision and |
Date | 2010-12-04 18:11 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: question about pvshift |
Dear Peiman, thank You very much! Your code works fantastic. I'd never thought that changing the partials of an natural sound could be done in such an easy way. I've just two more questions: 1. Sometimes I get the error message ATSBUFREAD: time pointer out of range, truncating to last frame.What does it mean and how can I avoid it? 2. I've read in the csound manual about ATSbufred: ipartials – number of partials that will be used in the resynthesis (the noise has a maximum of 25 bands).Does it mean that I can't use more than 25 partials? 2010/11/29 Stefan Thomas <kontrapunktstefan@googlemail.com> Dear Peiman, |
Date | 2010-12-05 00:23 |
From | Aidan Collins |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift |
I think that first error means that the index moving through the analysis file is going too far. For example if the last bit of data is at 9.99 but the index goes all the way to 10. I used to use pvoc often and frequently got that message. It wouldn't stop the csd from rendering, but slowed it down a lot. Try lowering the max value of your index. A Sent from my iPhone
|
Date | 2010-12-05 00:36 |
From | Richard Dobson |
Subject | [Csnd] Re: : question about pvshift |
On 05/12/2010 00:23, Aidan Collins wrote: > I think that first error means that the index moving through the > analysis file is going too far. For example if the last bit of data is > at 9.99 but the index goes all the way to 10. > I used to use pvoc often and frequently got that message. It wouldn't > stop the csd from rendering, but slowed it down a lot. > Try lowering the max value of your index. > By way of a side note on such things - if one wants to be sure the target pitch as such is perceived by the user, at the end of the sound, the pitch needs to be reached (and maybe held) a little before the end. Richard Dobson 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" |
Date | 2010-12-05 12:53 |
From | peiman khosravi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift |
On 5 December 2010 00:23, Aidan Collins |
Date | 2010-12-05 16:30 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift |
Ok, I think I've got it now. What I now would like to know is: is it possible to write the output of ATSpartialtap into an table? 2010/12/5 peiman khosravi <peimankhosravi@gmail.com>
|
Date | 2010-12-06 10:38 |
From | peiman khosravi |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift |
Do you mean th efrequency and amplitude values? You can just write them into a table by using tabw oe something. P. On 5 December 2010 16:30, Stefan Thomas |
Date | 2010-12-06 12:23 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: question about pvshift |
Attachments | guitarE.ats |
Dear Peiman, I tried it with the following code. I've got the idea with the looping by Joachim. The problem with the code is: although there is no error message, I can't hear any sound. <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> sr = 44100 ksmps = 100 nchnls = 2 0dbfs = 1 giPartfreqs ftgen 0, 0, -30, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 giSine ftgen 0, 0, 2^10, 10, 1 massign 0, 1 instr 10 gimaxdur = 16 ; maximum duration endin instr 1 ;triggered by midi. Calls inumparts instances of instr 100 inumparts = 19 ; number of partials imidinot notnum icps cpsmidi idur = gimaxdur indx = 1 ; start with first partial isubinstr = 100+imidinot/1000 ;e.g 100.060 für c loop: ipartfreq tab_i indx-1, giPartfreqs ipartfreq = ipartfreq * icps event_i "i", isubinstr, 0, idur, ipartfreq, indx loop_le indx, 1, inumparts, loop krelease release if krelease == 1 then ; for the noteoff-event turnoff2 isubinstr, 4, 1 endif endin instr 100 ;spielt einen teilton: hohe teiltöne sind kürzer iamp ampmidi 1 idur = p3 ; duration ifreq = p4 ;partial frequency ittnr = p5 ; partial number ifiledur = 4 ktime line 0, 15, ifiledur ifilecode = 1 imaxpartials = 19 ATSbufread ktime, 1, "guitarE.ats", imaxpartials krealfreq, kamp ATSpartialtap ittnr asig poscil iamp*kamp, ifreq, giSine aout = asig outs aout, aout endin </CsInstruments> <CsScore> f 0 36 i 1 0 36 ; i 10 0 36 </CsScore> </CsoundSynthesizer> 2010/12/6 peiman khosravi <peimankhosravi@gmail.com> Do you mean th efrequency and amplitude values? |