[Csnd] pvs spectral delay
Date | 2011-06-23 19:43 |
From | peiman khosravi |
Subject | [Csnd] pvs spectral delay |
Hello, I am wondering if it would ever be possible to implement a new opcode for temporally delaying individual bins by N_ms? Perhaps by reading delay time for each bin from a table? Or can this be currently created inside a UDO? I need this not for normal spectral delay but for a specific project in mind. Thanks Peiman 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 | 2011-06-23 21:25 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
it's very simple to do it with pvsbuffer and pvsbufread. UDOs are currently not great for this because fsigs cannot be passed as parameters (you would need to use globals). But it's easy to do it in an instrument. Also rather than delaying individual bins (which can be messy), it's better to delay a range of freqs, and that is how pvsbufread does it. For instance, ihn, ktime pvsbuffer fsigin, 1 fsigout pvsbufread ktime - ims/1000, ihn, 950, 1050 The spectral delay works in the range of 950 to 1050 Hz. Regards Victor On 23 Jun 2011, at 19:43, peiman khosravi wrote: > Hello, > > I am wondering if it would ever be possible to implement a new opcode > for temporally delaying individual bins by N_ms? Perhaps by reading > delay time for each bin from a table? > > Or can this be currently created inside a UDO? I need this not for > normal spectral delay but for a specific project in mind. > > Thanks > > Peiman > > > 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" > Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie 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 | 2011-06-23 21:33 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks Victor, The thing is that for this particular task I need precise control over the time delay for each individual bin. Using pvsbufread would entail having Nbin instances of the opcode, which is not really practical. I would need to, say, have each consecutive bin delayed by another +1ms in an accumulative fashion. Does that make sense? Thanks Peiman On 23 June 2011 21:25, Victor Lazzarini |
Date | 2011-06-23 22:00 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
I've done this before, using over 120 instances spawn by an instrument in 'Noctilucent Clouds". If you'd like to see the CSD, I can send it to you. Victor On 23 Jun 2011, at 21:33, peiman khosravi wrote: > Thanks Victor, > > The thing is that for this particular task I need precise control over > the time delay for each individual bin. Using pvsbufread would entail > having Nbin instances of the opcode, which is not really practical. > > I would need to, say, have each consecutive bin delayed by another > +1ms in an accumulative fashion. Does that make sense? > > Thanks > > Peiman > > On 23 June 2011 21:25, Victor Lazzarini |
Date | 2011-06-23 22:52 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks Victor, that would be great. However, I am not sure if this would be precise enough for what I have in mind as the delay is not exactly bin-by-bin, unless I misunderstand you? I would like to couple the bin delay with a spectral panner so that each bin could be panned differently as well as delayed differently. So it is essential that I work with individual bins instead of frequency-bands. Or is there an efficient way of doing this? I am worried that having 8192 instances of the opcoe would be too much, considering that there is so much more going on in my instrument already. Best, Peiman On 23 June 2011 22:00, Victor Lazzarini |
Date | 2011-06-24 00:10 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
Bin by bin is overkill, as components are generally appearing in at least three bins. Remember that a bin is not the same as a spectral partial. Also why 8192, are you using a 16384 FFT? Here is the essence of my spectral delay from the piece, simplified to the minimum. The delay time of each band is incrementally larger. In the piece, I actually used function tables and drew the delay time 'shape' across the spectrum, but here I made it simple to show the process. You can use any input soundfile. Victor |
Date | 2011-06-24 00:20 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks Victor, I will study the csd tomorrow. Please see my comments bellow. On 24 June 2011 00:10, Victor Lazzarini |
Date | 2011-06-24 00:26 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
By the way, instr 4 was slightly wrong (pan/channel selection code): instr 4 kst init p5 ; lowest freq band kcnt init 0 kdel init 0 ibands = p6 kq = p7 kch init 1 even: kpow pow sr/(2*kst), kcnt/ibands kcf = kst*kpow kdel = kdel + p8 ; each band is delayed p8 secs more event "i",2,0,p4,p4,kcf,kcf/kq,kch,kdel kcnt = kcnt + 1 if kch == 1 then kch = 0 else kch = 1 endif if kcnt < ibands kgoto even turnoff endin On 24 Jun 2011, at 00:20, peiman khosravi wrote: > Thanks Victor, > > I will study the csd tomorrow. Please see my comments bellow. > > On 24 June 2011 00:10, Victor Lazzarini |
Date | 2011-06-24 00:32 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
This is very clever. Seems like a good way to implement the panner too. Just a question: how did you get the delay times from a function table, this is more or less what I am looking to do. Best, Peiman On 24 June 2011 00:26, Victor Lazzarini |
Date | 2011-06-24 00:41 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
I am thinking of creating 8 gf buses (one for each speaker) and then mixing each band (instrument instance) appropriately between these buses, as well as delaying them. An easy cheating way to calculate vbap values would be to actually use vbap8 opcode, feed it a DC signal and downsample its 8 outputs and use them as amplitude scaling factors for the 8 gf buses. The idea is that delaying the bands differently as well as pannig them will make the segregation more pronounced, so one can move from a unified source to a totally disintegrated one, separated within listening space. On 24 June 2011 00:32, peiman khosravi |
Date | 2011-06-24 01:26 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Hi Victor, I've been trying out your csd but even when I set p8 to 0 (delay time) the result sound like a frozen spectrum. Shouldn't this produce an unaltered output? Thanks Peiman |
Date | 2011-06-24 09:08 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
maybe there is a problem somewhere. I'll check. On 24 Jun 2011, at 01:26, peiman khosravi wrote: > Hi Victor, > > I've been trying out your csd but even when I set p8 to 0 (delay time) > the result sound like a frozen spectrum. Shouldn't this produce an > unaltered output? > > Thanks > > Peiman > > |
Date | 2011-06-24 11:07 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
I think the problem is with instr 4 or maybe the global mixing bus. I tried the delay instrument on its own and work fine but I cannot workout what exactly is the issue. Thanks Peiman On 24 June 2011 09:08, Victor Lazzarini |
Date | 2011-06-24 11:47 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
yes, I forgot to clear the global variable. Here's a fix: |
Date | 2011-06-24 12:52 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
On 24 Jun 2011, at 09:08, Victor Lazzarini wrote: > maybe there is a problem somewhere. I'll check. > On 24 Jun 2011, at 01:26, peiman khosravi wrote: > >> Hi Victor, >> >> I've been trying out your csd but even when I set p8 to 0 (delay >> time) >> the result sound like a frozen spectrum. Shouldn't this produce an >> unaltered output? >> >> Thanks >> >> Peiman >> >> |
Date | 2011-06-24 12:53 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
The problem is that I forgot to clear the global pvs variables. This should be OK now: |
Date | 2011-06-24 13:21 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks Victor, This is really great. Next I'm gonging to work out a way to draw the delay times in a function table. Also, I suppose it wouldn't be difficult to make the bands increase logarithmically. Best, Peiman On 24 June 2011 12:53, Victor Lazzarini |
Date | 2011-06-24 19:28 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Hi Victor, It just occurred to me that if you wanted not to delay the bands then there would still be at least one control period of delay in the consecutive bins using this method right? Thanks Peiman On 24 June 2011 13:21, peiman khosravi |
Date | 2011-06-24 19:57 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
Not sure what you mean. The delay is 'idel' (it can be kdel as well to vary in time). If idel = 0, the fsig output will be read from the point pvsbuffer wrote (no delay). Victor On 24 Jun 2011, at 19:28, peiman khosravi wrote: > Hi Victor, > > It just occurred to me that if you wanted not to delay the bands then > there would still be at least one control period of delay in the > consecutive bins using this method right? > > Thanks > > Peiman > > > On 24 June 2011 13:21, peiman khosravi |
Date | 2011-06-24 22:04 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Hi Victor, I mean there is a new event generated by 'event' opcode at each control period for instrument 2. Does this mean that the frequency bands (one for each event) will always be offset from each other by at least one control period? I have a feeling I am being a bit slow here though :-) Thanks Peiman On 24 June 2011 19:57, Victor Lazzarini |
Date | 2011-06-25 14:48 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
No, there shouldn't be any: all events issued by instr 4 happen at the same (1st) control period of that instrument, there is a k-rate loop doing that which should fire all events at the same time. Victor On 24 Jun 2011, at 22:04, peiman khosravi wrote: > Hi Victor, > > I mean there is a new event generated by 'event' opcode at each > control period for instrument 2. Does this mean that the frequency > bands (one for each event) will always be offset from each other by at > least one control period? I have a feeling I am being a bit slow here > though :-) > > Thanks > > Peiman > > On 24 June 2011 19:57, Victor Lazzarini |
Date | 2011-06-25 15:57 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks Victor, I had no idea that k-rate loops behaved in this way. Thanks for the clarification. Best, Peiman On 25 June 2011 14:48, Victor Lazzarini |
Date | 2011-06-25 17:17 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
yes, you can easily hang csound with one of those, if you're not careful. Victor On 25 Jun 2011, at 15:57, peiman khosravi wrote: > Thanks Victor, I had no idea that k-rate loops behaved in this way. > Thanks for the clarification. > > Best, > > Peiman > > On 25 June 2011 14:48, Victor Lazzarini |
Date | 2011-06-25 19:29 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
So just to be clear: a k-rate loop does not pass one iteration per control period but the entire loop section runs in one control period and the result is sent out once the condition is met? Peiman On 25 June 2011 17:17, Victor Lazzarini |
Date | 2011-06-25 20:29 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
yes, pretty much. Say we have this kval = 0 beg: kval = kval + 1 if kval <= 10 kgoto beg will count 10 time before continuing to the rest of the code, every k- period. Victor On 25 Jun 2011, at 19:29, peiman khosravi wrote: > So just to be clear: a k-rate loop does not pass one iteration per > control period but the entire loop section runs in one control period > and the result is sent out once the condition is met? > > Peiman > > On 25 June 2011 17:17, Victor Lazzarini |
Date | 2011-06-25 20:56 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
ahh I see. I had no idea, I was under the impression that the above code would count one time each k period. Thanks Peiman On 25 June 2011 21:29, Victor Lazzarini |
Date | 2011-06-25 21:09 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
Then you wouldn't need a loop, as the k-period loop is implicit. Victor On 25 Jun 2011, at 20:56, peiman khosravi wrote: > ahh I see. I had no idea, I was under the impression that the above > code would count one time each k period. > > Thanks > > Peiman > > On 25 June 2011 21:29, Victor Lazzarini |
Date | 2011-06-26 13:20 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks, yes this makes sense. Peiman On 25 June 2011 21:09, Victor Lazzarini |
Date | 2011-07-21 10:46 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Hello again, I have been playing with your code Victor and it works very well as a delay effect. However, my intention with the spectral delay is to use it as an added dimension to spectral panning, where the user has access to each bin as opposed to a frequency band. So each bin can be delayed ever so slightly to add a little bit of 'artifact' (say one or two frames) as well as being panned - importantly the panning curve should follow the spectral delay curve in an exact way, so bin-by-bin matching. I know that this is problematic but I find that once we have arbitrary access to all the bands we can choose to control the alterations in more or less drastic fashions, therefore increasing the creative possibilities of an instrument as a multipurpose processors, even if it involves DSP mistakes. For instance we can scatter bins within a loudspeaker array to introduce interesting phasing "issues" as well as choosing to distribute them contiguously to minimise the phase distortion. But this decision is given to the user and very much depends on the nature of the input sound. So my proposal still stands: would it be possible to introduce a method of delaying FFT bins according to a function table in Csound? This is possible in maxmsp and I have had to chain my Csound~ output to a maxmsp subpatch to get the desired effect, however this means (1) the instrument is not portable, (2) it is more CPU hungry as the analysis/resynthesis is done twice (in Csound and in max), and finally (3) FFT stuff sound like rubbish in Maxmsp, or at least very different to how they sound in Csound. Thanks in advance, Best, Peiman On 26 June 2011 14:20, peiman khosravi <peimankhosravi@gmail.com> wrote: Thanks, yes this makes sense. |
Date | 2011-07-21 10:49 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Ah and now that we are at it, another thing that is missing is spectral dynamic gating where one can control the attach and release times. Thanks Peiman On 21 July 2011 11:46, peiman khosravi <peimankhosravi@gmail.com> wrote: Hello again, |
Date | 2011-07-21 11:46 |
From | Richard Dobson |
Subject | Re: [Csnd] pvs spectral delay |
On 21/07/2011 10:49, peiman khosravi wrote: > Ah and now that we are at it, another thing that is missing is spectral > dynamic gating where one can control the attach and release times. > > Thanks > [NB: this and the previous message included 147KB of 'context'! You need to snip it a bit.] I am following this thread while immersed in this and that. One thought: while the context is that of fsig processing, these ideas would apply equally to general processing of additive oscillator-bank streams. So there might be a case for one degree of separation, so that any opcodes etc were not tied to fsigs, but to more generic oscillator-bank signals with conversion opcodes. Presumably this would apply equally to the partial-tracking opcodes. I am even thinking of the venerable 'hetro' facility, which has always been greatly under-served with processing opcodes. With the imminent pervasion of such things as GPU-based parallel processing, running large-scale additive oscbank streams would seem to be something whose time has come (again...). 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 | 2011-07-21 13:06 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
What about a version of pvsbufread that takes in a function table indicating the delay times of each bin? That would be a more logic way to proceed, using an existing facility. fsig pvsbufread2 ktime, khandle, itab ktime -> time pointer (from pvsbuffer or elsewhere) khandle -> pvsbuffer handle itab -> table (>= fftsize) with delays in secs in relation to ktim. I've not looked into the code, but off the top of my head this should be possible. Victor On 21 Jul 2011, at 10:46, peiman khosravi wrote: Hello again, Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2011-07-21 13:11 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks Victor, This would indeed be very very nice. I can't think of a better solution! All the Best, Peiman On 21 July 2011 13:06, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2011-07-21 13:14 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
Thanks Richard, Sorry for neglecting to trim the email body. I have to say that I have not yet explored the additive resynthesis option that much but as you say with current computers on the market performance is not an issue. Looking forward to all your new concoctions! Best, Peiman On 21 July 2011 11:46, Richard Dobson <richarddobson@blueyonder.co.uk> wrote:
|
Date | 2011-07-21 13:35 |
From | Victor Lazzarini |
Subject | Re: [Csnd] pvs spectral delay |
I'll see what I can come up with. You know, you said the magic words to set me in action: "i have to do it in MaxMSP'". ;) Victor On 21 Jul 2011, at 13:11, peiman khosravi wrote: Thanks Victor, Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2011-07-21 13:44 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
haha. Much obliged. Thanks Peiman On 21 July 2011 13:35, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2011-07-21 13:48 |
From | peiman khosravi |
Subject | Re: [Csnd] pvs spectral delay |
PS you should not give away the magic words on this list! P On 21 July 2011 13:44, peiman khosravi <peimankhosravi@gmail.com> wrote: haha. |