Re: [music-dsp] Hourly / Daily Rates in Audio-DSP 2020 survey - remarks

2020-05-27 Thread gm

answers to some questions that had been asked:


1. "Rates per day" including tax or not?

Before any taxes etc., since these vary widely and depend on lots of things


2. Paid/Unpaid Ratio: What does 0 or 100 mean? Does 0 mean 0 unpaid work?

typical lapse of mine: I actually ment percentage...

Left of slider: percentage of payed work, right side: percentage of 
unpayed work.


I believe that most people actually answered it like this?


3. Why rates per day and not annual salary?

Because I dont think it's meaningful in this context:

Someone might charge a high rate, but only work or get payed a couple of 
days per year.


This might go along with an unsual set of skills or type of work.

An annual salary would totally distort things regarding this kind of work.


4. Why no question capturing work experience vs. fresh students?

An experience question is indeed missing, for such things I added the 
remarks field.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] the time it takes to design a reverberator and related

2020-05-26 Thread gm



Am 26.05.2020 um 15:14 schrieb Theo Verelst:

"I need some possibly quotable real world opinions and experiences on how
long stuff can take to design or develop"

Sound like that's interesting. But why? Project management, funding, 
hobby schedule,

historic insight, or .. ?



During the past 15 years, among other things
I spent an estimated minimum of 1 000 hours on reverb design,
using different topologies,
also developed and researched novel topologies,
came up with new very useful methods not found in literature too, etc.

The result of this process are, among several useable designs
and also uncounted mediocre and bad ones,
and outright failures,
a few good ones.

Some of them are in used in products, but ironically the better ones
were licensed for free basically without any written agreement.

For future products we want to settle on a reasonable agreement for this
and several other things and concepts I developed and disclosed.
(Some of my concepts and methods made unqiue selling points in products 
in the past

and some of the suggested ones could make such in future products).

I am extremely bad, inept when it comes to the business side.
Always had been.

I never know what to put on an invoice, what to charge for, and what rates.

Especially since during the whole process of developing anything I also 
produce a lot of trash.

I spent months on failures, not just in reverb design, but on anything.

Other solutions to long outstanding problems are found within in minutes
and confirmed within an hour.

What do you charge for this? 5 Minutes? An hour?
A day or two since you also have to communicate the solution?
A month of failures?
A phantasy figure?















___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] Hourly / Daily Rates in Audio-DSP 2020 survey - link to results page

2020-05-23 Thread gm

now here is the link to the results page:

https://de.surveymonkey.com/results/SM-8LXS53ZN7/

questions are still open, I didn't set any date limit, assume they will 
stay open:


https://www.surveymonkey.de/r/56R8RJH


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


Re: [music-dsp] Hourly / Daily Rates in Audio-DSP 2020 survey - who's asking

2020-05-22 Thread gm

someone asked, who is asking these questions.

It's just me personally (and the surveymonkeykraken of course).

No head hunter here nor sinister scanning of the place nor marketing BS.

Reason I am asking is I got out of touch with a few things and need to know
and recalibrate what my past and present labour is actually worth today.*

That's why this survey is not asking things like how much are you 
"making" per year.

That is totally irrelevant to me.

I used the survey website so people can answer anonymously, thought that 
most would prefer that.


Asking for typical tasks and tools to get a very coarse idea of what you 
might actually do,
how you might work, how that might relate to my work, how 
common/uncommon your skill set might be, etc. etc..


Paid/unpaid asks what actually appears on an invoice.

I assume the answers (3 so far) will also be interesting for some other 
people,

but I havent figured out how to get the data out from a free account.
Difficult since it's mostly free text fields.

If only a few people are answering I could copy it, but I am hoping for 
a few more answers during the week.


*please no: it's-worth-what-they-pay-you replys, thanks


Am 22.05.2020 um 21:27 schrieb gm:

you can answer here or on surveymonkey if you prefer
https://www.surveymonkey.de/r/56R8RJH


location:


type of employment (employed, freelance / self employed, other):


rates per hour (or per day):


estimated ratio paid/unpaid work:


job description (examples of what you do, or did, typcially):


tools (tools / software you are working with mostly):


remarks:



fictional example, to give you the idea

location:
 Berlin

type of employment:
 retirement

rates per hour:
 0.00 - 1.00 Euro / h

estimated ratio paid/unpaid work:
 4/96

job description:
 consulting
 prototyping
 physical modelling (Stylophon emulation)

tools (tools / software you are working with mostly):
 Modzilla Thunderbird
 Graphmatica

remarks:

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] Hourly / Daily Rates in Audio-DSP 2020 survey

2020-05-22 Thread gm

you can answer here or on surveymonkey if you prefer
https://www.surveymonkey.de/r/56R8RJH


location:


type of employment (employed, freelance / self employed, other):


rates per hour (or per day):


estimated ratio paid/unpaid work:


job description (examples of what you do, or did, typcially):


tools (tools / software you are working with mostly):


remarks:



fictional example, to give you the idea

location:
 Berlin

type of employment:
 retirement

rates per hour:
 0.00 - 1.00 Euro / h

estimated ratio paid/unpaid work:
 4/96

job description:
 consulting
 prototyping
 physical modelling (Stylophon emulation)

tools (tools / software you are working with mostly):
 Modzilla Thunderbird
 Graphmatica

remarks:

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] the time it takes to design a reverberator and related

2020-05-22 Thread gm


Am 22.05.2020 um 03:55 schrieb robert bristow-johnson:
i just relate the lengths of the delays by some ratio and then look 
for prime numbers. isn't that what Jot did? i don't remember.



I don't know, I am bad with names and original sources.

But prime numbers have common multiples. I think we want to exclude these.

I was just rereading my draft, the model I assumed is AP delays in 
series plus a delay, in a feedback loop.


My idea was that you place echoes so that after reflection from the loop
(after feedback, 2nd gegneration so to say) they fall somewhere in 
between echoes from before reflection (1st generation)
when you regard the impulses within and in respect to the loop length 
period.
The same again for 3rd generation impulses which should fall in between 
previous impulses.


This to avoid repetitions, or impulses falling on other impulses.

The solution to achieve this are, for a first most simple approach:

2/3, 2/5, 2/7,... 2/(2N+1)   and  4/5, 4/7, 4/9... 4/(4N+1)

where the numbers refer to the AP delay length in respect to the loop 
length and N to the number of the AP.
The difference between both series is whether the echoes appear in the 
left or right half in respect of the loop length.
I think this series only has the desired property for the first 
generations of impulses.


There are other more refined solutions, and the last one is

ratio = 1/ (N+1 - ln(2))

where, I believe, no impulse falls on a previous impulse ever within the 
loop length period in infinte generations.


I was always hoping that someone would look into this idea, confirm it, 
refine it, give it a real theoretical foundation...
Maybe the draft I wrote was too weird, I dont recall haveing had a 
response ever, though people were reading it.











___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] the time it takes to design a reverberator and related

2020-05-21 Thread gm



I need some possibly quotable real world opinions and experiences on how 
long stuff
can take to design or develop, especially takeing Hofstadter's Law into 
account


For instance reverberators, hard to estimate, and I dont recall all the 
times I spent exactly
I tried so many things on different occasions so long ago, improved 
things, disimproved them
but my estimate is that it takes many months experience (at least) and 
experimenting to come

to good and really good results.
Especially if you start with FDNs first and waste a long time on them...
If you have experience and start from scratch it takes days or weeks to 
refine your design.


You may however have at some point developed prototypes that you can 
reuse and modify and do not change too much any more.


Two years ago or so I posted a kind of non-paper here on "magic numbers 
in reverb design" where I claimed
having found a "perfect" ratio for allpass delay stage lengths. I could 
never decide if its kind of nonsense or not since
the method gives quite good results, but I think I used other numbers 
afterwards myself IIRC. I am not even sure at the moment...


Does anybody recall that paper and did anybody ever try and remember the 
results?
Did it speed developement up for you? Did it make any sense to you at 
all (its written in a weird way)?


Would you call a good reverb algorithm a piece of art?

Since the process can take so eratically long, and since you can go back 
and forth many times,
what do you think a reasonable time estimate would be? How much time 
would you charge for that reverb, reasonably?


How and when do you decide it's finished and that you don't change 
parameters any more?


How many times and for how long did you try to make "the most efficient 
reverberator you can get away with"?

Did you ever succeed in that quest?

Do you think there is something like a "most reasonable" reverb design?



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


[music-dsp] Patent rights and media rights lawyer in Berlin?

2020-05-21 Thread gm

Hi

I am looking for a combined patent and media or software rights lawyer 
in Berlin, Germany.

Can someone recommend somebody?

I am not sure if this is too OT for the list, but I guess its too dirty 
laundry in all details.


And too sad, really.

So no story. Although the story would possible become a long and heated 
discussion.

Kill that companies reputation here for ever too, if they ever had any.

Thanks for tips, adresses

You may also reply off list

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


[music-dsp] zero delay feedback for phase modulation synthesis?

2018-11-15 Thread gm



I wonder if anyone has thought about this?

I am aware that it may have little practical use and may actually worsen the
"fractal noise" behaviour at higher feedback levels.
(Long ago I tested this with a tuned delay in the feedback path and 
thats what I recall)

But still I am interested.

If the recurrence for the oscillator with feedback is:

y[n] = ( 1/(2Pi) * sine(2*Pi* y[n-1]) + k) mod 1

there are two nonlinearities and it's all above my head...

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] asymmetric windows Re: FFT for realtime synthesis?

2018-11-10 Thread gm



Am 10.11.2018 um 00:19 schrieb gm:


FFT size is 4096, and now I search for ways to improve it, mostly 
regarding transients.
But I am not sure if that's possible with FFT cause I still have 
pre-ringing, and I cant see
how to avoid that completely cause you can only shorten the windows on 
the low octaves so much.

Maybe with an assymetric window?
If you do the analysis with a IIR filter bank (or wavelets) you kind 
of have assymmetric windows, that is the filters
integrate in a causal way with a decaying "window" they see, but I am 
not sure if this can be adapted somehow

to an FFT.

I just tried this and it works well in the analysis, pre-ringing is 
reduced, everthing sounds more compact


Together with the ERB scaling now it even kind of works on bass drums. 
They are not perfect, but much better.


The windows I am using for this:

if wn(t) is a Hann window and 0 <= t <= 1
then window is wn(sqrt(1-t))

The properties of the window can be found in
"Asymmetric Windows and their Application in Frequency Estimation"

It's not particularly good compared to others, sides fall off with -12 
dB/octave but it's shape
is the most skewed one of the windows given in the paper with the 
fastest rise

and the rightmost peak so it really makes a difference.

Downside is that now I also have to use this window for peak tracking 
and frequency estimation
where a better rolloff and a more narrow peak would be desireable, but 
the partials need to be in synch

with the amplitudes so I need the same window shape.
An up side is that it scales so that the peak stays in place for all sizes.

Another downside is that ERB scaling makes the high frequencies quite 
hissy, they seem too
pronounced also because they ring longer than in the original when you 
dont use a really

high overlap rate, like 78.


Still I am looking for window that might have better properties so any 
input on that is apreciated.







___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-09 Thread gm


thanks for your offer, I can not really read Math lab code and always 
have a hard time

even figuring out essentials of such code

My phase vocoder already works kind of satisfactorily now as a demo in 
Native Instruments Reaktor,
I do the forward FFT offline and the iFFT "just in time", that means 12 
"butterflies" per sample,
so you could bring down latency by speeding up the iFFT, though I am not 
sure what a reasonable latency is.
I made a poll on some electronic musicians board and most people voted 
for 10 ms being just tolerable.


I am half way content with the way it works now, for analysis I have 
twelve FFTs in parallel, one for each octave
with window sizes based on ERB scale per octave, so it's not totally bad 
on transients but not good either.
I assume there is still some room for improvements on the windows, but 
not very much.


FFT size is 4096, and now I search for ways to improve it, mostly 
regarding transients.
But I am not sure if that's possible with FFT cause I still have 
pre-ringing, and I cant see
how to avoid that completely cause you can only shorten the windows on 
the low octaves so much.

Maybe with an assymetric window?
If you do the analysis with a IIR filter bank (or wavelets) you kind of 
have assymmetric windows, that is the filters
integrate in a causal way with a decaying "window" they see, but I am 
not sure if this can be adapted somehow

to an FFT.

An other way that would reduce reverberation and shorten transient times 
somehwat would
be using shorter FFTs for the resynthesis, this would also bring down 
CPU a bit and latency.


So this is where I am at at the moment

Am 09.11.2018 um 23:29 schrieb robert bristow-johnson:


i don't wanna lead you astray.  i would recommend staying with the 
phase vocoder as a framework for doing time-frequency manipulation.  
it **can** be used real-time for pitch shift, but when i have used the 
phase vocoder, it was for time-scaling and then we would simply 
resample the time-scaled output of the phase vocoder to bring the 
tempo back to the original and shift the pitch.  that was easier to 
get it right than it was to *move* frequency components around in the 
phase vocoder.  but i remember in the 90s, Jean Laroche doing that 
real time with a single PC.  also a real-time phase vocoder (or any 
frequency-domain process, like sinusoidal modeling) is going to have 
delay in a real-time process.  even if your processor is infinitely 
fast, you still have to fill up your FFT buffer with samples before 
invoking the FFT.  if your buffer is 4096 samples and your sample rate 
is 48 kHz, that's almost 1/10 second.  and that doesn't count 
processing time, just the buffering time.  and, in reality, you will 
have to double buffer this process (buffer both input and output) and 
that will make the delay twice as much. so with 1/5 second delay, 
that's might be an issue.


i offered this before (and someone sent me a request and i believe i 
replied, but i don't remember who), but if you want my 2001 MATLAB 
code that demonstrates a simple phase vocoder doing time scaling, i am 
happy to send it to you or anyone.  it's old.  you have to turn 
wavread() and wavwrite() into audioread() and audiowrite(), but 
otherwise, i think it will work.  it has an additional function that 
time-scales each sinusoid *within* every frame, but i think that can 
be turned off and you can even delete that modification and what you 
have left is, in my opinion, the most basic phase vocoder implemented 
to do time scaling.  lemme know if that might be helpful.


L8r,

r b-j

 Original Message 
Subject: Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for 
realtime synthesis?

From: "gm" 
Date: Fri, November 9, 2018 5:02 pm
To: music-dsp@music.columbia.edu
--

> You get me intrigued with this
>
> I actually believe that wavelets are the way to go for such things,
> but, besides that anything beyond a Haar wavelet is too complicated 
for me

> (and I just grasp that Haar very superficially of course),
>
> I think one problem is the problem you mentioned - don't do anything
> with the bands,
> only then you have perfect reconstruction
>
> And what to do you do with the bands to make a pitch shift or to
> preserve formants/do some vocoding?
>
> It's not so obvious (to me), my naive idea I mentioned earlier in this
> thread was to
> do short FFTs on the bands and manipulate the FFTs only
>
> But how? if you time stretch them, I believe the pitch goes down (thats
> my intuition only, I am not sure)
> and also, these bands alias, since the filters are not brickwall,
> and the aliasing is only canceled on reconstruction I believe?
>
> So, yes, very interesting topic, that could lead me astray for another
> couple o

Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-09 Thread gm

You get me intrigued with this

I actually believe that wavelets are the way to go for such things,
but, besides that anything beyond a Haar wavelet is too complicated for me
(and I just grasp that Haar very superficially of course),

I think one problem is the problem you mentioned - don't do anything 
with the bands,

only then you have perfect reconstruction

And what to do you do with the bands to make a pitch shift or to 
preserve formants/do some vocoding?


It's not so obvious (to me), my naive idea I mentioned earlier in this 
thread was to

do short FFTs on the bands and manipulate the FFTs only

But how? if you time stretch them, I believe the pitch goes down (thats 
my intuition only, I am not sure)

and also, these bands alias, since the filters are not brickwall,
and the aliasing is only canceled on reconstruction I believe?

So, yes, very interesting topic, that could lead me astray for another 
couple of weeks but without any results I guess


I think as long as I don't fully graps all the properties of the FFT and 
phase vocoder I shouldn't start anything new...


Am 09.11.2018 um 22:31 schrieb robert bristow-johnson:




what you're discussing here appears to me to be about perfect 
reconstruction in the context of Wavelets and Filter Banks.


there is a theorem that's pretty easy to prove that if you have 
complementary high and low filterbanks with a common cutoff at 1/2 
Nyquist, you can downsample both high and low-pass filterbank outputs 
by a factor of 1/2 and later combine the two down-sampled streams of 
samples to get perfect reconstruction of the original.  this result is 
not guaranteed if you **do** anything to either filter output in the 
filterbank.


 Original Message 
Subject: Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for 
realtime synthesis?

From: "gm" 
Date: Fri, November 9, 2018 4:19 pm
To: music-dsp@music.columbia.edu
--
>
> hm, my application has also WOLA ...
>
> All I find is about up- and downsampling of time sequences and spectra
> of the same length.
>

...
>
> If anyone knows of an easy explanation of down- and up sampling spectra
> it would be much appreciated.
>
> Am 09.11.2018 um 19:16 schrieb Ethan Duni:
> ..
>> The only applications I know of that tolerate time-domain aliasing in
>> transforms are WOLA filter banks - which are explicitly designed to
>> cancel these (severe!) artifacts in the surrounding time-domain
>> processing.

--

r b-j                         r...@audioimagination.com

"Imagination is more important than knowledge."


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-09 Thread gm


hm, my application has also WOLA ...

All I find is about up- and downsampling of time sequences and spectra 
of the same length.


Summing adjacent bins seemed to be in correspondence with lowpass 
filtering and decimation of time sequences

even though it's not the apropriate sinc filter...

If I just take every other bin it misses information that a half sized 
spectrum derived from the
original time series would have, for instance if only bin 1 had content 
in the double sized spectrum
certainly the downsized spectrum would need to reflect this as DC or 
something?


So do I have to apply a sinc filter before and then discard every other bin?

If so, can this be done with an other FFT like a cepstrum on the bins?

If anyone knows of an easy explanation of down- and up sampling spectra 
it would be much appreciated.


Am 09.11.2018 um 19:16 schrieb Ethan Duni:

gm wrote:
>This is brining up my previous question again, how do you decimate a 
spectrum

>by an integer factor properly, can you just add the bins?

To decimate by N, you just take every Nth bin.

>the orginal spectrum represents a longer signal so I assume folding
>of the waveform occurs?

Yeah, you will get time-domain aliasing unless your DFT is oversampled 
(i.e., zero-padded in time domain) by a factor of (at least) N to 
begin with. For critically sampled signals the result is severe 
distortion (i.e., SNR ~= 0dB).


>but maybe this doesn't matter in practice for some applications?

The only applications I know of that tolerate time-domain aliasing in 
transforms are WOLA filter banks - which are explicitly designed to 
cancel these (severe!) artifacts in the surrounding time-domain 
processing.


Ethan D

On Fri, Nov 9, 2018 at 6:39 AM gm <mailto:g...@voxangelica.net>> wrote:


This is brining up my previous question again, how do you decimate
a spectrum
by an integer factor properly, can you just add the bins?

the orginal spectrum represents a longer signal so I assume folding
of the waveform occurs? but maybe this doesn't matter in practice
for some applications?

The background is still that I want to use a higher resolution for
ananlysis and
a lower resolution for synthesis in a phase vocoder.


Am 08.11.2018 um 21:45 schrieb Ethan Duni:

Not sure can get the odd bins *easily*, but it is certainly
possible. Conceptually, you can take the (short) IFFT of each
block, then do the (long) FFT of the combined blocks. The even
coefficients simplify out as you observed, the odd ones will be
messier. Not sure quite how messy - I've only looked at the
details for DCT cases.

Probably the clearest way to think about it is in the frequency
domain. Conceptually, the two consecutive short DFTs are the same
as if we had taken two zero-padded long DFTs, and then
downsampled each by half. So the way to combine them is to
reverse that process: upsample them by 2, and then add them
together (with appropriate compensation for the
zero-padding/boxcar window).

Ethan D

On Thu, Nov 8, 2018 at 8:12 AM Ethan Fenn mailto:et...@polyspectral.com>> wrote:

I'd really like to understand how combining consecutive DFT's
can work. Let's say our input is x0,x1,...x7 and the DFT we
want to compute is X0,X1,...X7

We start by doing two half-size DFT's:

Y0 = x0 + x1 + x2 + x3
Y1 = x0 - i*x1 - x2 + i*x3
Y2 = x0 - x1 + x2 - x3
Y3 = x0 + i*x1 - x2 - i*x3

Z0 = x4 + x5 + x6 + x7
Z1 = x4 - i*x5 - x6 + i*x7
Z2 = x4 - x5 + x6 - x7
Z3 = x4 + i*x5 - x6 - i*x7

Now I agree because of periodicity we can compute all the
even-numbered bins easily: X0=Y0+Z0, X2=Y1+Z1, and so on.

But I don't see how we can get the odd bins easily from the
Y's and Z's. For instance we should have:

X1 = x0 + (r - r*i)*x1 - i*x2 + (-r - r*i)*x3 - x4 + (-r +
r*i)*x5 + i*x6 + (r + r*i)*x7

where r=sqrt(1/2)

Is it actually possible? It seems like the phase of the
coefficients in the Y's and Z's advance too quickly to be of
any use.

-Ethan



On Mon, Nov 5, 2018 at 3:40 PM, Ethan Duni
mailto:ethan.d...@gmail.com>> wrote:

You can combine consecutive DFTs. Intuitively, the basis
functions are periodic on the transform length. But it
won't be as efficient as having done the big FFT (as you
say, the decimation in time approach interleaves the
inputs, so you gotta pay the piper to unwind that). Note
that this is for naked transforms of successive blocks of
inputs, not a WOLA filter bank.

There are Dolby codecs that do similar with a suitable
flavor of DCT (type II I think?) - you have your encoder
going along at the usual frame rate, but if it detect

Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-09 Thread gm
This is brining up my previous question again, how do you decimate a 
spectrum

by an integer factor properly, can you just add the bins?

the orginal spectrum represents a longer signal so I assume folding
of the waveform occurs? but maybe this doesn't matter in practice for 
some applications?


The background is still that I want to use a higher resolution for 
ananlysis and

a lower resolution for synthesis in a phase vocoder.


Am 08.11.2018 um 21:45 schrieb Ethan Duni:
Not sure can get the odd bins *easily*, but it is certainly possible. 
Conceptually, you can take the (short) IFFT of each block, then do the 
(long) FFT of the combined blocks. The even coefficients simplify out 
as you observed, the odd ones will be messier. Not sure quite how 
messy - I've only looked at the details for DCT cases.


Probably the clearest way to think about it is in the frequency 
domain. Conceptually, the two consecutive short DFTs are the same as 
if we had taken two zero-padded long DFTs, and then downsampled each 
by half. So the way to combine them is to reverse that process: 
upsample them by 2, and then add them together (with appropriate 
compensation for the zero-padding/boxcar window).


Ethan D

On Thu, Nov 8, 2018 at 8:12 AM Ethan Fenn > wrote:


I'd really like to understand how combining consecutive DFT's can
work. Let's say our input is x0,x1,...x7 and the DFT we want to
compute is X0,X1,...X7

We start by doing two half-size DFT's:

Y0 = x0 + x1 + x2 + x3
Y1 = x0 - i*x1 - x2 + i*x3
Y2 = x0 - x1 + x2 - x3
Y3 = x0 + i*x1 - x2 - i*x3

Z0 = x4 + x5 + x6 + x7
Z1 = x4 - i*x5 - x6 + i*x7
Z2 = x4 - x5 + x6 - x7
Z3 = x4 + i*x5 - x6 - i*x7

Now I agree because of periodicity we can compute all the
even-numbered bins easily: X0=Y0+Z0, X2=Y1+Z1, and so on.

But I don't see how we can get the odd bins easily from the Y's
and Z's. For instance we should have:

X1 = x0 + (r - r*i)*x1 - i*x2 + (-r - r*i)*x3 - x4 + (-r + r*i)*x5
+ i*x6 + (r + r*i)*x7

where r=sqrt(1/2)

Is it actually possible? It seems like the phase of the
coefficients in the Y's and Z's advance too quickly to be of any use.

-Ethan



On Mon, Nov 5, 2018 at 3:40 PM, Ethan Duni mailto:ethan.d...@gmail.com>> wrote:

You can combine consecutive DFTs. Intuitively, the basis
functions are periodic on the transform length. But it won't
be as efficient as having done the big FFT (as you say, the
decimation in time approach interleaves the inputs, so you
gotta pay the piper to unwind that). Note that this is for
naked transforms of successive blocks of inputs, not a WOLA
filter bank.

There are Dolby codecs that do similar with a suitable flavor
of DCT (type II I think?) - you have your encoder going along
at the usual frame rate, but if it detects a string of
stationary inputs it can fold them together into one big
high-res DCT and code that instead.

On Mon, Nov 5, 2018 at 11:34 AM Ethan Fenn
mailto:et...@polyspectral.com>> wrote:

I don't think that's correct -- DIF involves first doing a
single stage of butterfly operations over the input, and
then doing two smaller DFTs on that preprocessed data. I
don't think there is any reasonable way to take two
"consecutive" DFTs of the raw input data and combine them
into a longer DFT.

(And I don't know anything about the historical question!)

-Ethan



On Mon, Nov 5, 2018 at 2:18 PM, robert bristow-johnson
mailto:r...@audioimagination.com>> wrote:

Ethan, that's just the difference between
Decimation-in-Frequency FFT and Decimation-in-Time FFT.

i guess i am not entirely certainly of the history,
but i credited both the DIT and DIF FFT to Cooley and
Tukey.  that might be an incorrect historical impression.



 Original Message

Subject: Re: [music-dsp] 2-point DFT Matrix for
subbands Re: FFT for realtime synthesis?
From: "Ethan Fenn" mailto:et...@polyspectral.com>>
Date: Mon, November 5, 2018 10:17 am
To: music-dsp@music.columbia.edu


--

> It's not exactly Cooley-Tukey. In Cooley-Tukey you
take two _interleaved_
> DFT's (that is, the DFT of the even-numbered samples
and the DFT of the
> odd-numbered samples) and combine them into one
longer DFT. But here you're
> 

Re: [music-dsp] bandwidth of window? Re: FFT for realtime synthesis?

2018-11-07 Thread gm



Am 07.11.2018 um 12:32 schrieb gm:
but when I use windowsize = 1/bandwitdhERB I get windows that are too 
small for

the phase vocoder, for instance for the lowest band I get

bandwidthERB (~10Hz) ~= 26 Hz bandwidth, ~ 1705 samples window length

This gives too much modulation or too much bandwidth by the window, 
even if I double this.


according to a paper you have to scale it to the -3dB witdh of the 
window in bins
which is given with 1.44 for Hann, but I found that it works 
satisfactorily with  a scaling of 2.88


the sources are called On the use of windows for harmonic analysis with 
the discrete fourier transform
and A flexible multi-resolution time-frequency analysis framework for 
audio signals

if anyone is interested

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] bandwidth of window? Re: FFT for realtime synthesis?

2018-11-07 Thread gm




Am 06.11.2018 um 19:35 schrieb gm:
I use 2^octave * SR/FFTsize -> toERBscale -> * log2(FFTsize)/42 as a 
scaling factor for the windows.


Means the window of the top octave is about 367 samples at 44100 SR - 
does that seem right?

ok this was wrong...

it should be just windowsize = 1/bandwidthERB

but when I use windowsize = 1/bandwitdhERB I get windows that are too 
small for

the phase vocoder, for instance for the lowest band I get

bandwidthERB (~10Hz) ~= 26 Hz bandwidth, ~ 1705 samples window length

This gives too much modulation or too much bandwidth by the window, even 
if I double this.


(I know that ERB does not go to 10 Hz but the same is true for all bands.)

So, what am I doing wrong here?






___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-06 Thread gm

I think I figured it out.

I use 2^octave * SR/FFTsize -> toERBscale -> * log2(FFTsize)/42 as a 
scaling factor for the windows.


Means the window of the top octave is about 367 samples at 44100 SR - 
does that seem right?


Sounds better but not so different, still pretty blurry and somewhat 
reverberant.


I used the lower frequency limit of the octaves for the window sizes
and Hann windows cause I don't want the windows to be too small.

Do you think using Gaussian windows and the center of the octave will 
make a big difference?


Or do I just need more overlaps in resynthesis now?


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-06 Thread gm

Further tests let me assume that you can do it on a log2 scale but that
appropriate window sizes are crucial.

But how to derive these optmal window sizes I am not sure.

I could calculate the bandwitdh of the octave band (or an octave/N band) 
in ERB
for instance but then what? How do I derive a window length from that 
for that band?


I understand that bandwitdh is inversly proportional to window length.

So it seems very easy actually but I am stuck here...


Am 06.11.2018 um 16:13 schrieb gm:

At the moment I am using decreasing window sizes on a log 2 scale.

It's still pretty blurred, and I don't know if I just don't have the 
right window parameters,
and if a log 2 scale is too coarse and differs too much from an 
auditory scale, or if if I don't have

enough overlaps in resynthesis (I have four).
Or if it's all together.

The problem is the lowest octave or the lowest two octaves, where I 
need a long
window for frequency estimation and partial tracking, it just soundded 
bad when the window was smaller in this range

because the frequencies are blurred too much I assume.

Unfortunately I am not sure what quality can be achieved and where the 
limits are with this approach.



Am 06.11.2018 um 14:20 schrieb Ross Bencina:

On 7/11/2018 12:03 AM, gm wrote:
A similar idea would be to do some basic wavelet transfrom in 
octaves for instance and then
do smaller FFTs on the bands to stretch and shift them but I have no 
idea
if you can do that - if you shift them you exceed their bandlimit I 
assume?
and if you stretch them I am not sure what happens, you shift their 
frequency content down I assume?
Its a little bit fuzzy to me what the waveform in a such a band 
represents

and what happens when you manipulate it, or how you do that.


Look into constant-Q and bounded-Q transforms.

Ross.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-06 Thread gm

At the moment I am using decreasing window sizes on a log 2 scale.

It's still pretty blurred, and I don't know if I just don't have the 
right window parameters,
and if a log 2 scale is too coarse and differs too much from an auditory 
scale, or if if I don't have

enough overlaps in resynthesis (I have four).
Or if it's all together.

The problem is the lowest octave or the lowest two octaves, where I need 
a long
window for frequency estimation and partial tracking, it just soundded 
bad when the window was smaller in this range

because the frequencies are blurred too much I assume.

Unfortunately I am not sure what quality can be achieved and where the 
limits are with this approach.



Am 06.11.2018 um 14:20 schrieb Ross Bencina:

On 7/11/2018 12:03 AM, gm wrote:
A similar idea would be to do some basic wavelet transfrom in octaves 
for instance and then
do smaller FFTs on the bands to stretch and shift them but I have no 
idea
if you can do that - if you shift them you exceed their bandlimit I 
assume?
and if you stretch them I am not sure what happens, you shift their 
frequency content down I assume?
Its a little bit fuzzy to me what the waveform in a such a band 
represents

and what happens when you manipulate it, or how you do that.


Look into constant-Q and bounded-Q transforms.

Ross.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-05 Thread gm




Am 05.11.2018 um 16:17 schrieb Ethan Fenn:


Of course it's possible you'll be able to come up with a clever 
frequency estimator using this information. I'm just saying it won't 
be exact in the way Cooley-Tukey is.


Maybe, but not the way I laid it out.

Also it seems wiser to interpolate spektral peaks, as had been suggested 
to me before.


But it doesn's sound much better then to get the frequency from the 
phase step so the bad sound for frequency shifts at an FFT size of 2048 
has other reasons than just a bad phase estimate.
Maybe it's just stupid to find a solution for this FFT size and a 
frequency domain shift.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-04 Thread gm




Am 05.11.2018 um 01:56 schrieb gm:

so you do the "radix 2 algorithm" if you will on a subband, and now what?
the bandlimits are what? the neighbouring upper and lower bands?

how do I get a frequency estimate "in between" out of these two real 
values that describe the upper and lower limit of the band but have no 
further information?


thank you.

The way I see it:

If you do that 2 point transform on a band you get 2 data points instead 
of one (or rather instead of two sucsessive ones of course), 
representing the upper and lower bandwith limit of the band, but not 
very well seperated.
But if you take the result of the previous frame also into account you 
now get 4 points representing the corner of a bin
of the original spectrum so to say, however in bewteen spectra, and you 
now can do bilinear interpolation between these 4 points.


But in the end this is just crude averaging between two sucessive 
spectra, and I am not sure if it sounded better
or worse. It's hard to tell a difference, it works quite well on a sine 
sweep though.


But there must be a better way to make use of these 2 extra data points.

In the end you now have the same amount of information as with a 
spectrum of double size.

So you should be able to obtain the same quality from that.
That was my way of thinking, however flawed that is, I'd like to know.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-04 Thread gm




Am 05.11.2018 um 01:39 schrieb robert bristow-johnson:

mr. g,

I think what you're describing is the Cooley-Tukey Radix-2 FFT algorithm.


yes that seems kind of right, though I am not describing something but 
posting a question actually

and the "other thing" was an answer to a question

maybe my post was too long, boring and naive for you, so I am sorry for 
that.
I am reusing the same subject lien to help people to ignore this, if 
they want


so you do the "radix 2 algorithm" if you will on a subband, and now what?
the bandlimits are what? the neighbouring upper and lower bands?

how do I get a frequency estimate "in between" out of these two real 
values that describe the upper and lower limit of the band but have no 
further information?


thank you.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] 2-point DFT Matrix for subbands Re: FFT for realtime synthesis?

2018-11-04 Thread gm

bear with me, I am a math illiterate.

I understand you can do a Discrete Fourier Transform in matrix form,
and for 2-point case it is simply
[ 1, 1
  1,-1]
like the Haar transform, average and difference.



My idea is, to use two successive DFT frames, and to transform 
resepctive bins of two successive frames like this.
To obtain a better frequency estimate (subbands) from two smaller DFTs 
instead of an DFT double the size.


This should be possible? and the information obtained, time and 
frequency resolution wise, identical.

Except that you can overlap the two DTFs.

I basically want to find the dominant frequency in the FFT bin, and 
sepreate it and discard the rest.
And a subband resolution of 2 seems to be a sufficient increase in 
resolution.


But how do I get that from this when there is no phase other then 0?
I can see which of the two bands has more energy, but how do I know "the 
true frequency" of Nyquist and DC?

There is not enough information.

The problem persists for me if I resort to a 4-point transform, what to 
do with the highest/lowest subband.
(and also to understand how to calculate the simple 4 point matrix, 
cause I am uneducated..)


Or do I need the 4-point case and discard "DC" and Nyquist subbands?
Or is the idea totally nonsens?
Or is it justified to pick the subband that has more energy, and then, what?






___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] compensation for window sizes Re: FFT for realtime synthesis?

2018-11-04 Thread gm



Am 04.11.2018 um 23:49 schrieb Scott Cotton:



On Sun, 4 Nov 2018 at 22:50, gm <mailto:g...@voxangelica.net>> wrote:


note that in polyphonic sources, transients may only apply to one of 
the sources, so
if you define transient as a slice of time say of a percussive onset, 
like guitar, maybe
other strings or instruments are sustaining at the same time, and then 
the transient

part may sound weird w.r.t. continuity of the other parts.


I track partials, and when a new partial comes in, it is treated as a 
part of a transient.
So only those partials that belong to the transient are set to the 
original phase.


But the issue is that temporal spread of the FFT, the low frequencies may
come in softly before the high frequencies, so a new partial is tracked 
before the actualy transient.


So the whole thing seems to work for higher frequencies (which are 
important for transients)
but not the low frequencies. Or doesnt work at all, it's hard to hear a 
difference tbh.
also, when the frequency is shifted, the waveform is squeezed and only 
the squeezed part
hast the right wave shape - if it has the right waveshape, I am not 100% 
sure it has

but my test seem to suggest that, and it seems to be the right idea.


formants:
filter original spectrum on log2 scale with increasingly long
filters (should be done offline)
divide by filtered spectrum, multiply by shifted filtered spectrum


I don't understand what you're doing with formants, would be 
interested to learn more.


They are set to be fixed, so they dont shift with the frequency, for a 
natural sound,
and you can also shift them if you want, as can be heard briefly on the 
"male" voice in the example I posted


The spectrum is filtered (smoothed) on a log 2 basis to obtain a 
spectral envelope,
by that I mean according to the log 2 of the bin index the fiter length 
doubles.

The filters are simpel averaging FIR filters, I start with 5 bands average.
I also filter forwards and backwards, so the filter is aplied twice, for 
symmetry reasons

and also for better filter group response.
This is somewhat similar but not identical to filtering on an ERB scale 
or Mel scale filtering,
which might give better results, but would be more laborious to do, it 
was a quick hack.

Also my way could be considered more physical.

Then the origial spectrum is divided by the smoothed spectrum, which whitens
the signal, that is this removes all formants, but keeps the difference 
between the spikes of the partials
and the dips where there is nothing - so sideband artefacts or noise 
floor are not whitened.


Then the smoothed spectrum is shifted, and the whitened spectrum 
multiplied with that,

vocoding with itself bascially, so now it has the new formants.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] compensation for window sizes Re: FFT for realtime synthesis?

2018-11-04 Thread gm


Thanks for the links.
At the moment it's still to reverberant even with multiresolution.

Probably Gabor windows are part of the solution, I still have to look at 
these papers closely.
I will try those, but probably they only make sense with more multires 
bands then I have now.


Also I want to get the synthesis stage at 2048 FFT size.

How I do it now:

analysis
 at 4096 FFT size, log 2 multiresolution (7 bands), 16 overlaps (Hann 
Windows)
but peak tracking and phase tracking at 4096 FFT size without 
multiresolution for better tracking
it's a peak if it was a peak candidate in the frame after the frame or 
in adjacent bins
it's a peak candidate if its larger than adjacent bins and larger than a 
noise threshold
it's a transient if a peak track starts (or actually stops, regarded 
backwards).


synthesis
sines and noise sythesis:
if its not at tracked peak, its noise, and synthesised with random 
amplitudes but updated phases


transients:
if it's transient, use original phase, accumlated phase otherwise
do transients only once when they are crossed

freqshift:
updated phases for timestretch and freq. shift or transients and 
frequency shift

shift amplitude bins for frequency shift

formants:
filter original spectrum on log2 scale with increasingly long filters 
(should be done offline)

divide by filtered spectrum, multiply by shifted filtered spectrum


Here is how it sounds, all examples are too time stretched (and or 
shifted) to better hear it's limits

https://soundcloud.com/traumlos_kalt/transcoder-096-2/s-3bqkl
Still reverberant, transients are better but still lacking, otherwise I 
am half way content


Gabor windows, I will try these, further suggestions?

Especially for the transient detection, because at the moment it comes 
in too early

for the lower bands, due to the temporal dilution.


Am 04.11.2018 um 22:07 schrieb Scott Cotton:

The following may help

https://www.dsprelated.com/freebooks/sasp/STFT_COLA_Decomposition.html
http://lonce.org/Publications/publications/2007_RealtimeSignalReconstruction.pdf
https://hal.archives-ouvertes.fr/hal-00453178/document

librosa uses the below (If you have access)
[1]D. W. Griffin and J. S. Lim, “Signal estimation from modified 
short-time Fourier transform,” IEEE Trans. ASSP, vol.32, no.2, 
pp.236–243, Apr. 1984.


The biggest thing to note however is that if you modify the spectra in 
an STFT (or by taking in "grains") then the modified sequence of 
spectra no longer necessarily coincides to any signal, and so some 
sort of estimation is used.  If you're doing power of 2 sizes and 
corresponding subbed decomposition, you'd apply that to each band.  
The Gabor frame stuff looks like it has multiple time-frequency 
tilings as well.


I believe reconstructing with windowing is one of the hardest parts of 
frequency domain processing to do well.  It is still being researched, 
and it is one big reason why phase vocoders aren't, in my opinion, a 
solved problem.


Scott








On Sun, 4 Nov 2018 at 19:55, gm <mailto:g...@voxangelica.net>> wrote:




Am 04.11.2018 um 17:00 schrieb gm:
>
> ok I now I tried a crude and quick multiresolution FFT analysis
at log
> 2 basis


I half the window size (Hann) for every FFT.

To compensate for the smaller window, I multiply by the factor
that it
is smaller, that is 2, 4, 8,

But it appears that there is noticably more energy now in the higher
bands with the smaller windows.

How do I compensate for the window properly?
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp



--
Scott Cotton
http://www.iri-labs.com




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] compensation for window sizes Re: FFT for realtime synthesis?

2018-11-04 Thread gm




Am 04.11.2018 um 17:00 schrieb gm:


ok I now I tried a crude and quick multiresolution FFT analysis at log 
2 basis



I half the window size (Hann) for every FFT.

To compensate for the smaller window, I multiply by the factor that it 
is smaller, that is 2, 4, 8,


But it appears that there is noticably more energy now in the higher 
bands with the smaller windows.


How do I compensate for the window properly?
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-11-04 Thread gm



ok I now I tried a crude and quick multiresolution FFT analysis at log 2 
basis and it seems to work.
However my partial and transient tracking does not work naymore on the 
higher bands since there is too much modulation from the windows now, 
but it seems that in general this is the direction to go, with some 
refinements-



Am 04.11.2018 um 14:55 schrieb gm:


Maybe you could make the analysis with a filterbank, and do the 
resynthesis with FFT?


Years ago I made such a synth based on "analog" Fourier Transforms,
(the signal is modulated and rotated down to 0 Frequency and that 
frequencies around DC are lowpass filtered

depending on the bandwitdh yoe need)
it it did the inverse transform by modulated sines, but sounded rather 
reverberant though

since the analysis has a rather long IR on the lowest bands.
I used 72 Bands based on a Bark scale.

Maybe I should try something like that again...
However it's absolutely not clear to me how to go from 72 (or what 
ever) broadband bands

to FFT frequencies and bands?

Maybe you could just use the amplitude spectrum from the bank and the 
frequencies from an FFT.

Any objections?

The frequencies would be wrong before transients, but the benefit is 
that you get a good spectral envelope

and you can have a really sharp transient detection.

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-11-04 Thread gm



Maybe you could make the analysis with a filterbank, and do the 
resynthesis with FFT?


Years ago I made such a synth based on "analog" Fourier Transforms,
(the signal is modulated and rotated down to 0 Frequency and that 
frequencies around DC are lowpass filtered

depending on the bandwitdh yoe need)
it it did the inverse transform by modulated sines, but sounded rather 
reverberant though

since the analysis has a rather long IR on the lowest bands.
I used 72 Bands based on a Bark scale.

Maybe I should try something like that again...
However it's absolutely not clear to me how to go from 72 (or what ever) 
broadband bands

to FFT frequencies and bands?

Maybe you could just use the amplitude spectrum from the bank and the 
frequencies from an FFT.

Any objections?

The frequencies would be wrong before transients, but the benefit is 
that you get a good spectral envelope

and you can have a really sharp transient detection.

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-11-04 Thread gm




Am 04.11.2018 um 03:03 schrieb Theo Verelst:


It might help to understand why in this case you'd chose for the 
computation according to a IFFT scheme for synthesis. Is it for 
complimentary processing steps, efficiency, because you have data that 
fits the practical method in terms of granularity, theoretical 
interest, example software, some sort of juxtaposition of 
alternatives, or maybe a well known engineering example where this 
appears logical ?
Originall it was a UI study and proof of concept engine for a granular 
cloud synth,

then I replaced the grain engine with FFT because I had some misconceptions:

- I thought you could get the granular cloud sound by randomizing the 
FFT, but it sounds very different


- I thought you would get a better time resolution by using a smaller 
hop size in the analysis
but that is not the case. You would need a smaller window, but then the 
frequency analysis is bad.


- Also I thought you could use a larger FFT for ananlysis and compress 
them into a smaller ones for resynthesis
and benefit from both, but it's the other way it seems, you get the 
disadvantages from both,
at least it didnt work so well here and sounded like the smaller FFT 
exept that transients are blurred more.


- Finally I thought you could reconstruct the waveshape on transients by 
using th original phase,
but it doesn't seem to make a big audible difference and my transient 
detection
doesn't work so well cause the transients are already spread in time by 
the analysis

so this reonstructed waveshape doesn't come in at he right moment.

Still I think that somehow it could be possible with the FFT, using a 
time domain pitch shift,

but doing it in that order iFFT -> time domain shift seems to be
more complicated compared to the other way : td shift -> FFT, which was 
my first implementation
I think for the other way you always need a variing number of FFTs per 
time?

Also I think the resolution issue will be the same.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-11-03 Thread gm



as I wrote before, it depends on the phase angle whether or not the 
amplitudes add up when you add the numbers


with opposite phase, and equal amplitude, the amplitudes cancel, with 
same phase they add up,


with pi radians it is sqrt(2), ect,

but I made a quick hack test and it doesn't sound as good as the full 
spectrum, something in quality is missing


I am still investigating and thinking about this so I am not sure what I 
am missing,


I mean there exists a halfsized spectrum that would represent the signal 
perfectly (or rather, two of them would)
maybed it has to do with the fact that you need two successive spectra 
to represent he same information
but I dont really see the effect of that other than it has a better time 
resolution


Am 03.11.2018 um 10:48 schrieb Ross Bencina:

[resending, I think I accidentally replied off-list]

On 1/11/2018 5:00 AM, gm wrote:
> My question rephrased:
> Lets assume a spectrum of size N, can you create a meaningfull 
spectrum of size N/2

> by simply adding every other bin together?
>
> Neglecting the artefacts of the forward transform, lets say an 
artificial spectrum
> (or a spectrum after peak picking that discards the region around 
the peaks)

>
> Lets say two sinusoids in two adjacent bins, will summing them into 
a single bin of a half sized spectrum

> make sense and represent them adequately?
> In my limited understanding, yes, but I am not sure, and would like 
to know why not

> if that is not the case.

You can analyze this by looking at the definition of the short-time 
discrete Fourier transform. (Or the corresponding C code for a DFT).


Each spectral bin is the sum of samples in the windowed signal 
multiplied by a complex exponential.


Off the top of my head, assuming a rectangular window, I think you'll 
find that dropping every second bin in the length N spectrum gives you 
the equivalent of the bin-wise sum of two length N/2 DFTs computed 
with hop size N/2.


Summing adjacent bins would do something different. You could work it 
out by taking the definition of the DFT and doing some algebra. I 
think you'd get a spectrum with double the amplitude, frequency 
shifted by half the bin-spacing. (i.e. the average of the two bin's 
center frequencies).


Ross.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-11-03 Thread gm



An I think you can model them simply by adding their phasors/bins/numbers...

for opposite angles they will cancel, for the same angle they will be 
amplified


so the model is correct at the center of the window, but it models just 
an instance in time and spreads this instance


in this way of thinking you basically consider the dft a sine bank 
oscillator



Am 03.11.2018 um 05:59 schrieb Ross Bencina:

On 3/11/2018 3:41 AM, Ethan Fenn wrote:
No length of FFT will distinguish between a mixture of these sine 
waves and a single amplitude-modulated one, because they're 
mathematically identitical! Specifically:


sin(440t) + sin(441t) = 2*cos(0.5t)*sin(440.5t)

So the question isn't whether an algorithm can distinguish between 
them but rather which one of these two interpretations it should 
pick. And I would say in most audio applications the best answer is 
that it should pick the same interpretation that the human hearing 
system would. In this example it's clearly the right-hand side. In 
the case of a large separation (e.g. 440Hz and 550Hz, a major third) 
it's clearly the left-hand side. And somewhere in between I guess it 
must be a toss-up.


I guess you could model both simultaneously, with some kind of 
probability weighting.


Ross.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] transient detection Re: FFT for realtime synthesis?

2018-11-02 Thread gm




Am 02.11.2018 um 21:40 schrieb gm:

Any other ideas?


ok the answer is already in my post: just analyze backwards
It's possibly part of a transient when the backwards tracked partial 
stops to exist.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] transient detection Re: FFT for realtime synthesis?

2018-11-02 Thread gm




Now the synth works quite well with an FFT size of 4096, I had a severe bug
all the time which was messing every other frames phase up.

I have simple peak picking now for sines+noise synthesis
which sounds much nicer when the sound is frozen.

It's a peak if its larger then two adjacent bins and if it was a peak 
candidate or peak in either
three bins in the frame before - since this would miss all the onsets of 
peaks
the analysis is done backwards with the unwanted side effect that the 
last bin of a fading

frquency is recognized as a random part, but you dont seem to notice that.

I use random amplitudes for the noise, but keep the phases
so they are not out of phase when a frequency changes from bin to bin.

What I want to do now is some analysis that detects whether or not
a phase should be reset to the original phase for a transient.

I am not sure if the idea is good or not, since the window is rather large
so it will have the wrong phase before the transient.

Any ideas for that? I thought of taking the cepstrum and look for new peaks
to identify new tones. But I think this idea is flawed cause it misses
the actual broadband transient and comes in too late.

A simple time transient detector on the other hand would reset all partials
which is not wanted either.

Any other ideas?


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-10-31 Thread gm

Thanks for your time

My question rephrased:
Lets assume a spectrum of size N, can you create a meaningfull spectrum 
of size N/2

by simply adding every other bin together?

Neglecting the artefacts of the forward transform, lets say an 
artificial spectrum

(or a spectrum after peak picking that discards the region around the peaks)

Lets say two sinusoids in two adjacent bins, will summing them into a 
single bin of a half sized spectrum

make sense and represent them adequately?
In my limited understanding, yes, but I am not sure, and would like to 
know why not

if that is not the case.




I'm not sure what "compress" means in this context, nor am I sure what 
"fall together" means. But here's some points to note:


A steady state sine wave in the time domain will be transformed by a 
short-time fourier transform into a spectral peak, convolved (in the 
frequency domain) by the spectrum of the analysis envelope. If you 
know that all of your inputs are sine waves, then you can perform 
"spectral peak picking" (AKA MQ analysis) and reduce your signal to a 
list of sine waves and their frequencies and phases -- this is the 
sinusoidal component of Serra's SMS (explained in the pdf linked above).


Note that since a sinusoid ends up placing non-zero values in every 
FFT bin, you'd need to account for that in your spectral estimation, 
which basic MQ does not -- hence it does not perfectly estimate the 
sinusoids.


In any case, most signals are not sums of stationary sinusoids. And 
since signals are typically buried in noise, or superimposed on top of 
each other, so the problem is not well posed. For two very simple 
examples: consider two stable sine waves at 440Hz and 441Hz -- you 
will need a very long FFT to distinguish this from a single 
amplitude-modulated sine wave? or consider a sine wave plus white 
noise -- the accuracy of frequency and phase recovery will depend on 
how much input you have to work with.


I think by "compression" you mean "represent sparsely" (i.e. with some 
reduced representation.) The spectral modeling approach is to "model" 
the signal by assuming it has some particular structure (e.g. 
sinusoids+noise, or sinusoids+transients+noise) and then work out how 
to extract this structure from the signal (or to reassemble it for 
synthesis).


An alternative (more mathematical) approach is to simply assume that 
the signal is sparse in some (unknown) domain. It turns out that if 
your signal is sparse, you can apply a constrained random 
dimensionality reduction to the signal and not lose any information. 
This is the field of compressed sensing. Note that in this case, you 
haven't recovered any structure.


Ross




















___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-10-30 Thread gm


Thanks for your answer, it's much apreciated.

My goal is to resynthesize arbitary noises. If you do that with 
wavetables you end up with a pitch of 20 Hz, hence the FFT.

My product idea was rubbish though and your post confirms that.

For your interest, I recently invented "noisetable synthesis" - take any 
sound, randomzie the phases or
circularly convolve with a long chunk of white noise, you get a long 
seemless loop of arbitrary spectra.


Good for synthetic cymbals and the like. Take any sound and stretch it 
into an endless loop.

Nice for ambient music, too.

But back to my question, I am serious, could you compress a spectrum by 
just adding the
bins that fall together? In my understanding, yes, but I am totally not 
sure.

My "understanding" might be totally wrong.


Am 31.10.2018 um 03:14 schrieb robert bristow-johnson:




 Original Message 
Subject: [music-dsp] two fundamental questions Re: FFT for realtime 
synthesis?

From: "gm" 
Date: Tue, October 30, 2018 8:17 pm
To: music-dsp@music.columbia.edu
--

>
>
> Am 30.10.2018 um 16:30 schrieb gm:
>> -Compress the peaks (without the surrounding regions) and noise into
>> smaller spectra.
>> (but how? - can you simply add those that fall into the same bins?)
> snip...
>> I am curious about the spectrum compression part, would this work and
>> if not why not?
>
>
> That's a very fundamental DSP question and I am surprised no one 
wants to

> answer.
> Probably either no one did read the post or it was too stupid.
>
> My layman's answer is YES OF COURSE, WHAT ARE YOU THINKING but what do I
> know, I am all self taught
> and even taught myself how to read and write (not kidding) so I am 
not sure.


mr. g,

i am not exactly "self-taught".  i learned my essential math and 
electrical engineering in a university setting.  but most of these 
audio techniques are things i have learned since skool and are mostly 
self-taught.


perhaps a quarter century ago i saw a paper about doing something like 
real-time additive synthesis by use of the inverse FFT, and while i 
don't remember the details, i remember thinking to myself that it 
would be very difficult doing synthesis with an iFFT for several 
reasons.  if the FFT is too small (like N=2048) the frequency 
resolution for each bin is crappy for notes below, say, middle C.   if 
you're not just plopping a "lobe" of template data down onto the iFFT 
buffer, then you have to find some way to interpolate to move it's 
position a fraction of a bin.  if your FFT is too large, you have a 
long time to wait between MIDI NoteOn going in and sound coming out.  
but a big iFFT is what you need for decent frequency resolution at the 
lower pitches.


if you're synthesizing notes that have harmonic partials, then a 
periodic or quasi-periodic synthesis technique in the time-domain is 
likely your simplest bet.  i am a partisan of Wavetable Synthesis 
because, with the one restriction that the partials are nearly or 
perfectly harmonic, wavetable synthesis is general.  nearly any 
existing acoustic instrument can be convincingly synthesized with 
wavetable synthesis.  as long as you have a good pitch detector, it's 
not hard to analyze a given note and break it into wavetables.  but 
you need to know the period (to a sub-sample precision) and you need 
to be able to interpolate convincingly between samples.  BOTH in the 
analysis phase and in the synthesis phase.  wavetable synthesis works 
well for notes with an attack (what you might use a sampling and 
looping "synthesizer" to do), additive synthesis (as long as the 
partials are nearly harmonic), classic waveforms (like saw, square, 
PWM, sync-saw, sync-square) and you can cross-fade (or "interpolate") 
between wavetables to get the ability to change the sound.  you need a 
good tracking pitch detector in the analysis phase.


but, for fun, there are other synthesis techniques from the olden 
days.  Classic Subtractive synthesis, Karplus-Strong, Physical 
Modeling, Non-linear Waveshaping, Geometric Summation formula, IIR 
impulse response, comb-filter impulse response, "FOF" (something like 
overlapping wavelets or grains).  but they're all time domain.


--


r b-j                         r...@audioimagination.com

"Imagination is more important than knowledge."



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] two fundamental questions Re: FFT for realtime synthesis?

2018-10-30 Thread gm




Am 30.10.2018 um 16:30 schrieb gm:
-Compress the peaks (without the surrounding regions) and noise into 
smaller spectra.

(but how? - can you simply add those that fall into the same bins?)

snip...
I am curious about the spectrum compression part, would this work and 
if not why not?



Thats a very fundamental DSP question and I am surprised no one wants to 
answer.

Probably either no one did read the post or it was too stupid.

My laymans answer is YES OF COURSE, WHAT ARE YOU THINKING but what do I 
know, I am all self tought

and even tought myself how to read and write (not kidding) so I am not sure.
The question, in other words is, can you simply add the simultanous 
parameters(their "phasors," complex numbers)
of two close sinousoids together to get a meaningful description of that 
instance in time?


And another question, to be filed under urban anectdote is:
I've change the resynth from FFT 1024 @ 22050 Hz to FFt 2048 @ 44.1 kHz
and it sounds so much better - why is that? I have no explanation
because the difference between 22 and 44 khz is so miniscule, doesn't 
explain that.


I am quite happy with the freq domain resynth now tbh.
Its not "really good" but ok-ish, not bad, good enough for demonstration 
purposes.

Even though there is a fundamental flaw with my product sketch:
an FFT slice is too long, time slice wise, to be usful in a tight sample 
slicer.

so it's kind of sloppy in its reaction.





___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-30 Thread gm

Ok, heres a final idea, can't test any of this so it's pure science fiction:


-Take a much larger FFT spectrogramme offline, with really fine overlap 
granularity.


-Take the cesptrum, identify regions/groups of transients by new peaks 
in the cepstrum.


-Pick peaks in the spectrum, by amplitudes and the phase releationship 
around the peaks.


-Seperate sinusoids from noise this way.

-Compress the peaks (without the surrounding regions) and noise into 
smaller spectra.

(but how? - can you simply add those that fall into the same bins?)

Now use these smaller spectra to synthesize in realtime.

Use the original phases on transient partial groups and events to 
preserve waveshapes on transients.

Use random phases for the noise like components.
Use accumulated phases everywhere else.


Not sure if any of this makes sense.
I am curious about the spectrum compression part, would this work and if 
not why not?







___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-29 Thread gm




Unfortunately I would have to stick with the "sliding" PD phase locking 
structure from the book for now,
iterating through the spectrum to search for peaks and identify groups 
will add too many frames of additional latency in Reaktor.


But for me this method unfortunately defintively gave worse results than 
without phase locking for music.

It actually sounded broken in some cases, when pitch shifted in frequency.

Both at 22050 and 11025 Hz SR with a 1024 FFT so it's not just a 
question of frequency resolution.

or rather, it probably is, but 4096 @ 44.1 kHz would not solve the problem.
On the other hand, on some speech sample I found an improvement.

(It might be, of course, that I am still doing something else wrong...
Also I might be fooled a little bit because it's louder without phase 
locking since summing the adjacent bins
will decrease the peak bins amplitude so it seems to sound better 
without when you switch it on and off.)


At least meanwhile I understand why and how the method is expected to 
work and I like it's approach.


If s.o. is interested I can post another audio example but I think I've 
spammed the list enough so far...


About such sophisticated things as intra frame corrections, besides that 
it might well be above my head
I first have to get a basic frequency domain shift to work in a decent 
quality...


Meanwhile I found what was broken, the shifted frequencies phases were 
wrong, but quality is still

dissapointing compared to the time stretch version.

I also made a quick test where adjacent amplitudes around peaks where 
simply set to zero
(which doesn't require additional latency here since I can do it on the 
output stream)
and that definitively sounds better on up shifts, so I assume I really 
do need something to treat the phases around peaks

but I am not sure whats an efficient way yet that I can implement.
Maybe it's just that, setting some bins to zero?

Maybe I need to explain that the FFT I made for Reaktor provides a 
constant stream of values like
an audio stream and you have to work on that, sample by sample, or else 
you need a frame

of latency to store the values and work on them, again, sample by sample.
This makes prototyping a little bit odd and laborious, but in the end it 
forces you to choose
efficient solutions, thats why I like Miller Puckets version of the 
phase locking, it just didn't work so well here.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-29 Thread gm

That's understood.

What is not completely understood by me is the technique in the paper, 
and the very much related technique from the book.
How can this apply to arbitrary signals when it relies on sinusioids 
seperated by several bins?


Also it seems I dont understand where the artefacts in my pitch shift 
come from.

They seem to have to do with phases but it's not understood how exactly.

What is understood is that the neighbouring bins of a sinusoidal peak
have a phase -pi apart.

I dont see the effect of this though, they rotate in the same direction, 
at the same speed.


But why is there no artefact of this kind when the signal is only stretched,
but not shifted?


Am 29.10.2018 um 19:50 schrieb Scott Cotton:



On Mon, 29 Oct 2018 at 19:12, gm <mailto:g...@voxangelica.net>> wrote:




Am 29.10.2018 um 05:43 schrieb Ethan Duni:
> You should have a search for papers by Jean Laroche and Mark
Dolson,
> such as "About This Phasiness Business" for some good
information on
> phase vocoder processing. They address time scale modification
mostly
> in that specific paper, but many of the insights apply in
general, and
> you will find references to other applications.
>
> Ethan

I think the technique from the paper only applies for monophonic
harmonic input -?
It picks amplitude peaks and reconstructs the phase on bins around
them
depending on the synthetic phase and
neighbouring input phase. I dont really see what it should do exactly
tbh, but
the criterion for a peak is that it is larger than four neighbouring
bins so this doesn't apply to arbitrary signals, I think.

I also tried Miller Puckets phase locking mentioned in his book The
Theory and Technique of Electronic
Music and also mentioned in the paper,
but a) I don't hear any difference and b) I don't see how and why it
should work.

 From the structure displayed in the book, he adds two neighbouring
complex numbered bins,
multiplied. That is, he multiplies their real and imaginary part
respectivly
and adds that to the values of the bin - (Fig 9.18 p. 293).
Unfortunately this is not explained in detail,

I don't see what that would do other than adding a tiny
perturbation to
isolated peaks
and somehwat larger one to neighbouring bins of peaks?
I don't see how this should lock phases of neighbouring bins?

And again this doesn't apply to arbitrary signals?


No phase vocoder applies to arbitrary signals.  PVs work for 
polyphonic input where
-  the change in frequency over time is slow; specifically slow enough 
so that the
frequency calculation step over one hop can estimate "the" frequency 
over the corresponding time slice.
-  there is at most one sinusoidal "component" per bin (this is 
unrealistic for many reasons), meaning
the time slice needs to be large enough and FFT large enough to 
distinguish.


Note the above can't handle, for example, onsets for most musical 
instruments.


Nonetheless, the errors when these conditions do not hold are such 
that some are able to make
decent sounding TSM/pitch change phase vocoders for a widER variety of 
input.


If you put a chirp into a PV and change the rate of frequency change 
of the chirp, you'll hear the slow frequency
change problem. Before you hear it, you'll see it in the form of 
little steps in the waveform


Scott





___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp



--
Scott Cotton
http://www.iri-labs.com




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-29 Thread gm




Am 29.10.2018 um 19:12 schrieb gm:


From the structure displayed in the book, he adds two neighbouring 
complex numbered bins,
multiplied. That is, he multiplies their real and imaginary part 
respectivly
and adds that to the values of the bin - (Fig 9.18 p. 293). 
Unfortunately this is not explained in detail, 


Sorry I misinterpreted the figure, he doesn't do that but just seems to 
add the bins.

The multiplication seems to be a flag to switch this on and off.
Still I dont see what that would do other then adding an unwanted 
pertubation,

and it sounds worse actually.
Probably I am missing something essential.

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-29 Thread gm




Am 29.10.2018 um 05:43 schrieb Ethan Duni:
You should have a search for papers by Jean Laroche and Mark Dolson, 
such as "About This Phasiness Business" for some good information on 
phase vocoder processing. They address time scale modification mostly 
in that specific paper, but many of the insights apply in general, and 
you will find references to other applications.


Ethan


I think the technique from the paper only applies for monophonic 
harmonic input -?
It picks amplitude peaks and reconstructs the phase on bins around them 
depending on the synthetic phase and
neighbouring input phase. I dont really see what it should do exactly 
tbh, but
the criterion for a peak is that it is larger than four neighbouring 
bins so this doesn't apply to arbitrary signals, I think.


I also tried Miller Puckets phase locking mentioned in his book The 
Theory and Technique of Electronic

Music and also mentioned in the paper,
but a) I don't hear any difference and b) I don't see how and why it 
should work.


From the structure displayed in the book, he adds two neighbouring 
complex numbered bins,

multiplied. That is, he multiplies their real and imaginary part respectivly
and adds that to the values of the bin - (Fig 9.18 p. 293). 
Unfortunately this is not explained in detail,


I don't see what that would do other than adding a tiny perturbation to 
isolated peaks

and somehwat larger one to neighbouring bins of peaks?
I don't see how this should lock phases of neighbouring bins?

And again this doesn't apply to arbitrary signals?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-29 Thread gm

Thanks for tip, I had a brief look at this paper before.
I think the issue it adresses is not the problem I encounter now.
But it might be interesting again at a later stage or if I return to the 
time domain pitch shift.


This is how I do it now, it seems simple & correct but I am not 100% sure,
it still sounds bad except for zero pitch shifts, pure timestretches 
without pitch shift sound ok-ish though
Especially compared to the previous version with time domain pitch 
shifting it sounds much worse.


1.loop through bins -

    calculate input phase difference

    subtract phase step of hop size of the original bin //= 
phase-frequency-deviation


    multiply by frequency factor

    add phase step of hop size of the target bin

    wrap into -pi...pi range

    accumulate to bins phaseaccumulator

 end loop

2.loop through bins 
    calculate spectral envelopes/formant correction
 end loop

3.loop through bins 
    shift bins
 end loop

4.iFFT


for 2., the formant correction, you have to do this before the bin shift :

loop through bins -
    smooth amplitude spectrum according to ERB scale or similar
- end loop

loop through bins -
    shift bins of a copy of the smoothed spectrum in oppsite direction 
(1/freq factor)

    // smooth again, or don't, or use MIPmapping )
    calculate amplitudes * spectrale envelope 2 / spectral envelope 1
- end loop


this seems correct (?) and does both, pitch shifting and time stretching
However, it doesnt sound good, it actually sounds kind of resonant, and 
tinny

(noise elements seem to be converted to ringing sinusoids) and strange
except when the shift is 0, and also sounds better for downshifts then 
for upshifts


also missing is a transient detection (in time domain?) to reset phases
to the original phases, and a noise / sinusiod detection, which might 
improve things


part of the bad sound may just be the fromant correction, it sounds a 
little bit like there were

two voices speaking in synch, another part is the low number of overlaps
example:
https://soundcloud.com/traumlos_kalt/freq-domain-pv-shift-test-4e-2f-4c-test-2/s-6SJ93
1024 @ 22050 kHz











___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-28 Thread gm




Am 28.10.2018 um 22:28 schrieb gm:
I am thinking now that resetting the phase to the original when the 
amplitude exceeds the previous value
is probably wrong too, because the phase should be different when 
shifted to a different bin

if you want to preserve the waveshape
I am not sure about this, but when you think of a minimum phase
waveshape the phases are all different, depending on the frequency.


This whole phase resetting I had is nonsens:

consider for instance speech, the partials meander from bin to bin
from one frame to the next, so you always have the case that the amplitude
is larger than it was in the previous frame, but that is not a transient
where you would want to reset phase.

On the other hand it sounds tinny when the phases are always running freely
and transients don't have the waveshapes they should have when you
stretch time and shift pitch.

So you would need partial tracking or something to that effect I assume.

Also the formant correction I described worked pretty well in the "TDM" 
version but
not well in the phase vocoder version, I dont know why, cause I am doing 
it the same way.

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-28 Thread gm



there had been a mistake in my structure which caused the phase to be 
set to zero

now it sounds more like the original when there is no pitch shift applied
(which is a good indicator that there is something wrong when it does not)

https://soundcloud.com/traumlos_kalt/freq-domain-pv-shift-test-3b-22050-2/s-5pAUL
however it sounds as bad as before when shifted (1024 @ 22050 Hz again)

I am thinking now that resetting the phase to the original when the 
amplitude exceeds the previous value
is probably wrong too, because the phase should be different when 
shifted to a different bin

if you want to preserve the waveshape
I am not sure about this, but when you think of a minimum phase
waveshape the phases are all different, depending on the frequency.
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-28 Thread gm



Am 28.10.2018 um 18:05 schrieb Scott Cotton:


- you need two up to 200 tap FIR filters for a spectral envelope
on an ERB scale (or similar) at this FFT size (you can
precalculate this
offline though)


Could you explain more about this?  What exactly are you doing with 
ERB and offline calculation of

spectral envelopes?

I am not using ERB at the moment I was thinking ahead how to do it more 
properly.


What I do at the moment is filter the amplitude spectrum with a
moving average FIR filter, I am using 5 bins average on the lower bands
and 40 bins on the highest bands, (for an FFT size of 1024 at 22050 
sample rate)

blending between filter lengths dependeing on the log 2 of the bin number.

In other words, I double the moving average filter each octave.

I filter forwards and backwards through the bins.

This is my spectral envelope, wich I use to whiten the original signal
(devide the original spectrums amplitudes with the smoothed spectrums 
amplitudes)
and then use a shifted version of the avaraged spectrum to imprint the 
corrected formants

(mulitplying, like vocoding) on the whitened spectrum.

To do this more properly, I assume that the averaging filters should be 
based on an ERB scale
though what I do is somewhar similar. Then you would need to average 
abou 200 samples

for the highest ERB bands.

My idea was to use the phase vocoder in a sample slicer, so that you can 
stretch

and pitch shift samples slices, with reconstructed formants.
For this youd could precalculate the forward FFT, the spectral 
envelopes, and the phase
differences/frequencies, so you only have the latency and CPU of the 
inverse transform.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-28 Thread gm

to sum it up, assumptions:

- for the phase vocoder approach you need an FFT size of 4096 @ 44.1 kHz 
SR and

- 8 or rather 16 overlaps at this FFT size and SR for a decent quality

- you need two up to 200 tap FIR filters for a spectral envelope
on an ERB scale (or similar) at this FFT size (you can precalculate this 
offline though)


- if you calculate a 4096 iFFT just in time (one bin per sample) you 
have a latency of
~100 ms with these parameters, sped up with 16 simultanoues FFT overlaps 
100/16 = ~5ms,

which would be usable

not sure if all of these assumptions are correct, but
I assume these are the reasons why we dont see so many real time 
applications

with this technique

It's doable, but on the border of what is practically useful (in a VST 
for instance) I think




Am 28.10.2018 um 14:19 schrieb gm:



Am 28.10.2018 um 10:46 schrieb Scott Cotton:
- the quantised pitch shift is only an approximation of a continuous 
pitch shift because
the sinc shaped realisation of a pure sine wave in the quantised 
frequency domain can occur
at different distances from the bin centers for different sine waves, 
shifting bins doesn't do this

and thus isn't 100% faithful.


I think this is one of the problems, frequency wise it seems to work 
better at 11025 Hz sample rate with 1024 FFT size

so I assume you would really need 4096 and 8 overlaps minimum for 44 kHz
Its hard to tell because I can't test more than 4 overlaps in Reaktor 
right now, it will get too complictated
and with that temporal spacing it's diffcult to judge if a larger FFT 
is all thats needed


I am not sure if I calculate the principal value of the phase 
difference correctly
I just wrap it back into the -pi..pi range, which seems right to me 
but maybe I am missing something


From the sound clip, I'd guess that you might have some other 
problems related to normalising the

synthesis volume/power


that's possible, but either I don't understand this point or it 
wouldn't matter so much?




The best quality commonly used pitch shift comes from a phase vocoder 
TSM: stretch the time
and then resample (or vice versa) so that the duration of input 
equals that of output.


that's what I did before but I am hoping to get something that is more 
suitable for real time,
with less latency, calculating the forward transform and spectral 
envelopes offline




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-28 Thread gm




Am 28.10.2018 um 10:46 schrieb Scott Cotton:
- the quantised pitch shift is only an approximation of a continuous 
pitch shift because
the sinc shaped realisation of a pure sine wave in the quantised 
frequency domain can occur
at different distances from the bin centers for different sine waves, 
shifting bins doesn't do this

and thus isn't 100% faithful.


I think this is one of the problems, frequency wise it seems to work 
better at 11025 Hz sample rate with 1024 FFT size

so I assume you would really need 4096 and 8 overlaps minimum for 44 kHz
Its hard to tell because I can't test more than 4 overlaps in Reaktor 
right now, it will get too complictated
and with that temporal spacing it's diffcult to judge if a larger FFT is 
all thats needed


I am not sure if I calculate the principal value of the phase difference 
correctly
I just wrap it back into the -pi..pi range, which seems right to me but 
maybe I am missing something


From the sound clip, I'd guess that you might have some other problems 
related to normalising the

synthesis volume/power


that's possible, but either I don't understand this point or it wouldn't 
matter so much?




The best quality commonly used pitch shift comes from a phase vocoder 
TSM: stretch the time
and then resample (or vice versa) so that the duration of input equals 
that of output.


that's what I did before but I am hoping to get something that is more 
suitable for real time,
with less latency, calculating the forward transform and spectral 
envelopes offline




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] pitch shifting in frequency domain Re: FFT for realtime synthesis?

2018-10-27 Thread gm



Now I tried pitch shifting in the frequency domain instead of time
domain to get rid of one transform step, but it sounds bad and phasey etc.

I do it like this:

multiply phase difference with frequency factor and add to accumulated 
phase,

and shift bins according to frequency factor

again there is a formant correction, and the phase is reset to the 
original phase

if the amplitude is larger than it was in the previous frame

with a 1024 FFT size it doesn't work at 44 kHz, it works @ 22050 kHz but 
sounds

like there is a flanger going on, and especially the bass seems odd
https://soundcloud.com/traumlos_kalt/freq-domain-p-shift-test-1/s-QZBEr

first original then resynthesized

is this the quality that is to be expected with this approach?
am I doing it the right way?


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] spectral envelope Re: FFT for realtime synthesis?

2018-10-27 Thread gm



Now I do it like this, 4 moving average FIRs,
5, 10, 20 and 40 taps
and a linear blend between them based on log2 of the bin number

I filter forwards and backwards, backwards after the shift of the bins 
for formant shifting
the shift is done reading with a linear interpolation from the forward 
prefilterd bins


not very scientific but it works, though there is quite some room for 
improvements,

sonically...

here is how it sounds with a 1024 FFT at 22050 kHz SR with four overlaps:

https://soundcloud.com/traumlos_kalt/spectronmat-4e-2b-01/s-DM4kQ

first transpositions with corrected formants, then extreme formant shifting

I am not sure about the sound quality, it's still not good enogh for a 
product,
I think you need 8 overlaps to reduce granularity, and a better spectral 
envelope

and a better transient detection
(I cant do this in Reaktor though, the structure it will get too messy 
and latency way too much)


any comments, ideas for improvments are appreciated
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] spectral envelope Re: FFT for realtime synthesis?

2018-10-26 Thread gm



here I am using 5 point average on the lower bands and 20 point on the 
higher bands


doesn't sound too bad now, but I am still looking for a better solution

https://soundcloud.com/traumlos_kalt/spectromat-4-test/s-3WxpJ


Am 26.10.2018 um 19:50 schrieb gm:


it seems that my artefacts have mostly to do with the spectral envelope.

What would be an efficient way to extract a spectral envelope when
you ha e stream of bins, that is one bin per sample, repeating

0,1,2,... 1023,0,1,2...
and the same stream backwards

1023,1022,...0,1023,1022...

?

I was using recursive moving average on the stream of amplitudes,
forwards and backwards, but that doesn't work so well
It turns out that the recursive filter can assume negative values even 
though the input is all positive.
Replacing it with a FIR average fiter worked but theres still room for 
improvement.


I dont want to use cepstral filtering for several reasons, it should 
be simple yet efficient..

(complexitiy, latency, cpu)

any ideas?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] spectral envelope Re: FFT for realtime synthesis?

2018-10-26 Thread gm



it seems that my artefacts have mostly to do with the spectral envelope.

What would be an efficient way to extract a spectral envelope when
you ha e stream of bins, that is one bin per sample, repeating

0,1,2,... 1023,0,1,2...
and the same stream backwards

1023,1022,...0,1023,1022...

?

I was using recursive moving average on the stream of amplitudes,
forwards and backwards, but that doesn't work so well
It turns out that the recursive filter can assume negative values even 
though the input is all positive.
Replacing it with a FIR average fiter worked but theres still room for 
improvement.


I dont want to use cepstral filtering for several reasons, it should be 
simple yet efficient..

(complexitiy, latency, cpu)

any ideas?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-25 Thread gm




Am 25.10.2018 um 12:17 schrieb gm:

(also I am doing the pitch shift the wrong way at the moment,
first transpose in time domain, then FFT time stretch, cause that was 
easier to do for now

but this shouldn't cause an audible problem here)



Now I think that flaw is actually the way to go

Instead of doing it the standard way,

FFT time stretch & filtering -> time domain pitch shift

where you need an uneven workload (not a fixed number of FFTs/Second) 
and additional latency

to write the waveform before you can read and transpose it

My proposal is

Offlineprocess:
FFT convert to spectrum with amplitude, phase and phase derivative
-> create multisample (multispectra), one spectrogramme per half octave

Realtimeprocess:
select multispectrum -> iFFT timestretch and pitch shift in frequency domain
(without moving content from bin to bin, hence the multispectrum for 
each 1/2 octave)


this way you have an even workload (fixed number of FFTs/second), and 
latency

is just the time you allow for the iFFT, can be as short as 1 sample

8-)
Posting this here to prevent patents ;-) , but what do you think, do I 
make sense?


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-25 Thread gm



the same sample as before, rearranged and sequenced, transposed

sound quality and latency aside, I think the idea has some potential
https://soundcloud.com/traumlos_kalt/spectromat-test-4-01/s-7W2tR

the second part is from Nancy Sinatras Summervine

I am sorry it's all drenched in a resonant modualated delay effect,
but I think you get the idea

Am 25.10.2018 um 19:13 schrieb gm:


here an example at 22050 hz sample rate, FFT size 1024, smoothing for 
the spectral envelope 10 bins,


and simple phase realignment: when amplitude is greater than last 
frames amplitude


phase is set to original phase, otherwise to the accumulated phase of 
the time stretch


didn't expect this wo work but it seems to work

It seems to sound better to me, but still not as good as required:

https://soundcloud.com/traumlos_kalt/ft-resynth-test-3-phasealign-1-22k-01/s-KCHeV 




Am 25.10.2018 um 17:58 schrieb gm:
One thing I noticed is that it seems to sound better at 22050 Hz 
sample rate

so I assume 1024 FFT size is too small and you should use 2048.

I dont know if that is because the DC band is too high or if the bins 
are too broadband with 1024, or both?


I assume with this and some phase realingment and a better spectral 
envelope

quality would be somewhat improved.

Unfortunately Reaktor isn't the right tool at all to test these 
things, you have to hack around everything,
just changing the FFT size will probably waste a whole day, so I 
probably won't investigate this further.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-25 Thread gm



here an example at 22050 hz sample rate, FFT size 1024, smoothing for 
the spectral envelope 10 bins,


and simple phase realignment: when amplitude is greater than last frames 
amplitude


phase is set to original phase, otherwise to the accumulated phase of 
the time stretch


didn't expect this wo work but it seems to work

It seems to sound better to me, but still not as good as required:

https://soundcloud.com/traumlos_kalt/ft-resynth-test-3-phasealign-1-22k-01/s-KCHeV


Am 25.10.2018 um 17:58 schrieb gm:
One thing I noticed is that it seems to sound better at 22050 Hz 
sample rate

so I assume 1024 FFT size is too small and you should use 2048.

I dont know if that is because the DC band is too high or if the bins 
are too broadband with 1024, or both?


I assume with this and some phase realingment and a better spectral 
envelope

quality would be somewhat improved.

Unfortunately Reaktor isn't the right tool at all to test these 
things, you have to hack around everything,
just changing the FFT size will probably waste a whole day, so I 
probably won't investigate this further.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-25 Thread gm

One thing I noticed is that it seems to sound better at 22050 Hz sample rate
so I assume 1024 FFT size is too small and you should use 2048.

I dont know if that is because the DC band is too high or if the bins 
are too broadband with 1024, or both?


I assume with this and some phase realingment and a better spectral envelope
quality would be somewhat improved.

Unfortunately Reaktor isn't the right tool at all to test these things, 
you have to hack around everything,
just changing the FFT size will probably waste a whole day, so I 
probably won't investigate this further.




Am 25.10.2018 um 12:17 schrieb gm:

I made a quick test,
original first, then resynthesized with time stretch and pitch shift 
and corrected formants:


https://soundcloud.com/traumlos_kalt/ft-resynth-test-1-01/s-7GCLk
https://soundcloud.com/traumlos_kalt/ft-resynth-test-2-01/s-2OJ2H

sounds quite phasey and gurgely
I am using 1024 FFT size and 5 bins moving average to extract a
spectral envelope for formant preservation, which is probably not the 
best way to do this


I assume you would need to realign phases at transients
sound quality isn't what you would expect in 2018...
(also I am doing the pitch shift the wrong way at the moment,
first transpose in time domain, then FFT time stretch, cause that was 
easier to do for now

but this shouldn't cause an audible problem here)

about latency I dont now yet, I am using my FFT for NI Reaktor which 
has a latency of several times FFT size

and is only good for proof of concept stuff


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-25 Thread gm

I made a quick test,
original first, then resynthesized with time stretch and pitch shift and 
corrected formants:


https://soundcloud.com/traumlos_kalt/ft-resynth-test-1-01/s-7GCLk
https://soundcloud.com/traumlos_kalt/ft-resynth-test-2-01/s-2OJ2H

sounds quite phasey and gurgely
I am using 1024 FFT size and 5 bins moving average to extract a
spectral envelope for formant preservation, which is probably not the 
best way to do this


I assume you would need to realign phases at transients
sound quality isn't what you would expect in 2018...
(also I am doing the pitch shift the wrong way at the moment,
first transpose in time domain, then FFT time stretch, cause that was 
easier to do for now

but this shouldn't cause an audible problem here)

about latency I dont now yet, I am using my FFT for NI Reaktor which has 
a latency of several times FFT size

and is only good for proof of concept stuff


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-23 Thread gm




Am 24.10.2018 um 02:48 schrieb gm:

two demo tracks
https://soundcloud.com/transmortal/the-way-you-were-fake
https://soundcloud.com/traumlos-kalt/the-way-we-were-iii

they are mostly made from a snippet of Nancy Sinatras Fridays Child


I just realize in case s.o. is really interested, I have to be more precise:

bass and synthstrings that come in later on the second track are 
ordinary synths


the rest ist granular, samples snippets are from Fridays Child, Some 
Velvet Morning
and Summer Vine by Nancy Sinatra, Robots by Balanscu Quartett and a 
synth sample


I made so many demo tracks the past days, most of them were made with 
the Fridays Child sample
which has the advantage of being old school hardcore stereo, so you get 
three

different sources from the same time ...

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] OT List Reply To

2018-10-23 Thread gm
It's quite a nuisance that the lists reply to is set to the person who 
wrote the mail

and not to the list adress


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-23 Thread gm



Am 24.10.2018 um 02:24 schrieb gm:



Am 24.10.2018 um 00:46 schrieb robert bristow-johnson:


> Does anybody know a real world product that uses FFT for sound 
synthesis?

> Do you think its feasable and makes sense?

so this first question is about synthesis, not modification for 
effects, right?  and real-time, correct?  so a MIDI Note-On is 
received and you want a note coming out as quickly as possible?




yes exactly


i don't know of a hardware product that does inverse FFT for 
synthesis.  i do know of a couple of effects algorithms that go into 
products that use FFT.  i think it's mostly about doing "fast 
convolution" for purposes of reverb.


what are you intending to synthesize?  notes?  or something more wild 
than that?  just curious.




basically a sample "mangler", you load an arbitray sample, a loop of 
music for instance, and play back parts of it in real time,
time streched, pitch shifted, with formants corrected or altered, 
backwards, forwards
I dont need polyphonic playback, though that would be nice for some 
things
right now I do this with a granular "cloud", that is many overlapping 
grains, which can play polyphonic
or rather paraphonic, which means that the grains play pack at 
different pitches simultanously,

depending on the chords you play
but they all play back from the same sample position and have the same 
kind of "treatment" like envelope or filtering.


I thought you could maybe do this and some other stuff in the spectral 
domain


the idea is to change snippets / loops of existing music into new 
music, this idea is not new,

two demo tracks
https://soundcloud.com/transmortal/the-way-you-were-fake
https://soundcloud.com/traumlos-kalt/the-way-we-were-iii

they are mostly made from a snippet of Nancy Sinatras Fridays Child



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] FFT for realtime synthesis?

2018-10-23 Thread gm




Am 24.10.2018 um 02:12 schrieb gm:



Am 24.10.2018 um 00:38 schrieb David Olofson:

Simple demo song + some comments here:
https://soundcloud.com/david-olofson/eelsynth-ifft-flutesong


sounds quite nice actually


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] FFT for realtime synthesis?

2018-10-23 Thread gm




Am 23.10.2018 um 23:51 schrieb gm:
An advantage of using FFT instead of sinusoids would be that you dont 
have to worry
about partial trajectories, residual noise components and that sort of 
thing.


I think I should add that I want to use it on polyphonic material or any 
source material
so sinu oscillators are probably not the way to go cuase you would need 
too many of them

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] FFT for realtime synthesis?

2018-10-23 Thread gm

Does anybody know a real world product that uses FFT for sound synthesis?
Do you think its feasable and makes sense?

Totally unrelated to the recent discussion here I consider replacing (WS)OLA
granular "clouds" with a spectral synthesis and was wondering if I 
should use FFT for that.


I want to keep all the musical artefacts of the granular approach when 
desired
and I was thinking that you can get the "grain cloud" sound when you add 
noise to the phases/frequencies

for instance and do similar things.


An advantage of using FFT instead of sinusoids would be that you dont 
have to worry
about partial trajectories, residual noise components and that sort of 
thing.


Whether or not it would use much less CPU I am not sure, depends on how 
much overlap

of frames you have.

Disadvantages I see is latency, even more so if you want an even workload,
and that the implementation is somewhat fuzzy/messy when you do a 
timestretch followed by resampling.


Another disadvantage would be that you cant have immediate parameter changes
since everything is frame based, and even though some granularity is 
fine for me
the granularity of FFT would be fixed to the overlap/frame size, which 
is another disadvantage.


Another disadvantage I see is the temporal blur you get when you modify 
the sound.


Any thoughs on this? Experiences?



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Resampling

2018-10-06 Thread gm


You can "freeze" audio with the phase vocoder "for ever" if that ist 
what you want to do.


You just keep the magnitude of the spectrum from one point in time and 
keep it


and update the phases with the phase differences of that moment.



Am 06.10.2018 um 20:02 schrieb Alex Dashevski:

Hi,
phase vocoder doesn't have restriction of duration ?
Thanks,
Alex

b> 
You could try a phase vocoder instead of WSOLA for time
stretching. Latency would be the size of the fft block.

El sC!b., 6 oct. 2018 19:49, gm mailto:g...@voxangelica.net>> escribiC3:


right

the latency required is that you need to store the complete
wavecycle, or two of them, to compare them

(My method works a little bit different, so I only need one
wavecycle.)

So you always have this latency, regardless what sample rate
you use.

But maybe you dont need 20 Hz, for speech for instance I think
that 100 or even 150 Hz is sufficient? I dont know



Am 06.10.2018 um 19:34 schrieb Alex Dashevski:

If I understand correctly, resampling will not help. Right ?
No other technique that will help. Right ?
What do you mean "but not the duration/latency required" ?

b href="mailto:g...@voxangelica.net
<mailto:g...@voxangelica.net>"
moz-do-not-send="true">g...@voxangelica.net
<mailto:g...@voxangelica.net>b



Am 06.10.2018 um 19:07 schrieb Alex Dashevski:
> What do you mean "replay" ? duplicate buffer ?

I mean to just read the buffer for the output.
So in my example you play back 10 ms audio (windowed of
course), then
you move your read pointer and play
that audio back again, and so on, untill the next "slice"
or "grain" or
"snippet" of audio is played back.

> I have the opposite problem. My original buffer size
doesn't contain
> full cycle of the pitch.

then your pitch is too low or your buffer too small -
there is no way
around this, it's physics / causality.
You can decrease the number of samples of the buffer with
a lower sample
rate,
but not the duration/latency required.

> How can I succeed to shift pitch ?

You wrote you can have a latency of < 100ms, but 100ms
should be
sufficient for this.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
<mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Resampling

2018-10-06 Thread gm


right

the latency required is that you need to store the complete wavecycle, 
or two of them, to compare them


(My method works a little bit different, so I only need one wavecycle.)

So you always have this latency, regardless what sample rate you use.

But maybe you dont need 20 Hz, for speech for instance I think that 100 
or even 150 Hz is sufficient? I dont know




Am 06.10.2018 um 19:34 schrieb Alex Dashevski:

If I understand correctly, resampling will not help. Right ?
No other technique that will help. Right ?
What do you mean "but not the duration/latency required" ?

b> b>


Am 06.10.2018 um 19:07 schrieb Alex Dashevski:
> What do you mean "replay" ? duplicate buffer ?

I mean to just read the buffer for the output.
So in my example you play back 10 ms audio (windowed of course), then
you move your read pointer and play
that audio back again, and so on, untill the next "slice" or
"grain" or
"snippet" of audio is played back.

> I have the opposite problem. My original buffer size doesn't
contain
> full cycle of the pitch.

then your pitch is too low or your buffer too small - there is no way
around this, it's physics / causality.
You can decrease the number of samples of the buffer with a lower
sample
rate,
but not the duration/latency required.

> How can I succeed to shift pitch ?

You wrote you can have a latency of < 100ms, but 100ms should be
sufficient for this.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu 
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Resampling

2018-10-06 Thread gm




Am 06.10.2018 um 19:07 schrieb Alex Dashevski:

What do you mean "replay" ? duplicate buffer ?


I mean to just read the buffer for the output.
So in my example you play back 10 ms audio (windowed of course), then 
you move your read pointer and play
that audio back again, and so on, untill the next "slice" or "grain" or 
"snippet" of audio is played back.


I have the opposite problem. My original buffer size doesn't contain 
full cycle of the pitch.


then your pitch is too low or your buffer too small - there is no way 
around this, it's physics / causality.
You can decrease the number of samples of the buffer with a lower sample 
rate,

but not the duration/latency required.


How can I succeed to shift pitch ?


You wrote you can have a latency of < 100ms, but 100ms should be 
sufficient for this.




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Resampling

2018-10-06 Thread gm


no, you don't change the buffer size, you just change the playback rate 
(and speed, if you want) of your grains.


For instance, lets say the pitch is 20 Hz, or 50 ms time for one cycle.

You want to change that to 100 Hz.

Then you take 50 ms of audio, and replay this 5 times every 10 ms (with 
or without overlaps, but at the same speed


as the original to maintaine the formants).

Then you take the next 50 ms, and do that again.

For this, you need a buffer size of 50 ms or more.

But to compare two different wave cycles of 50 ms length to find 
similarity, you need a buffer size of 100 ms.


That is your latency required, for 20 Hz.

That is all independent of sample rate, but of course your buffer size 
in samples will be larger for a higher sample rate


and smaller for a lower sample rate. But the times of latency required 
will be the same.


Also, if you to correlation you need less values to calcuate for a lower 
sample rate.



Am 06.10.2018 um 18:27 schrieb Alex Dashevski:

I still don't understand. You change buffer size. Right ?
But I don't want to change.

b> b>

In my example, the buffer is 2 times as long as the lowest
possible pitch,
for example if your lowest pitch is 20 Hz, you need 50 ms for one
wave cycle

Think of it as magnetic tape, without sample rate, the minimum
requierd latency and the buffer length in milliesconds
are independent of sample rate
You have 100 ms "magnetic tape", search for similarity, and then
chop the tape according to that.
Then you have sippets of 50 ms length or smaller.
Then you copy these snippets and piece them together again, at a
higher or slower rate than before.
You can also shrink or lengthen the snippets and change the
formants, that ist shift all
spectral contant of one snippet up or down.




Am 06.10.2018 um 17:58 schrieb Alex Dashevski:

Hi,

I can't understand your answer.B The duration of buffer should be
bigger than duration of pitch because I use WSOLA.
The latency also depends on sample rate and buffer length.

Thanks,
Alex

b href="mailto:g...@voxangelica.net "
moz-do-not-send="true">g...@voxangelica.net
b

Your numbers don't make sense to me but probably I just dont
understand it.

The latency should be independent of the sample rate, right?

You search for similarity in the wave, chop it up, and replay
the grains at different speeds and/or rates.

What you need for this is a certain amount of time of the wave.

If you need a latency of <= 100 ms you can have two wave
cycles stored
of 50ms length / 20 Hz, which should be sufficient, given
taht voice is ususally well above 20 Hz.




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu 
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Resampling

2018-10-06 Thread gm


In my example, the buffer is 2 times as long as the lowest possible pitch,
for example if your lowest pitch is 20 Hz, you need 50 ms for one wave cycle

Think of it as magnetic tape, without sample rate, the minimum requierd 
latency and the buffer length in milliesconds

are independent of sample rate
You have 100 ms "magnetic tape", search for similarity, and then chop 
the tape according to that.

Then you have sippets of 50 ms length or smaller.
Then you copy these snippets and piece them together again, at a higher 
or slower rate than before.
You can also shrink or lengthen the snippets and change the formants, 
that ist shift all

spectral contant of one snippet up or down.




Am 06.10.2018 um 17:58 schrieb Alex Dashevski:

Hi,

I can't understand your answer.B  The duration of buffer should be 
bigger than duration of pitch because I use WSOLA.

The latency also depends on sample rate and buffer length.

Thanks,
Alex

b> b>
Your numbers don't make sense to me but probably I just dont
understand it.

The latency should be independent of the sample rate, right?

You search for similarity in the wave, chop it up, and replay the
grains at different speeds and/or rates.

What you need for this is a certain amount of time of the wave.

If you need a latency of <= 100 ms you can have two wave cycles stored
of 50ms length / 20 Hz, which should be sufficient, given taht
voice is ususally well above 20 Hz.




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Resampling

2018-10-06 Thread gm

Your numbers don't make sense to me but probably I just dont understand it.

The latency should be independent of the sample rate, right?

You search for similarity in the wave, chop it up, and replay the grains 
at different speeds and/or rates.


What you need for this is a certain amount of time of the wave.

If you need a latency of <= 100 ms you can have two wave cycles stored
of 50ms length / 20 Hz, which should be sufficient, given taht voice is 
ususally well above 20 Hz.



Am 06.10.2018 um 13:45 schrieb Alex Dashevski:
I have project with pitch shifting (resampling with wsola), It 
implements on android NDK.
Since duration of pitch is ~20ms, I can't use system recommendedB  
parameters for the fast path. for example, for my device: 
SampleRate:48Khz and buffer size 240 samples. That means, duration 
time is 5ms (< pitch duration = 20ms).
What can I do so I can use recommended parameters because it increases 
latency. For example if I use 48Khz and 240 samples then latency is 66 
ms but if buffer size is 24000 samples then latency is 300ms.

I need latency < 100ms.

Thanks,
Alex

b> 
You've got it backwards -- downsample means fewer samples. If you
have a 240-sample buffer at 48kHz, then resample to 8kHz, you'll
have 240/6=40 samples.

-Ethan


On Sat, Oct 6, 2018 at 4:10 AM, Alex Dashevski mailto:alexd...@gmail.com>> wrote:

Hi,
Let's assume that my system has sample rate = 48Khz and audio
buffer size = 240 samples. It should be on RealTime.
Can I do that:

1. Dowsampe to 8Khz and buffer size should be 240*6
2. To do proccessing on buffer 240*6 with 8Khz sample rate.
3. Upsample to 48khz with original buffer size.

Thanks,
Alex


b> 
I have only used libraries for resampling myself. I
haven't looked at their source, but it's available. The
two libraries I'm aware of are at
http://www.mega-nerd.com/SRC/download.html
and

https://kokkinizita.linuxaudio.org/linuxaudio/zita-resampler/resampler.html

perhaps they can give you some insight.

On Wed, Oct 3, 2018 at 2:46 PM Alex Dashevski
mailto:alexd...@gmail.com>> wrote:

I wrote on android ndk and there is fastpath concept.
Thus, I think that resampling can help me.
Can you recommend me code example ?
Can you give me an example of resampling ? for example
from 48Khz to 8Khz and 8Khz to 48Khz.
I found this:
https://dspguru.com/dsp/faqs/multirate/resampling/
but it is not enough clear for me,

Thanks,
Alex


b> Jacksonb> 
b>


On Wed, Oct 3, 2018 at 3:17 AM Alex Dashevski
mailto:alexd...@gmail.com>>
wrote:


if I do resampling before and after
processing. for example, 48Khz -> 8Khz and
then 8Khz -> 48Khz then will it help ?


Lowering sample rate can help achieve lower
latencies by giving you fewer samples to process
in the same amount of time but just downsampling
and then upsampling back doesn't really have any
effect.


I don't understand why I need filter, This is
to prevent alias but I can't understand why ?

Technically you only need a filter if your signal
has information above the nyquist frequency of the
lowest rate but this is not usually the case.B  I
think wikipedia explains aliasing pretty well:

https://en.wikipedia.org/wiki/Aliasing#Sampling_sinusoidal_functions
. Once the high frequency information aliases it
cannot be recovered by resampling back to the
higher rate and your lower band information is now
mixed in with the aliased information. The filter
removes this high freqency data so that the low
band stays clean through the whole process.


Is there option to decrease latency or delay ?


The only way to reduce latency in your algorithm
(unless there is some error in the implementation)
is to reduce the block size, so you process 128
samples rather than 240. 240 isn't a very large
amount of latency for a pitch shifter which is
typically a CPU intensive process and therefore
most implementations have relatively high latencies.


Re: [music-dsp] WSOLA on RealTime

2018-09-27 Thread gm


I had different solution, where the lag is reset to zero during a 
musical period.


Kind of a tape speed-up effekt without the pitch change.

Not always useful though.


Am 26.09.2018 um 23:25 schrieb Jacob Penn:

Ahh yeah I gotcha,

Yes, in the case of slow down, there Is a finite amount youb> slow down based 
on the size of the circular buffer of input data in use.

In my personal applications I offer users the ability to restart the 
stretch from the writehead at a musical value. Conveniently the 
slowest rate for this control will stop the overflow ; )


Can sound quite nice!

Best,

insignia 
JACOB PENN.MUMUKSHU
612.388.5992

On September 26, 2018 at 2:21:29 PM, robert bristow-johnson 
(r...@audioimagination.com ) wrote:





 Original Message 


Subject: Re: [music-dsp] WSOLA on RealTime
From: "Jacob Penn" mailto:penn.ja...@gmail.com>>
Date: Wed, September 26, 2018 5:00 pm
To: r...@audioimagination.com 
music-dsp@music.columbia.edu 
--

> You can indeed do it on real time audio but the tricks is like the 
previous
> email, youb>> youb>> > be lacking the necessary information to move faster across the 
buffer from

> the write head position.
>
> Youb>> speed it
> up.

no, even if you slow it down, any finite-sized buffer will eventually 
overflow.B  i presume you mean time-scaling (not pitch shifting) using 
WSOLA.


by "real-time", i mean live samples going in and (assuming no sample 
rate conversion) the same number of samples going out in a given 
period of time.B  with an upper bound of delay (and the lower bound is 
imposed by causality) and the process can run indefinitely.B  so if 
you're slowing down audio in real-time and you're running this 
process for a day.B  or for a year.



--

r b-j r...@audioimagination.com 

"Imagination is more important than knowledge."

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu 
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] wavetable filtering

2018-07-01 Thread gm



7th octave, but 127th harmonic

harmonics are not octaves but multiples of the fundamental


Am 01.07.2018 um 14:00 schrieb Martin Klang:


I'm surprised it only outputs 256 sample waveforms. Does that not mean 
that you can only go up to the 7th harmonic?




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] wavetable filtering

2018-06-29 Thread gm

You could use FFT where you can also make the waves symmetric
which prevents phase cancellations when you blend waves.


Am 29.06.2018 um 16:19 schrieb alexandre niger:


Hello everyone,

I just joined the list in order to find help in making a wavetable 
synth. This synth would do both morphing and frequency wavetables. 
Morphing is a way to play different waveforms over time and so to get 
an additional sound dimension. Frequency wavetables are used to avoid 
aliasing by filtering harmonics the higher the frequency go. I started 
with the frequency wavetables and then I will do the morphing between 
different waveforms.


As an intern at Rebel Technology, I started making wavetables patches 
from earlevel articles. In those patches, common waveforms are 
generated inside the code (tri, square, saw). Now I want to generate 
some more complex waveforms from an editor called WaveEdit (free). 
They come as 256 samples single cycle .wav files. Then I change them 
into static data in a header file. Once I have this, I can start with 
frequency wavetables. The key point of frequency wavetables is the 
filtering. I have to filter enough harmonics so the aliased 
frequencies do not come back under 18KHz (audiable range). But I must 
not filter too much if I don't want to get gain loss.


At the moment I managed to make a 3550 taps FIR to filter every octave 
wavetables. Unfortunately, with complex harmonic rich waveforms, I 
still have audiable aliasing from 2kHz and gain/amplitude difference 
when wavetables cross.

So now I am wondering:
About aliasing, should I cascade two FIR instead of increasing the taps?
That could be a solution if the stop band is not attenuated enough. 
According to octave fir1, stop band attenuation is 50dB to 70dB.
About gain loss, will "harmonic rich signal" always sound lower when 
filtered even if gain is the same?

I haven't normalize wavetables yet. I might have my answer afterwards.

You can have a look at the patch code but you won't be able to try it 
if you don't get Rebel Technology Owl files.

https://github.com/alexniger/OLWpatches-RebelTech/blob/master/WTExtWavePatch.hpp
All other links are in the readme.

Best,

Alex




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Blend two audio

2018-06-18 Thread gm



Am 19.06.2018 um 02:52 schrieb robert bristow-johnson:
 Olli Niemitalo had some ideas in that thread.  dunno if there is a 
music-dsp archive anymore or not.


This thread?
https://music.columbia.edu/pipermail/music-dsp/2011-July/thread.html#69971

old list archives are here
https://music.columbia.edu/pipermail/music-dsp/
and new archives are here
https://lists.columbia.edu/pipermail/music-dsp/
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Real-time pitch shifting?

2018-05-19 Thread gm



Am 19.05.2018 um 20:19 schrieb Nigel Redmon:
Again, my knowledge of Melodyne is limited (to seeing a demo years 
ago), but I assume it’s based on somewhat similar techniques to those 
taught by Xavier Serra (https://youtu.be/M4GRBJJMecY)—anyone know for 
sure?


I always thought the seperation of notes was based on cepstrum?
My idea is that a harmonic tone, comb like in the spectrum, is a peak in 
the cepstrum. (isn't it?)

Probably then you can also track pitch by following a peak in the cepstrum.
Not sure if this makes sense?
I never tried Melodyne in person so I am not sure what it is capable of.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] (Novel?) "Modal Phase Rotation Synthesis"

2018-04-03 Thread gm


After looking at it I think probably you can but you need trig 
calculations every sample
when you change the frequency and quite some additional calculations for 
the WGR every sample

in this case.
So its cheaper to use a standard oscillator with a sine aproximation for 
phase mod.  in both cases.


The MCF seems lighter on CPU then what I do if you insist that the rotation
must be on a perfect circle instead of the parapolic shape,
but I think when used as an oscillator it has issues
with frequency accuracy or amplitude rescaling or something similar?

And it appears not to rotate on a perfect circle internally either
but just from looking at the paper I can't tell if and how that matters.

I remember years ago I investigated both for use as an undamped 
oscillator and
came to the conclusion that a fast sine approximation is superior for 
phase modulation.

But I dont recall the details.

The sine approximation I use only needs 4 multiplies so I am not sure
if I am on the right path using filters.

There seems to be an advantage with voice stealing though, the click
you get is masked and blurred by the filters response


Am 03.04.2018 um 14:37 schrieb Corey K:
Yes, I think you can do phase modulation with those filters. They are 
referred to colloquially as "phasor filters", because their phase is 
manipulated in order to rotate a vector around the complex plane...


On Tue, Apr 3, 2018 at 8:16 AM, gm <g...@voxangelica.net 
<mailto:g...@voxangelica.net>> wrote:



Yes it's related, I dont recall if I used one of these filters
in my first implementation which was several years ago.
I used a complex filter before I used the SVF and AP.

But I think you can't do full phase modulation with such filters?
I think that was my motivation to apply the rotation outside of
the filter.

Either way it seems lighter on cpu when you use the external
rotation with
parabolas instead of trig operations since you dont have to constantly
adapt the internal state of the filter.

A drawback of the method in general with either filter is that
you can cancel the internal state with an impulse.

I havent figured out what the best excitation signal is.

The paper you linked suggests to delay the impulse until a zero
crossing
but that is not an option in my use cases.


Am 03.04.2018 um 01:46 schrieb Corey K:

Your idea seems to bear a few similarities to this (just in case
you haven't seen it already):
https://ccrma.stanford.edu/~jos/smac03maxjos/
<https://ccrma.stanford.edu/%7Ejos/smac03maxjos/>



On Mon, Apr 2, 2018 at 2:46 PM, gm <g...@voxangelica.net
<mailto:g...@voxangelica.net>> wrote:


I don't know if this idea is new, I had it for some time but
have never seen it mentioned anywhere:

Use a filter with high q and rotate it's (complex) output by
the (real) output
of another filter to obtain a phase modulated sine wave.
Excite with an impulse or impact signal.

It's basically crossed between modal and phase modulation
synthesis.

Now there are some ideas to this to make it practical and a
useful substitute for phase modulation and FM:

You can use a state variable filter with an additional
allpass instead of
the complex filter to obtain a filter you can pitch modulate
in audio
(useful for drum synthesis ect) (or maybe the 90 shift can be
designed more efficiently
into the SVF IDK.)

Instead of expensive trig calculations for the rotation, or using
the normalized complex signal form the other filter (also
expensive)
just use a very coarse parabolic sine/cosine approximation
and the real signal,
the difference is really very small sonically, since the
modulator is still sine
and the radius stays around 1 so it's the effect of a small
amplitude modulation on the modulator
caused by the slight deviation of the circle.
I couldnt tell the difference when I tested it first.

You need 7 mults and 4 adds in addition to the SVF for the AP
and rotation per carrier.

But you save an envelope for each operator and have a pretty
efficient sine operator with the SVF.
And you get all the benfits of phase modulation over
frequency modulation of the
filter cutoff.
It's very useful for drum synthesis but also useful for some
other percussive sounds like "FM" pianos etc.

Here is an audio demo, with cheap "soundboard" and some other
fx added:
https://soundcloud.com/traumlos_kalt/smoke-piano-test-1-01/s-W54wz
<https://soundcloud.com/traumlos_kalt/smoke-piano-test-1-01/s-W54wz>

I wonder if this idea is new?

___

Re: [music-dsp] (Novel?) "Modal Phase Rotation Synthesis"

2018-04-03 Thread gm


Yes it's related, I dont recall if I used one of these filters
in my first implementation which was several years ago.
I used a complex filter before I used the SVF and AP.

But I think you can't do full phase modulation with such filters?
I think that was my motivation to apply the rotation outside of the filter.

Either way it seems lighter on cpu when you use the external rotation with
parabolas instead of trig operations since you dont have to constantly
adapt the internal state of the filter.

A drawback of the method in general with either filter is that
you can cancel the internal state with an impulse.

I havent figured out what the best excitation signal is.

The paper you linked suggests to delay the impulse until a zero crossing
but that is not an option in my use cases.


Am 03.04.2018 um 01:46 schrieb Corey K:
Your idea seems to bear a few similarities to this (just in case you 
haven't seen it already):
https://ccrma.stanford.edu/~jos/smac03maxjos/ 
<https://ccrma.stanford.edu/%7Ejos/smac03maxjos/>




On Mon, Apr 2, 2018 at 2:46 PM, gm <g...@voxangelica.net 
<mailto:g...@voxangelica.net>> wrote:



I don't know if this idea is new, I had it for some time but have
never seen it mentioned anywhere:

Use a filter with high q and rotate it's (complex) output by the
(real) output
of another filter to obtain a phase modulated sine wave.
Excite with an impulse or impact signal.

It's basically crossed between modal and phase modulation synthesis.

Now there are some ideas to this to make it practical and a useful
substitute for phase modulation and FM:

You can use a state variable filter with an additional allpass
instead of
the complex filter to obtain a filter you can pitch modulate in audio
(useful for drum synthesis ect) (or maybe the 90 shift can be
designed more efficiently
into the SVF IDK.)

Instead of expensive trig calculations for the rotation, or using
the normalized complex signal form the other filter (also expensive)
just use a very coarse parabolic sine/cosine approximation and the
real signal,
the difference is really very small sonically, since the modulator
is still sine
and the radius stays around 1 so it's the effect of a small
amplitude modulation on the modulator
caused by the slight deviation of the circle.
I couldnt tell the difference when I tested it first.

You need 7 mults and 4 adds in addition to the SVF for the AP and
rotation per carrier.

But you save an envelope for each operator and have a pretty
efficient sine operator with the SVF.
And you get all the benfits of phase modulation over frequency
modulation of the
filter cutoff.
It's very useful for drum synthesis but also useful for some other
percussive sounds like "FM" pianos etc.

Here is an audio demo, with cheap "soundboard" and some other fx
added:
https://soundcloud.com/traumlos_kalt/smoke-piano-test-1-01/s-W54wz
<https://soundcloud.com/traumlos_kalt/smoke-piano-test-1-01/s-W54wz>

I wonder if this idea is new?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp
<https://lists.columbia.edu/mailman/listinfo/music-dsp>




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] (Novel?) "Modal Phase Rotation Synthesis"

2018-04-02 Thread gm


I don't know if this idea is new, I had it for some time but have never 
seen it mentioned anywhere:


Use a filter with high q and rotate it's (complex) output by the (real) 
output

of another filter to obtain a phase modulated sine wave.
Excite with an impulse or impact signal.

It's basically crossed between modal and phase modulation synthesis.

Now there are some ideas to this to make it practical and a useful 
substitute for phase modulation and FM:


You can use a state variable filter with an additional allpass instead of
the complex filter to obtain a filter you can pitch modulate in audio
(useful for drum synthesis ect) (or maybe the 90 shift can be designed 
more efficiently

into the SVF IDK.)

Instead of expensive trig calculations for the rotation, or using
the normalized complex signal form the other filter (also expensive)
just use a very coarse parabolic sine/cosine approximation and the real 
signal,
the difference is really very small sonically, since the modulator is 
still sine
and the radius stays around 1 so it's the effect of a small amplitude 
modulation on the modulator

caused by the slight deviation of the circle.
I couldnt tell the difference when I tested it first.

You need 7 mults and 4 adds in addition to the SVF for the AP and 
rotation per carrier.


But you save an envelope for each operator and have a pretty efficient 
sine operator with the SVF.
And you get all the benfits of phase modulation over frequency 
modulation of the

filter cutoff.
It's very useful for drum synthesis but also useful for some other 
percussive sounds like "FM" pianos etc.


Here is an audio demo, with cheap "soundboard" and some other fx added:
https://soundcloud.com/traumlos_kalt/smoke-piano-test-1-01/s-W54wz

I wonder if this idea is new?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] bandsplitting strategies (frequencies) ?

2018-03-27 Thread gm



Am 27.03.2018 um 19:29 schrieb David Reaves:

If what you do involves material with an unusual spectral balance, and/or if 
you use aggressive filter roll offs and/or you use something other than RMS 
detection, then my assumptions may not be useful.



that is understood.
there are not many assumptions I can make so I think pink noise is the 
best match


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] bandsplitting strategies (frequencies) ?

2018-03-27 Thread gm


This actually explains a few misconceptions I had in the past..
Both slopes are filed under "natural spectrum" in my mind.


Am 27.03.2018 um 19:16 schrieb robert bristow-johnson:>


> I believe thats equal energy on a -6dB/octave spectrum and gives figures
> very close

no, that's -3 dB/oct.

pink noise is equal energy per octave and is -3 dB drop every octave.




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] bandsplitting strategies (frequencies) ?

2018-03-27 Thread gm


i keep dividing into equal bands on a log2 scale,

I believe thats equal energy on a -6dB/octave spectrum and gives figures 
very close


to what David Reaves suggested the other day for 4 bands when you set 
6300 Hz as the upper limit


and 150 Hz corner frequency for the bass band (or 45 Hz for the lower limit)



Am 27.03.2018 um 11:36 schrieb Theo Verelst:

gm wrote:

What are good frequencies for band splits? (2-5 bands)


For standard mastering applications there are norms for binoral and 
Equal Loudness Curve related reasons. The well known PC software 
probably doesn't get there but it may be you want to tune those 
frequencies based on the following criteria:


  - type of filter (FIR/IIR/FFT, resonant or not, congruent with 
standard linear
    (analogue) filter constructions or not) and the associated impulse 
response length

  - the properties of the filter impulse and combinations during standard
    signal reconstruction (at the DAC) or up/down sampling
  - energy distribution for white/pink noise or standard signals for your
    specific application
  - the function of the application in terms of being somewhere on the 
line of
    a High Fidelity slight clipping prevention, over a radio mastering 
with significant
    compression, or a wild tool where the use is as a very significant 
signal alteration

    tool


Theo V.


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] bandsplitting strategies (frequencies) ?

2018-03-23 Thread gm
For equally spaced bands you could do it with 2 parameters, one to shift 
the middle or base frequency

and one spread or fan parameter that spreads or narrows the bands.

The reason I don't want this, is that I don't want too many parameters
and the user doesn't know how to set the bands either, especially since
the difference is probably not obvious, sonically.

But it's an option I am considering.



Am 23.03.2018 um 16:50 schrieb Matt Jackson:

If it’s a distortion or compression and only 2-4 bands, a user set crossover(s) 
would usually be desirable.
The Ableton Multi-band Dynamics, Waves C4, Ohm Force Ohmacide, Izotope plugins, 
Surreal Machines Transient Machines all come to mind.
It probably depends on the complexity you are looking for but some presets for 
“voice”, "full mix”, “drums” etc. usually go a long way.


On 23. Mar 2018, at 15:05, gm <g...@voxangelica.net> wrote:


The purpose is multiband compression and distortion.

So I only have a few bands, 2 to 5.

I use ERB scale in my vocoder, which worked slightly better than Bark scale for 
me (it seems better defined at the low range)

I was wondering if I should use it here too or if it's better on a log2 scale.

Also I cant decide what upper and lower frequency I should use when I divide 
evenly on a log scale.

I chose 100 Hz cause thats the lowest Bark band I think.


Am 23.03.2018 um 14:39 schrieb Matt Jackson:

Gabriel,

I think it depends on what you are trying to do. What’s your context?

For example a Vocoder (for voice) might have a different distribution of bands 
(bark scale) than a multipurpose graphic EQ (even octaves).
One strange example I know of is the Serge resonant EQ (not crossovers but 
fixed frequency resonant peaks) has deliberately picked frequencies that, 
“except for the top and bottom frequency bands, the bands are spaced at an 
interval of a major seventh. The Resonant Equalizer is designed to produce 
formant peaks and valleys similar to those in acoustic instruments.”

Matt


On 23. Mar 2018, at 13:05, robert bristow-johnson <r...@audioimagination.com> 
wrote:

On 3/23/18 12:01 AM, gm wrote:

What are good frequencies for band splits? (2-5 bands)

What I am doing is divide the range between 100 Hz 5-10 kHz
into equal bands on a log scale (log2 or pitch).

Are there better strategies?
Or better min/max frequencies?
How is it usually done?

conventionally, a graphic EQ might be split into bands with log center 
frequencies every octave, for a 10 band, or every 1/3 octave for a 31 band EQ.

i think the 10-octave frequencies might be at

25, 50, 100, 200, 400, 800, 1600, 3200, 6400, 12800 Hz

with the bandedges at the geometric mean of adjacent pair of frequencies

but they might put them conventionally at

20, 50, 100, 200, 500, 1000, 2000, 5000, 1, 2 Hz

you can see there's a bigger-than-octave gap between 200 and 500.

maybe the 31-band 1/3 octave frequencies might conventionally be at

20, 25, 32, 40, 50, 63, 80, 100, 125, 160, 200, 250, 320, 400, 500, 630, 800, 
1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6300, 8000, 1, 12500, 
16000, 2 Hz

those are conventional frequencies. not all spacing are exactly 1/3 octave.  
you can see that 630 is a compromise between twice 320 and half of 1250.  you 
might want your bands split precisely in 1/3 octaves spaced apart by a 
frequency ratio of 2^(1/3) which is about 1.26.  that might have bands labeled:

20, 25, 32, 40, 50, 63, 80, 100, 126, 159, 200, 252, 318, 400, 504, 635, 800, 
1007, 1271, 1600, 2014, 2542, 3200, 4028, 5084, 6400, 8056, 10168, 12800, 
16112, 20336 Hz


--

r b-j  r...@audioimagination.com

"Imagination is more important than knowledge."



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] bandsplitting strategies (frequencies) ?

2018-03-23 Thread gm


The purpose is multiband compression and distortion.

So I only have a few bands, 2 to 5.

I use ERB scale in my vocoder, which worked slightly better than Bark 
scale for me (it seems better defined at the low range)


I was wondering if I should use it here too or if it's better on a log2 
scale.


Also I cant decide what upper and lower frequency I should use when I 
divide evenly on a log scale.


I chose 100 Hz cause thats the lowest Bark band I think.


Am 23.03.2018 um 14:39 schrieb Matt Jackson:

Gabriel,

I think it depends on what you are trying to do. What’s your context?

For example a Vocoder (for voice) might have a different distribution of bands 
(bark scale) than a multipurpose graphic EQ (even octaves).
One strange example I know of is the Serge resonant EQ (not crossovers but 
fixed frequency resonant peaks) has deliberately picked frequencies that, 
“except for the top and bottom frequency bands, the bands are spaced at an 
interval of a major seventh. The Resonant Equalizer is designed to produce 
formant peaks and valleys similar to those in acoustic instruments.”

Matt


On 23. Mar 2018, at 13:05, robert bristow-johnson <r...@audioimagination.com> 
wrote:

On 3/23/18 12:01 AM, gm wrote:

What are good frequencies for band splits? (2-5 bands)

What I am doing is divide the range between 100 Hz 5-10 kHz
into equal bands on a log scale (log2 or pitch).

Are there better strategies?
Or better min/max frequencies?
How is it usually done?

conventionally, a graphic EQ might be split into bands with log center 
frequencies every octave, for a 10 band, or every 1/3 octave for a 31 band EQ.

i think the 10-octave frequencies might be at

25, 50, 100, 200, 400, 800, 1600, 3200, 6400, 12800 Hz

with the bandedges at the geometric mean of adjacent pair of frequencies

but they might put them conventionally at

20, 50, 100, 200, 500, 1000, 2000, 5000, 1, 2 Hz

you can see there's a bigger-than-octave gap between 200 and 500.

maybe the 31-band 1/3 octave frequencies might conventionally be at

20, 25, 32, 40, 50, 63, 80, 100, 125, 160, 200, 250, 320, 400, 500, 630, 800, 
1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6300, 8000, 1, 12500, 
16000, 2 Hz

those are conventional frequencies. not all spacing are exactly 1/3 octave.  
you can see that 630 is a compromise between twice 320 and half of 1250.  you 
might want your bands split precisely in 1/3 octaves spaced apart by a 
frequency ratio of 2^(1/3) which is about 1.26.  that might have bands labeled:

20, 25, 32, 40, 50, 63, 80, 100, 126, 159, 200, 252, 318, 400, 504, 635, 800, 
1007, 1271, 1600, 2014, 2542, 3200, 4028, 5084, 6400, 8056, 10168, 12800, 
16112, 20336 Hz


--

r b-j  r...@audioimagination.com

"Imagination is more important than knowledge."



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

[music-dsp] bandsplitting strategies (frequencies) ?

2018-03-23 Thread gm

What are good frequencies for band splits? (2-5 bands)

What I am doing is divide the range between 100 Hz 5-10 kHz
into equal bands on a log scale (log2 or pitch).

Are there better strategies?
Or better min/max frequencies?
How is it usually done?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] parametric string synthesis

2018-03-14 Thread gm
There actually is some randomness and noise in the onset, as well as 
some subharmonic amplitude modulation.


The onset doesn't sound very convincing though, thats why I would like 
to use wavetables and pitch data from samples.


In the end I would like be able to emphasize and exaggerate such effects 
that make a string sound sound natural...



Am 14.03.2018 um 17:07 schrieb Esteban Maestre:

Nice demos!

In

http://ieeexplore.ieee.org/document/7849104/

we point to a multi-modal string quartet multi-modal (audio, contact 
mics, mocap, video, etc)
dataset we recorded some time ago. I believe it's also listed in the 
MTG-UPF website.


As for your excitation signal, perhaps some temporary "chaos" in your
oscillator synchronization method might help with the attacks.

Cheers,

Esteban



On 3/14/2018 1:45 PM, gm wrote:

I made a little demo for parametric string synthesis I am working on:

https://soundcloud.com/traumlos_kalt/parametric-strings-test/s-VeiPk

It's a morphing oscillator made from basic "virtual analog" 
oscillator components
(with oscillator synch) to mimic the bow & string "Helmholtz" 
waveform, fed into a simplified body filter.


The body is from a cello and morphed in size for viola, cello and 
bass timbres

(I know that's not accurate).
It's made from a very sparse stereo FIR filter (32 taps).
It doesn't sound like the real instrument body response, but the 
effect still sounds somewhat physcial to me.


The idea is to replace the VA "Helmholtz" oscillator with a wavetable 
oscillator (with synch?)
which is controlled by paramterized playing styles, to be more 
flexible and more natural behaving

than sample libraries.
And a better body filter.

The advantage over waveguide modeling with a bow model would be that 
you don't have to
play the bow with accurate pressure and velocity, and that it is more 
cpu friendly
and more flexible in regards to more artificial timbres and timbre 
morphing.


So far it's a private hobby project in Reaktor 5, but it maybe has 
some potential I believe.
Doesn't sound like samples yet but maybe it will when the model is 
improved...


At least it can provide an instrument with a hybrid sound between 
virtual analog and physical
which is something I love to use in my music. I used the body filter 
with synths quite often.


So far the "Helmholtz" waveform is made from assumptions like that 
that it behaves like
a synched oscillator depending on the ratio between the two sides of 
the string,

which might not be true.

Why I am posting this:
Maybe someone here plays an electric solid body violin or something 
similar and can provide
samples of bow & string waveforms with different playing styles and 
notes for analysis?

And has an interest to join efforts to create this instrument?
Or maybe someone even knows of a source for such waveforms?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp





___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



[music-dsp] parametric string synthesis

2018-03-14 Thread gm

I made a little demo for parametric string synthesis I am working on:

https://soundcloud.com/traumlos_kalt/parametric-strings-test/s-VeiPk

It's a morphing oscillator made from basic "virtual analog" oscillator 
components
(with oscillator synch) to mimic the bow & string "Helmholtz" waveform, 
fed into a simplified body filter.


The body is from a cello and morphed in size for viola, cello and bass 
timbres

(I know that's not accurate).
It's made from a very sparse stereo FIR filter (32 taps).
It doesn't sound like the real instrument body response, but the effect 
still sounds somewhat physcial to me.


The idea is to replace the VA "Helmholtz" oscillator with a wavetable 
oscillator (with synch?)
which is controlled by paramterized playing styles, to be more flexible 
and more natural behaving

than sample libraries.
And a better body filter.

The advantage over waveguide modeling with a bow model would be that you 
don't have to
play the bow with accurate pressure and velocity, and that it is more 
cpu friendly

and more flexible in regards to more artificial timbres and timbre morphing.

So far it's a private hobby project in Reaktor 5, but it maybe has some 
potential I believe.
Doesn't sound like samples yet but maybe it will when the model is 
improved...


At least it can provide an instrument with a hybrid sound between 
virtual analog and physical
which is something I love to use in my music. I used the body filter 
with synths quite often.


So far the "Helmholtz" waveform is made from assumptions like that that 
it behaves like
a synched oscillator depending on the ratio between the two sides of the 
string,

which might not be true.

Why I am posting this:
Maybe someone here plays an electric solid body violin or something 
similar and can provide
samples of bow & string waveforms with different playing styles and 
notes for analysis?

And has an interest to join efforts to create this instrument?
Or maybe someone even knows of a source for such waveforms?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Wavetable File Formats?

2018-03-14 Thread gm

Good idea with the random phase

We did pseudo PWM with two identical arbitrary waves, one inverted, but 
not what you describe with random phase




Am 14.03.2018 um 13:06 schrieb Frank Sheeran:

> Another disadvantage was that you get a noticable chirp transient when
> the phases realign after one complete cycle of the wavetable.

Just put them in the buffer with random phases and they'll never 
re-align.  That's not what a piano does of course, but might be 
servicable.


BTW, my synth does PW/PWM with two out-of-phase sawtooths, one 
negative.  When I make the harmonics of one of the sawtooths random, 
you get something that sounds like PWM except it never comes to a 
"peak", it just grinds away.


I haven't heard that on any other synth but would love to know if 
anyone knows prior art.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Wavetable File Formats?

2018-03-14 Thread gm



Am 14.03.2018 um 12:00 schrieb robert bristow-johnson:



> Some years ago I tried to make a "stretched partials" sawtooth this way
> and found that the tables get prohibitively large

the *number* of wavetables gets large, right?  is that what you mean?



yes, bad wording


it doesn't have anything to do with the size of the wavetable.

with gigabytes of memory and 64-bit addressing space, i am not sure 
what is "prohibitive".  a regular sampled note can easily take up 1/2 
meg.  how many 2048-point wavetables can you fit into that space? or 
in a meg?  or 4 meg?




true, but personally I am not a fan of synths that take up much memory 
and that was

one of the reasons it wasn't implemented in the final product


> which also makes their detuning relationships unnatural compared to
> for instance a piano tone.

more unnatural than flat?



Thats a matter of taste in the end, at least I was a little bit 
dissapointed with the results of my experiments



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Wavetable File Formats?

2018-03-14 Thread gm


Another disadvantage was that you get a noticable chirp transient when 
the phases

realign after one complete cycle of the wavetable.
You don't have this in a piano since the phases never realign again 
after the initial strike

so you have the transient only at the onset of the note.


Am 14.03.2018 um 11:39 schrieb gm:

Some years ago I tried to make a "stretched partials" sawtooth this way
and found that the tables get prohibitively large
since you are restricted to common devisors or integer multiples for 
the "spin cycles"

and phase steps of the partials.

The second lowest partial needs to make at least one spin cycle, and
all higher partials need to make an integer multiple of that
which also makes their detuning relationships unnatural compared to
for instance a piano tone.







___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Wavetable File Formats?

2018-03-14 Thread gm

Some years ago I tried to make a "stretched partials" sawtooth this way
and found that the tables get prohibitively large
since you are restricted to common devisors or integer multiples for the 
"spin cycles"

and phase steps of the partials.

The second lowest partial needs to make at least one spin cycle, and
all higher partials need to make an integer multiple of that
which also makes their detuning relationships unnatural compared to
for instance a piano tone.





___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Clock drift and compensation

2018-03-09 Thread gm
The problem I see is that your sine wave needs to have a precise 
amplitude for the arcsine.

I don't understand your application so I don't know if this is the case.


Am 09.03.2018 um 19:58 schrieb Benny Alexandar:

Hi GM,
Instead of finding Hilbert transform, I tried with just finding the 
angle between samples

of a fixed frequency sine wave.
I tried to create a sine wave of  frequency x[n] = sin ( 2 * pi * 1/4 
* n), and tried calculating the angle between samples,
it should be 90 degree. This also can be used to detect any 
discontinuity in the signal.

Below is the octave code which I tried.

One cycle of sine wave consists of 4 samples, two +ve and two -ve.

% generate the sine wave of frequency 1/4
for i = 1 : 20
   x(i) = sin( 2 * pi * ( 1 / 4) * i);
end

% find the angle between samples in degrees.
 for i = 1:20
    ang(i)  =  asin( x(i) ) * (180 / pi);
 end

% find the absolute difference between angles
for i = 1:20
 diff(i) =  abs( ang( i + 1 ) - ang( i ));
end

% check for discontinuity
for i = 1:20
if (diff(i) != 90)
  disp("discontinuity")
endif
end


Please verify this logic is correct for discontinuity check.

-ben




*From:* music-dsp-boun...@music.columbia.edu 
<music-dsp-boun...@music.columbia.edu> on behalf of gm 
<g...@voxangelica.net>

*Sent:* Monday, January 29, 2018 1:29 AM
*To:* music-dsp@music.columbia.edu
*Subject:* Re: [music-dsp] Clock drift and compensation

diff gives you the phase step per sample,
basically the frequency.

However the phase will jump back to zero periodically when the phase 
exceeds 360°

(when it wraps around) in this case diff will get you a wrong result.

So you need to "unwrap" the phase or the phase difference, for example:


diff = phase_new - phase_old
if phase_old > Pi and phase_new < Pi then diff += 2Pi

or similar.


Am 28.01.2018 um 17:19 schrieb Benny Alexandar:

Hi GM,

>> HT -> Atan2 -> differenciate -> unwrap
Could you please explain how to find the drift using HT,

HT -> gives real(I) & imaginary (Q) components of real signal
Atan2 -> the phase of an I Q signal
diff-> gives what ?
unwrap ?

-ben



*From:* music-dsp-boun...@music.columbia.edu 
<mailto:music-dsp-boun...@music.columbia.edu> 
<music-dsp-boun...@music.columbia.edu> 
<mailto:music-dsp-boun...@music.columbia.edu> on behalf of gm 
<g...@voxangelica.net> <mailto:g...@voxangelica.net>

*Sent:* Saturday, January 27, 2018 5:20 PM
*To:* music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
*Subject:* Re: [music-dsp] Clock drift and compensation

I don't understand your project at all so not sure if this is helpful,
probably not,
but you can calculate the drift or instantanous frequency of a sine wave
on a per sample basis
using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu <mailto:music-dsp@music.columbia.edu>
https://lists.columbia.edu/mailman/listinfo/music-dsp





___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Elliptic filters coefficients

2018-02-04 Thread gm

I don't have a paper about this
and I don't see how you could get the SNR from it.

For frequency detection

(prefilter) -> HilbertTransform -> atan2  gives you the phase

differenciate and unwrap gives you the angular frequency:

diff = phase_new - phase_old
if phase_old > Pi and phase_new < Pi then diff += 2Pi

and F Hz = diff * SR

This estimate is not perfect and has some modulation since the filter is 
not perfect and so
the Hilbert Transform includes more than the lowest partial and atan2 is 
the sum of all  (I think).


A better estimate is to only measure the time between wraparounds of the 
phase:


The sub-sample time of the wraparound (the time that is passed when its 
detected) is

(phase_value_after_wrap_round / angular_frequency ) * 1/SR

I basically start a counter with 1/SR at every phase wrap around and
subtract the sub-sample time, and 1/T for F when the cycle is completed.
So this gives you an estimate once per cycle, which is more or less in synch
with the original waveform.

If you need more than one estimate per cycle you can add an offset to 
the phase,
and wrap it, and run counters in parallel, or use the angular frequency 
per sample

directly.

I just realized I also have a static prefilter to precondition the 
signal and a minimum frequency for the dynamic filters

if I remember correctly this was to avoid that the system tends to
fall down to dc when there is no signal - your idea to add some noise 
and to change the Q

of the bandpass might alos improve things




Am 04.02.2018 um 01:45 schrieb Dario Sanfilippo:

Hi, GM.

On 3 February 2018 at 18:39, gm <g...@voxangelica.net 
<mailto:g...@voxangelica.net>> wrote:






If your goal is to isolate the lowest partial, why dont you use
the measured frequency to steer a lowpass or lowpass/bandpass filter?

​I'm already piloting a lowpass in my current algorithm but I was 
thinking to use a bandpass too, also for another algorithm which 
detects the loudest partial. I haven't properly thought of that but a 
first idea was to have the Q of the BP inversely proportional to the 
derivative of the output of the integrator: that way, when the 
integrator is not changing we are around the detected partial and we 
can then select even further by increasing the Q. Though, I should 
also think of a way to "release" the Q when the input signal changes 
or the system might enter an attractor.


Currently, in the algorithm that I described earlier, there is a very 
tiny amount of energy added to the high spectrum of the crossover; 
tiny enough to be negligible for the measurement, but big enough to 
move the cutoff up when there is no energy in the crossover's input. 
So if I have a detected lowest at 1k plus a bunch of partials at 10k 
and higher, if I remover the 1k partial the system will move to 10k.



For my time domain estimator I use

4th order Lowpass, 2nd order BP -> HilbertTransform ->
Phasedifferenz -> Frequency
 
|cutoff|

​I'm not familiar with the technique which uses the HT and the phase 
difference to calculate the frequency. I'd be very grateful if you 
could say a few words about that.​ Can you also control the 
SNR/sensitivy in your system?



This gives you an estimate (or rather measurement) per sample.

A further improvement is to calculate the sub-sample time between
phase wraparounds,
this basically elimates any spurios modulations from the phase
within a cycle,
simlar to an integrator.

You can have several measurements per cycle again by adding angle
offsets to the phase and calculating the time between wraprounds
of the new angles as well.

I use SVFs for the filters with Q set to a Butterworth response
for the LPs
and Q=2 for the Bandpass.

I dont know if this method has less overhead than yor method
because you need the Hilbert Transform, but the prefiltering is
more efficient

Depending on your input sorces you can try to exchange the HT with
a single allpass with adaptive corner frequency

​
All great ideas, thanks a lot for sharing. Have you published any 
paper on this or other time-domain algorithms for feature-extration? 
The reason why I implemented that algorithm is that it will probably 
be used in a time-domain noisiness estimator which I'm working on and 
that I will perhaps share here if it gets somewhere.


Cheers,
Dario


Am 03.02.2018 um 14:49 schrieb Dario Sanfilippo:

Thanks for the links, Steven!

Vadim, what is the title of your book? We may have it here at uni.

Hi, Robert. I'm working on some time-domain feature-extraction
algorithms based on adaptive mechanisms. A couple of years ago, I
implemented a spectral tendency estimator where the cutoff of a
crossover (1p1z filters) is piloted by the RMS imbalance of the
two spectra coming out of the same crossover

Re: [music-dsp] Elliptic filters coefficients

2018-02-03 Thread gm


If your goal is to isolate the lowest partial, why dont you use the 
measured frequency to steer a lowpass or lowpass/bandpass filter?


For my time domain estimator I use

4th order Lowpass, 2nd order BP -> HilbertTransform -> Phasedifferenz -> 
Frequency

 |cutoff|


This gives you an estimate (or rather measurement) per sample.

A further improvement is to calculate the sub-sample time between phase 
wraparounds,
this basically elimates any spurios modulations from the phase within a 
cycle,

simlar to an integrator.

You can have several measurements per cycle again by adding angle 
offsets to the phase and calculating the time between wraprounds of the 
new angles as well.


I use SVFs for the filters with Q set to a Butterworth response for the LPs
and Q=2 for the Bandpass.

I dont know if this method has less overhead than yor method
because you need the Hilbert Transform, but the prefiltering is more 
efficient


Depending on your input sorces you can try to exchange the HT with a 
single allpass with adaptive corner frequency



Am 03.02.2018 um 14:49 schrieb Dario Sanfilippo:

Thanks for the links, Steven!

Vadim, what is the title of your book? We may have it here at uni.

Hi, Robert. I'm working on some time-domain feature-extraction 
algorithms based on adaptive mechanisms. A couple of years ago, I 
implemented a spectral tendency estimator where the cutoff of a 
crossover (1p1z filters) is piloted by the RMS imbalance of the two 
spectra coming out of the same crossover. Essentially, a negative 
feedback loop for the imbalance pushes the cutoff towards the 
predominant spectrum until there's a "dynamical equilibrium" point 
which is the estimated tendency.


A recent extension to that algorithm was to add a lowpass filter 
within the loop, at the top of the chain, as shown in this diagram: 
https://www.dropbox.com/s/a1dtk0ri64acssc/lowest%20partial.jpg?dl=0. 
(Some parts necessary to avoid the algorithm from entering attractors 
have been omitted.)


If the same spectral imbalance also pilots the cutoff of the lowpass 
filter, we have a nested positive (the lowpass strengthens the 
imbalance which pushes the cutoff towards the same direction) and 
negative (the crossover's dynamical equilibrium point) feedback loop. 
So it is a recursive function which removes partials from top to 
bottom until there is nothing left to remove except the lowest partial 
in the spectrum.


The order and type of the lowpass (I've tried 1p1z ones, cascading up 
to four of them), I believe, is what determines the SNR in the system, 
so what the minimum amplitude of the bottom partial should be to be 
considered signal or not. Large transition bands in the lowpass will 
affect the result as the top partials which are not fully attenuated 
will affect the equilibrium point. Since elliptic filters have narrow 
transition bands at low orders, I thought that they could have given 
more accurate results, although the ripples in the passing band would 
also affect the SNR of the system.


Perhaps using Butterworth filters could be best as the flat passing 
band could make it easier to model a "threshold/sensitivity" 
parameter. With that regard, I should also have a look at fractional 
order filters. (I've quickly tried by linearly interpolating between 
filters of different orders but I doubt that that's the precise way to 
go.)


Of course, an FFT algorithm would perhaps be easier to model, though 
this time-domain one should be CPU-less-expensive, not limited to the 
bin resolution, and would provide a continuous estimation not limited 
to the FFT period.


I've tested the algorithm and it seems to have a convincing behaviour 
for most test signals, though it is not too accurate in some specific 
cases.


Any comment on how to possibly improve that is welcome.

Thanks,
Dario


Dario Sanfilippo - Research, Teaching and Performance
Reid School of Music, Edinburgh University
+447492094358
http://twitter.com/dariosanfilippo
http://dariosanfilippo.tumblr.com

On 3 February 2018 at 08:01, robert bristow-johnson 
> wrote:


i'm sorta curious as to what a musical application is for
elliptical filters that cannot be better done with butterworth or,
perhaps, type 2 tchebyshev filters?  the latter two are a bit
easier to derive closed-form solutions for the coefficients.

whatever.  (but i am curious.)

--

r b-j r...@audioimagination.com 

"Imagination is more important than knowledge."

 Original Message

Subject: Re: [music-dsp] Elliptic filters coefficients
From: "Dario Sanfilippo" >
Date: Fri, February 2, 2018 6:37 am
To: music-dsp@music.columbia.edu 

Re: [music-dsp] Clock drift and compensation

2018-01-28 Thread gm

diff gives you the phase step per sample,
basically the frequency.

However the phase will jump back to zero periodically when the phase 
exceeds 360°

(when it wraps around) in this case diff will get you a wrong result.

So you need to "unwrap" the phase or the phase difference, for example:


diff = phase_new - phase_old
if phase_old > Pi and phase_new < Pi then diff += 2Pi

or similar.


Am 28.01.2018 um 17:19 schrieb Benny Alexandar:

Hi GM,

>> HT -> Atan2 -> differenciate -> unwrap
Could you please explain how to find the drift using HT,

HT -> gives real(I) & imaginary (Q) components of real signal
Atan2 -> the phase of an I Q signal
diff-> gives what ?
unwrap ?

-ben



*From:* music-dsp-boun...@music.columbia.edu 
<music-dsp-boun...@music.columbia.edu> on behalf of gm 
<g...@voxangelica.net>

*Sent:* Saturday, January 27, 2018 5:20 PM
*To:* music-dsp@music.columbia.edu
*Subject:* Re: [music-dsp] Clock drift and compensation

I don't understand your project at all so not sure if this is helpful,
probably not,
but you can calculate the drift or instantanous frequency of a sine wave
on a per sample basis
using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Clock drift and compensation

2018-01-27 Thread gm


I don't understand your project at all so not sure if this is helpful, 
probably not,
but you can calculate the drift or instantanous frequency of a sine wave 
on a per sample basis

using a Hilbert transform
HT -> Atan2 -> differenciate -> unwrap
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Finding discontinuity in a sine wave.

2018-01-10 Thread gm

Isn't a clock drift indistinguishable from a drift in your input signal?


I'd use a feed forward combfilter btw


Am 10.01.2018 um 18:47 schrieb Benny Alexandar:
This all works well in an ideal system. Suppose the sampling clock is 
drifting slowly over period of time,
then the notch filter will fail to filter it. How to detect and 
correct these clock drifts and have a stable notch filter.


-ben


*From:* music-dsp-boun...@music.columbia.edu 
 on behalf of Ethan Fenn 


*Sent:* Wednesday, January 10, 2018 10:33 PM
*To:* music-dsp@music.columbia.edu
*Subject:* Re: [music-dsp] Finding discontinuity in a sine wave.
If the sine frequency is f and the sample rate is sr:

Let C = cos(2*pi*f/sr)

For each sample compute:

y(t) = x(t) - 2*C*x(t-1) + x(t-2)

y(t) should be 0 for every t... if not it indicates a discontinuity. 
This is just an FIR filter with a zero at the given frequency.


-Ethan




On Wed, Jan 10, 2018 at 11:58 AM, STEFFAN DIEDRICHSEN 
> wrote:


With any phase discontinuity, a spectral discontinuity is
delivered for free. So, the notch filter will have an output, a
PPL would need to re-sync, etc.

Steffan



On 10.01.2018|KW2, at 17:51, Benny Alexandar
> wrote:

But if there is a phase discontinuity it will be hard to detect.




___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu 
https://lists.columbia.edu/mailman/listinfo/music-dsp





___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] minBLEP: advantages/disadvantages of ripple-after-step

2017-12-03 Thread gm
In informal listening tests I found that there is a miniscule audible 
difference
between a linear phase and minimum phase transition in a sawtooth wave 
when using headphones.


The minimum phase transistion sounded "sharper" or "harder" IIRC.

The difference was barely noticable and possibly even just imagined.
But when you create a wavetable that morphes between random phases and 
minimum phase
alignment of the harmonics there is an audible difference during the 
minimum phase transistion.


I didnt make listening tests with nonlinearities but I assume in 
practice the
difference doesn't matter much, since you usually have some lowpass on 
the sawtooth
and the linear phase and minimum phase versions are more or less the 
same in this case.



Am 03.12.2017 um 13:23 schrieb Stefan Westerfeld:

Hi!

I'm working on a minBLEP based oscillator. This means that my output signal
will contain all ripple needed for bandlimiting the output after each step.

Other methods of generating bandlimited signals, for instance interpolation in
an oversampled table will produce half of the ripple before and half of the
ripple after each step. In frequency domain, both are equally valid results,
that is, the frequencies contained in a minBLEP and those for other methods are
exactly the same, given similar filter desgin contstraints.

However, I have a vague idea that this is not all there is to know about the
quality. For instance, what happens if I apply a non linear effect such as
distortion after producing my signal. It could be that one of the two ways of
introducing ripple in the oscillator would produce better results when combined
with such an effect.

I already know that the minBLEP provides a faster reaction for input from
outside, for instance resetting the phase will be quicker if all ripple is
introduced afterwards, but for my application that doesn't matter much. But if
the time signal of one of the two methods would produce better results when
using effects, this would matter to me. So are there advantages/disadvantages
for each method?

Cu... Stefan


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Reverb, magic numbers and random generators #2 solution?

2017-10-02 Thread gm

    D  2D
| 1 |  2    |
| | |  |  1 |
|_|_|__|__|_|_
   g___|  |
   {__|

   a__| |
   {|

So, why is g= ln(2) the best solution?

So far, we haven't scaled g, the ratio of the first "broken echo" to the 
initial echo, but there is no need to keep that fixed for all allpasses/ 
echo generators.

In fact I believe that scaling g, possibly with ~0.382
will lead to families of optimal results for rooms
I have no proof for this though, but again its supported by data.

Replacing in the general formula

ratio a = 1 / (N+1-g)

with
ratio = 1/ (N+1-g^N)

Instead of g=ln(2) we use the simple original Go approach again where 
g=1/2, we set


ratio= 1/ (N+1 -1/2^(N)) or ratio= 1/ (N+1 -2^(-N))

(wich expands with Laurent series as
1/(N(1+ln(2)) + ... )

and I think it is somewhere along such lines, scaling g=1/2 with each N
on a basis 1/2^x or 2^-x where ln(2) comes into play

We now should set N, which defined both the number of echoes and the
number of the nth echo generator, independently

1/ (N+1 -(1/2)^M)

and set the ratio in respect to the ratio of the next echo generator

(N+2 -(1/2)^(M+1))/ (N+1 -(1/2)^M)

or more general

(N+2 -g^(M+1))/ (N+1 -g^M)

where N is the number of echoes and m is the number of the echo generator.


I dont have any math skills to expand on this, and I would love to see 
some one doing this.

Or see any other inside or discussion points.

Does anybody follow this?
Does any of this make sense to someone?

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Reverb, magic numbers and random generators #2 solution?

2017-10-02 Thread gm

Am 02.10.2017 um 04:42 schrieb Stefan Sullivan:
Forgive me if you said this already, but did you try negative feedback 
values? I wonder what that does to the aesthetics of the reverb.


Stefan
yes... but it's not recommended for the loop unless it's part of a 
feedback matrix

you get half the modes and basically a hollow tone by that
you can use negative values an the AP coefficients as well which can 
sound quite different

- in reality every reflection is an inversion though
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Reverb, magic numbers and random generators #2 solution?

2017-10-01 Thread gm

and here's the impulse response, large 4APs Early- > 3AP Loop

its pretty smooth without tweaking anything manually

https://soundcloud.com/traumlos_kalt/whd-ln2-impresponse/s-d1ArU

the autocorrelation and autoconvolution are also very good


Am 02.10.2017 um 00:45 schrieb gm:

So...
Heres my "paper", a very sloppy very first draft, several figures and 
images missing and too long.


http://www.voxangelica.net/transfer/magic%20numbers%20for%20reverb%20design%203b.pdf

questions, comments, improvements, critique are very welcome.
But is it even worth to write a paper about that?, its just plain simpel:

The perfect allpass and echo comes at *1/(N+1 -ln(2)).*

Formal proof outstanding.

And if you hack & crack why it's 1/(N+1 ln(2)) exactly you'll get 
76.52 % of the fame.

Or 99.% even.

Imagine that this may lead to perfect accoustic rooms as well...
Everywhere in the world they will build rooms that bare your name, for 
millenia to come!

So, yes, participate please. ;)

I assume it has to do with fractional expansion but that paragraph is 
still missing in the paper.

I have no idea about math tbh.  but I' d love to understand that.



___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp


___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] Reverb, magic numbers and random generators #2 solution?

2017-10-01 Thread gm



Am 02.10.2017 um 00:45 schrieb gm:


Formal proof outstanding.

sorry, weird Germanism, read that as "missing" please
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] Reverb, magic numbers and random generators #2 solution?

2017-10-01 Thread gm

Am 01.10.2017 um 18:35 schrieb gm:

Counterintutively, there is no solution for g=a for N =2 (except g=a=1);
(the solution for g=a and N=3 is 1/golden ratio )

make that phi^2 = 0.382..ect


For those who didnt follow, after all this I now postulate that

*ratio = 1/ ( N - ln(2) +1) *

with N = number of the allpass delay and ratio the allpass delay length 
ratio in respect to the loop delay


gives the ideal ratios for the smoothest reverb response for allpass 
chains and allpass + delay loops for example like in the combined structure:



[APn]->...->[AP5]-->[AP4]--+-->[AP3]-->[AP2]-->[AP1]-->[Delay]--->
^   |
|   |
<

while other ratios that follow

Na mod 1 = a*g
a = 1 / (N-g)

(lower series)
or

Na mod 1 = 1- a*g
a = 2 / (N + g)

(upper series)

with N the number of the nth impulse and g the times scaling of the 
impulse in respect to the first delayed impulse


are still of interest, for instance with
g = 1/2 and a1,2,3... = a1,2,3... *detunefactor 1,2,3...
and g = 1/golden ratio squared (0.382..)
where an additions of reziprokals like a = 0.5 for the g= 1/2 series or 
a combination

lower and upper series are also possible.

Can some ome explain the result for g = ln(2) and ratio = 1/ ( N - ln(2) 
+1) to me?

Or give a better formula or value?



BTW it doesnt mean it's the "best" reverb, musically, but it seems give 
the smoothest values
For shorter reverbs other values for instance the mixed series with 
~0.5, ~2/3, ~4/5 pluse detuning migt be better.













___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

  1   2   >