Csound Csound-dev Csound-tekno Search About

[Csnd] decomposition into sine waves

Date2011-10-29 01:28
FromDennis Raddle
Subject[Csnd] decomposition into sine waves
Is there an analysis technique to decompose a sound file into sine
waves, like hetro, but in which all sine waves are exact multiples of
the fundamental and remain fixed in frequency, and in which I can
specify the fundamental?
Dennis


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-29 02:13
FromDennis Raddle
Subject[Csnd] Re: decomposition into sine waves
Follow-up: I was thinking of trying to run hetro and then editing its
output. The docs say it should output to a text file format. However,
when I load the output into an editor, it looks like binary. Any way
to get text?

On Fri, Oct 28, 2011 at 5:28 PM, Dennis Raddle  wrote:
> Is there an analysis technique to decompose a sound file into sine
> waves, like hetro, but in which all sine waves are exact multiples of
> the fundamental and remain fixed in frequency, and in which I can
> specify the fundamental?
> Dennis
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-29 02:42
FromDennis Raddle
Subject[Csnd] Re: decomposition into sine waves
I discovered a reference to a program called HetroReader for Mac that
can translate .het <-> text, but I'm on Windows.

On Fri, Oct 28, 2011 at 6:13 PM, Dennis Raddle  wrote:
> Follow-up: I was thinking of trying to run hetro and then editing its
> output. The docs say it should output to a text file format. However,
> when I load the output into an editor, it looks like binary. Any way
> to get text?
>
> On Fri, Oct 28, 2011 at 5:28 PM, Dennis Raddle  wrote:
>> Is there an analysis technique to decompose a sound file into sine
>> waves, like hetro, but in which all sine waves are exact multiples of
>> the fundamental and remain fixed in frequency, and in which I can
>> specify the fundamental?
>> Dennis
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-29 07:58
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Re: decomposition into sine waves
het_export and het_import ?

> I discovered a reference to a program called HetroReader for Mac that
> can translate .het <-> text, but I'm on Windows.
>




Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-29 09:59
FromRichard Dobson
SubjectRe: [Csnd] decomposition into sine waves
The problem is that the vast majority of real soudns do not behave so 
cooperatively. Their partials tend to change over time, and not to be 
exact harmonics. The best you can do, therefore, is after a hetro 
analysis, to hack/process the data to get what you want. I donlt know 
whether Cecelia can do this, but it wudl be worth checking.

Aeons ago I wrote a little naive Windows program called "ads2ft" which 
read in a hetro file, and generated a simple Csound ftable (GEN 10) 
from the amplitude values at a selected point in time. The resulting 
ftable passed to oscil would give the the fixed spectrum you are looking 
for, at whatever pitch you wanted (aliassing permitting). there is a 
slim chance it is still in the distribution somewhere, or elsewhere on 
sourceforge. I have no time today to look for it, but if not, I guess it 
could be revived.

Richard Dobson

On 29/10/2011 01:28, Dennis Raddle wrote:
> Is there an analysis technique to decompose a sound file into sine
> waves, like hetro, but in which all sine waves are exact multiples of
> the fundamental and remain fixed in frequency, and in which I can
> specify the fundamental?
> Dennis
>
>
> Send bugs reports to the Sourceforge bug tracker
>              https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-29 10:35
FromStefan Thomas
SubjectRe: [Csnd] decomposition into sine waves
There are also the ats-opcodes, which can do analysis and resynthesis!
In my opinion they are excellent tools.

2011/10/29 Richard Dobson <richarddobson@blueyonder.co.uk>
The problem is that the vast majority of real soudns do not behave so cooperatively. Their partials tend to change over time, and not to be exact harmonics. The best you can do, therefore, is after a hetro analysis, to hack/process the data to get what you want. I donlt know whether Cecelia can do this, but it wudl be worth checking.

Aeons ago I wrote a little naive Windows program called "ads2ft" which read in a hetro file, and generated a simple Csound ftable (GEN 10) from the amplitude values at a selected point in time. The resulting ftable passed to oscil would give the the fixed spectrum you are looking for, at whatever pitch you wanted (aliassing permitting). there is a slim chance it is still in the distribution somewhere, or elsewhere on sourceforge. I have no time today to look for it, but if not, I guess it could be revived.

Richard Dobson


On 29/10/2011 01:28, Dennis Raddle wrote:
Is there an analysis technique to decompose a sound file into sine
waves, like hetro, but in which all sine waves are exact multiples of
the fundamental and remain fixed in frequency, and in which I can
specify the fundamental?
Dennis


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2011-10-29 14:42
FromAidan Collins
SubjectRe: [Csnd] decomposition into sine waves
What about the pvsadsyn opcode?

http://www.csounds.com/manual/html/pvsadsyn.html

It wouldn't be exactly what you're looking for, but a single bin, or a
small number of bins might be functionally similar to an isolated sine
wave if you use 1 for the inoscs argument and have a high enough
number of analysis bins.

Aidan

On Sat, Oct 29, 2011 at 5:35 AM, Stefan Thomas
 wrote:
> There are also the ats-opcodes, which can do analysis and resynthesis!
> In my opinion they are excellent tools.
>
> 2011/10/29 Richard Dobson 
>>
>> The problem is that the vast majority of real soudns do not behave so
>> cooperatively. Their partials tend to change over time, and not to be exact
>> harmonics. The best you can do, therefore, is after a hetro analysis, to
>> hack/process the data to get what you want. I donlt know whether Cecelia can
>> do this, but it wudl be worth checking.
>>
>> Aeons ago I wrote a little naive Windows program called "ads2ft" which
>> read in a hetro file, and generated a simple Csound ftable (GEN 10) from the
>> amplitude values at a selected point in time. The resulting ftable passed to
>> oscil would give the the fixed spectrum you are looking for, at whatever
>> pitch you wanted (aliassing permitting). there is a slim chance it is still
>> in the distribution somewhere, or elsewhere on sourceforge. I have no time
>> today to look for it, but if not, I guess it could be revived.
>>
>> Richard Dobson
>>
>> On 29/10/2011 01:28, Dennis Raddle wrote:
>>>
>>> Is there an analysis technique to decompose a sound file into sine
>>> waves, like hetro, but in which all sine waves are exact multiples of
>>> the fundamental and remain fixed in frequency, and in which I can
>>> specify the fundamental?
>>> Dennis
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>>
>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-10-29 20:46
FromDennis Raddle
SubjectRe: [Csnd] decomposition into sine waves
There's something wrong with hetro. I used it to analyse a harmonic
source, a piano note. It produces frequencies which are evenly spaced
but not harmonics, let me give an example. It might produce the
frequencies (for partials) as 300, 700, 1100, 1500, etc. See how they
are all 400 apart, but the fundamental is not 400. The resulting sound
from using adsyn for playback is therefore bell-like. Any idea what's
going wrong?


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-30 01:55
FromJustin Smith
SubjectRe: [Csnd] decomposition into sine waves

What command line arguments are you using? By default hetro only generates ten partials, and that could be the cause of the distortion. Also try giving different arguments for -f to see if that improves the output.

----- Original message -----
> There's something wrong with hetro. I used it to analyse a harmonic
> source, a piano note. It produces frequencies which are evenly spaced
> but not harmonics, let me give an example. It might produce the
> frequencies (for partials) as 300, 700, 1100, 1500, etc. See how they
> are all 400 apart, but the fundamental is not 400. The resulting sound
> from using adsyn for playback is therefore bell-like. Any idea what's
> going wrong?
>
>
> Send bugs reports to the Sourceforge bug tracker
>                        https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>


Date2011-10-30 01:44
FromPeiman Khosravi
SubjectRe: [Csnd] decomposition into sine waves
This should be easy enough to do with pvs opcodes. But of course it would
only make sense with harmonic sounds in the first place.

You can track the fundamental frequency (i.e. using 'pvspitch'), write the
pvs data of a single frame to a table, look at the amplitude of the bins
whose frequencies are integer multiples of the fundamental and write them
to a new table. 

P  

On 29/10/2011 01:28, "Dennis Raddle"  wrote:

>Is there an analysis technique to decompose a sound file into sine
>waves, like hetro, but in which all sine waves are exact multiples of
>the fundamental and remain fixed in frequency, and in which I can
>specify the fundamental?
>Dennis
>
>
>Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>Discussions of bugs and features can be posted here
>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>csound"
>




Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-30 18:11
FromDennis Raddle
SubjectRe: [Csnd] decomposition into sine waves
All sorts of different arguments--always a similar problem. I've given
various starting frequency estimates (-f) including the known actual
frequency of the fundamental. It always comes up with a fundamental at
a value other than I gave, even when I give the same value it arrived
at last time. I've increased the number of partials to 40 (-n),
increased the breakpoints to 1000 (-b), and limited the portion of the
sample it analyzes (-d).

The fact that it ALWAYS comes up with a different estimate for the
fundamental than I give via -f even when I give an estimate equal to
something it came up with previously is suspicious of buggy behavior.


On Sat, Oct 29, 2011 at 5:55 PM, Justin Smith  wrote:
> What command line arguments are you using? By default hetro only generates
> ten partials, and that could be the cause of the distortion. Also try giving
> different arguments for -f to see if that improves the output.
>
> ----- Original message -----
>> There's something wrong with hetro. I used it to analyse a harmonic
>> source, a piano note. It produces frequencies which are evenly spaced
>> but not harmonics, let me give an example. It might produce the
>> frequencies (for partials) as 300, 700, 1100, 1500, etc. See how they
>> are all 400 apart, but the fundamental is not 400. The resulting sound
>> from using adsyn for playback is therefore bell-like. Any idea what's
>> going wrong?
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>
>> https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-30 18:12
FromDennis Raddle
SubjectRe: [Csnd] decomposition into sine waves
What program do I use to do the analysis? What format of file does it
produce and how do I read/alter this file format?

On Sat, Oct 29, 2011 at 6:44 PM, Peiman Khosravi
 wrote:
> This should be easy enough to do with pvs opcodes. But of course it would
> only make sense with harmonic sounds in the first place.
>
> You can track the fundamental frequency (i.e. using 'pvspitch'), write the
> pvs data of a single frame to a table, look at the amplitude of the bins
> whose frequencies are integer multiples of the fundamental and write them
> to a new table.
>
> P
>
> On 29/10/2011 01:28, "Dennis Raddle"  wrote:
>
>>Is there an analysis technique to decompose a sound file into sine
>>waves, like hetro, but in which all sine waves are exact multiples of
>>the fundamental and remain fixed in frequency, and in which I can
>>specify the fundamental?
>>Dennis
>>
>>
>>Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>Discussions of bugs and features can be posted here
>>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>csound"
>>
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-10-30 18:19
Frompeiman khosravi
SubjectRe: [Csnd] decomposition into sine waves
You can do the analysis "live" using 'pvsanal'. Then write the result
into a table with 'pvsftw'. Of course you could then save the table to
a txt file if you want to with 'ftsave'.


P

On 30 October 2011 18:12, Dennis Raddle  wrote:
> What program do I use to do the analysis? What format of file does it
> produce and how do I read/alter this file format?
>
> On Sat, Oct 29, 2011 at 6:44 PM, Peiman Khosravi
>  wrote:
>> This should be easy enough to do with pvs opcodes. But of course it would
>> only make sense with harmonic sounds in the first place.
>>
>> You can track the fundamental frequency (i.e. using 'pvspitch'), write the
>> pvs data of a single frame to a table, look at the amplitude of the bins
>> whose frequencies are integer multiples of the fundamental and write them
>> to a new table.
>>
>> P
>>
>> On 29/10/2011 01:28, "Dennis Raddle"  wrote:
>>
>>>Is there an analysis technique to decompose a sound file into sine
>>>waves, like hetro, but in which all sine waves are exact multiples of
>>>the fundamental and remain fixed in frequency, and in which I can
>>>specify the fundamental?
>>>Dennis
>>>
>>>
>>>Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>Discussions of bugs and features can be posted here
>>>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>>csound"
>>>
>>
>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-01 04:32
FromDennis Raddle
SubjectRe: [Csnd] decomposition into sine waves
Thanks Peiman. So is there documentation of the format of the table?
My goal is to get playback using purely harmonic sine waves, so... I
need to figure out how to interpret the output table, then figure out
what opcode to use to get the playback.

On Sun, Oct 30, 2011 at 11:19 AM, peiman khosravi
 wrote:
> You can do the analysis "live" using 'pvsanal'. Then write the result
> into a table with 'pvsftw'. Of course you could then save the table to
> a txt file if you want to with 'ftsave'.
>
>
> P
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-11-01 08:06
Frompeiman khosravi
SubjectRe: [Csnd] decomposition into sine waves
If you know the fundamental frequency then you only need to write the
amp values to table. The format is simple, one value per index.

You can play back using adsynt.

P

On 1 November 2011 04:32, Dennis Raddle  wrote:
> Thanks Peiman. So is there documentation of the format of the table?
> My goal is to get playback using purely harmonic sine waves, so... I
> need to figure out how to interpret the output table, then figure out
> what opcode to use to get the playback.
>
> On Sun, Oct 30, 2011 at 11:19 AM, peiman khosravi
>  wrote:
>> You can do the analysis "live" using 'pvsanal'. Then write the result
>> into a table with 'pvsftw'. Of course you could then save the table to
>> a txt file if you want to with 'ftsave'.
>>
>>
>> P
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-01 08:33
Frompeiman khosravi
SubjectRe: [Csnd] decomposition into sine waves
Just to be clear here this is what I mean:

-Freeze the signal during the steady state using pvsfreeze
-Write the bins' amp and freq (sorry I contradict myself now!) values
to table with pvsftw
-Go through the freq table index-by-index and for each bin freq value
that corresponds with a harmonic (use 'if') select the amp value and
write them to two separate tables (tablew).
-use adsynt to synthesise the result.

Of course the sound is not going to be that interesting since your amp
and freq values will not vary in time. Also they will all start and
end together, which is very unnatural. You could also make a bank of
oscillators manually, in which case you can have a different length or
envelop for each partial. (e.g. you can have one single sine wave
generator instrument that is triggered from within another instrument
with one note per harmonic.)

P

On 30 October 2011 18:19, peiman khosravi  wrote:
> You can do the analysis "live" using 'pvsanal'. Then write the result
> into a table with 'pvsftw'. Of course you could then save the table to
> a txt file if you want to with 'ftsave'.
>
>
> P
>
> On 30 October 2011 18:12, Dennis Raddle  wrote:
>> What program do I use to do the analysis? What format of file does it
>> produce and how do I read/alter this file format?
>>
>> On Sat, Oct 29, 2011 at 6:44 PM, Peiman Khosravi
>>  wrote:
>>> This should be easy enough to do with pvs opcodes. But of course it would
>>> only make sense with harmonic sounds in the first place.
>>>
>>> You can track the fundamental frequency (i.e. using 'pvspitch'), write the
>>> pvs data of a single frame to a table, look at the amplitude of the bins
>>> whose frequencies are integer multiples of the fundamental and write them
>>> to a new table.
>>>
>>> P
>>>
>>> On 29/10/2011 01:28, "Dennis Raddle"  wrote:
>>>
>>>>Is there an analysis technique to decompose a sound file into sine
>>>>waves, like hetro, but in which all sine waves are exact multiples of
>>>>the fundamental and remain fixed in frequency, and in which I can
>>>>specify the fundamental?
>>>>Dennis
>>>>
>>>>
>>>>Send bugs reports to the Sourceforge bug tracker
>>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>>>Discussions of bugs and features can be posted here
>>>>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>>>csound"
>>>>
>>>
>>>
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>>
>>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-01 22:59
FromDennis Raddle
SubjectRe: [Csnd] decomposition into sine waves
On Tue, Nov 1, 2011 at 1:33 AM, peiman khosravi
 wrote:
> Just to be clear here this is what I mean:
...
> Of course the sound is not going to be that interesting since your amp
> and freq values will not vary in time. Also they will all start and
> end together, which is very unnatural. You could also make a bank of
> oscillators manually, in which case you can have a different length or
> envelop for each partial. (e.g. you can have one single sine wave
> generator instrument that is triggered from within another instrument
> with one note per harmonic.)

Maybe my original request was not clear. I want time-varying partials
with independent envelopes. That was my whole point. I just want them
to be exact harmonics rather than varying in frequency. So I want to
do something like the hetro utility does (although it seems to be
broken) and manually force the frequencies to be constant.

So if I use the pvs opcodes, how do I interpret the table output? I
undersatnd what you are saying, that I'm looking in fft bins to find
the strength of partials--- but there will be many ffts over each time
window. Also I need to put the data in some kind of format for
oscillator playback, but I'm not sure which opcode to use. There are
so many, and the descriptions are confusing to me (I don't have a
background in understanding all these types of analysis). Plus, in
many cases the input format to an opcode is poorly documented (or not
documented at all).

Dennis


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-11-02 00:01
Frompeiman khosravi
SubjectRe: [Csnd] decomposition into sine waves
Well in this case it's easy. You can just zero the non-harmonic
partials of the pvs stream and then synthesize with pvsadsyn.

But what type of sound are you analyzing anyway? You could always use
the ATS opcodes too.

P

On 1 November 2011 22:59, Dennis Raddle  wrote:
> On Tue, Nov 1, 2011 at 1:33 AM, peiman khosravi
>  wrote:
>> Just to be clear here this is what I mean:
> ...
>> Of course the sound is not going to be that interesting since your amp
>> and freq values will not vary in time. Also they will all start and
>> end together, which is very unnatural. You could also make a bank of
>> oscillators manually, in which case you can have a different length or
>> envelop for each partial. (e.g. you can have one single sine wave
>> generator instrument that is triggered from within another instrument
>> with one note per harmonic.)
>
> Maybe my original request was not clear. I want time-varying partials
> with independent envelopes. That was my whole point. I just want them
> to be exact harmonics rather than varying in frequency. So I want to
> do something like the hetro utility does (although it seems to be
> broken) and manually force the frequencies to be constant.
>
> So if I use the pvs opcodes, how do I interpret the table output? I
> undersatnd what you are saying, that I'm looking in fft bins to find
> the strength of partials--- but there will be many ffts over each time
> window. Also I need to put the data in some kind of format for
> oscillator playback, but I'm not sure which opcode to use. There are
> so many, and the descriptions are confusing to me (I don't have a
> background in understanding all these types of analysis). Plus, in
> many cases the input format to an opcode is poorly documented (or not
> documented at all).
>
> Dennis
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-02 00:09
Frompeiman khosravi
SubjectRe: [Csnd] decomposition into sine waves
What I don't get is this: you want the sound to be harmonic but you
want to base it on analysis. Then you'll need to analyse a sound that
is harmonic in the first place. In which case you can use any of the
analysis methods available in Csound (e.g. I'd recommend pvs or ATS).

P

On 2 November 2011 00:01, peiman khosravi  wrote:
> Well in this case it's easy. You can just zero the non-harmonic
> partials of the pvs stream and then synthesize with pvsadsyn.
>
> But what type of sound are you analyzing anyway? You could always use
> the ATS opcodes too.
>
> P
>
> On 1 November 2011 22:59, Dennis Raddle  wrote:
>> On Tue, Nov 1, 2011 at 1:33 AM, peiman khosravi
>>  wrote:
>>> Just to be clear here this is what I mean:
>> ...
>>> Of course the sound is not going to be that interesting since your amp
>>> and freq values will not vary in time. Also they will all start and
>>> end together, which is very unnatural. You could also make a bank of
>>> oscillators manually, in which case you can have a different length or
>>> envelop for each partial. (e.g. you can have one single sine wave
>>> generator instrument that is triggered from within another instrument
>>> with one note per harmonic.)
>>
>> Maybe my original request was not clear. I want time-varying partials
>> with independent envelopes. That was my whole point. I just want them
>> to be exact harmonics rather than varying in frequency. So I want to
>> do something like the hetro utility does (although it seems to be
>> broken) and manually force the frequencies to be constant.
>>
>> So if I use the pvs opcodes, how do I interpret the table output? I
>> undersatnd what you are saying, that I'm looking in fft bins to find
>> the strength of partials--- but there will be many ffts over each time
>> window. Also I need to put the data in some kind of format for
>> oscillator playback, but I'm not sure which opcode to use. There are
>> so many, and the descriptions are confusing to me (I don't have a
>> background in understanding all these types of analysis). Plus, in
>> many cases the input format to an opcode is poorly documented (or not
>> documented at all).
>>
>> Dennis
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-02 00:14
Frompeiman khosravi
SubjectRe: [Csnd] decomposition into sine waves
OK, reading your post I get what you're after. Just to be clear. If
your partials are not harmonic then you want to 'quantize' them to the
harmonic ratios? Do you want them to snap to the nearest harmonic?

P



On 2 November 2011 00:09, peiman khosravi  wrote:
> What I don't get is this: you want the sound to be harmonic but you
> want to base it on analysis. Then you'll need to analyse a sound that
> is harmonic in the first place. In which case you can use any of the
> analysis methods available in Csound (e.g. I'd recommend pvs or ATS).
>
> P
>
> On 2 November 2011 00:01, peiman khosravi  wrote:
>> Well in this case it's easy. You can just zero the non-harmonic
>> partials of the pvs stream and then synthesize with pvsadsyn.
>>
>> But what type of sound are you analyzing anyway? You could always use
>> the ATS opcodes too.
>>
>> P
>>
>> On 1 November 2011 22:59, Dennis Raddle  wrote:
>>> On Tue, Nov 1, 2011 at 1:33 AM, peiman khosravi
>>>  wrote:
>>>> Just to be clear here this is what I mean:
>>> ...
>>>> Of course the sound is not going to be that interesting since your amp
>>>> and freq values will not vary in time. Also they will all start and
>>>> end together, which is very unnatural. You could also make a bank of
>>>> oscillators manually, in which case you can have a different length or
>>>> envelop for each partial. (e.g. you can have one single sine wave
>>>> generator instrument that is triggered from within another instrument
>>>> with one note per harmonic.)
>>>
>>> Maybe my original request was not clear. I want time-varying partials
>>> with independent envelopes. That was my whole point. I just want them
>>> to be exact harmonics rather than varying in frequency. So I want to
>>> do something like the hetro utility does (although it seems to be
>>> broken) and manually force the frequencies to be constant.
>>>
>>> So if I use the pvs opcodes, how do I interpret the table output? I
>>> undersatnd what you are saying, that I'm looking in fft bins to find
>>> the strength of partials--- but there will be many ffts over each time
>>> window. Also I need to put the data in some kind of format for
>>> oscillator playback, but I'm not sure which opcode to use. There are
>>> so many, and the descriptions are confusing to me (I don't have a
>>> background in understanding all these types of analysis). Plus, in
>>> many cases the input format to an opcode is poorly documented (or not
>>> documented at all).
>>>
>>> Dennis
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-02 00:22
FromRichard Dobson
SubjectRe: [Csnd] decomposition into sine waves
As it happens, this is a trick which the venerable SNDAN package can do; 
specifically the "monan" program which processes sndan analysis files. 
One option is to replace each partial with a harmonic of the 
fundamental; there are many others for processing or transforming 
partials in all sorts of ways.

See here for details:

http://dream.cs.bath.ac.uk/software/sndan/sndan.html

(this describes a custom Windows port I made many years ago; the 
original code by James Beauchamp is unix-based (driven by scripts), and 
could be built "as is" on the Mac.)

Part of the problem with hetro is simply that very few such modification 
opcodes exist for it. I think the original idea was that as hetro output 
can be presented asd a simple text file,  the composer would just write 
a small program to read the file and apply whatever custom 
transformation they wanted. The FFT engine used by Sndan permits any 
even-numbered FFT size, so that it can be tuned as close as possible to 
the fundamental frequency of the input; which in turn would place 
harmonic partials pretty close to an exact fit to fft analysis bins. 
There is a second partial-track analysis tool "mqan" (classic 
McAulay-Quatieri) for sounds with more dynamically varying partials. It 
may be an "old" package, but it was designed very much for this sort of 
work, is still in wide use, and from my memory does actually work very well.

This is really an offline process, with more than one way to achieve the 
stated goal; I do not see the pvs framework as an ideal fit to the 
problem. The other partial track tools would probably be better, if they 
permit the required  transformations.

A piano tone is in any case very chaotic at the start (very inharmonic, 
bell-like in many ways), and is well-known for having "stretched" 
partials, i.e. a bit wider than exact harmonics. This is because the 
extreme stiffness of the strings make it behave in many ways more like a 
rigid bar. So the planned transformation will indeed make it sound very 
different, and possibly no longer recognisable as a piano.

Richard Dobson


On 01/11/2011 22:59, Dennis Raddle wrote:
> On Tue, Nov 1, 2011 at 1:33 AM, peiman khosravi
>   wrote:
>> Just to be clear here this is what I mean:
> ...
>> Of course the sound is not going to be that interesting since your amp
>> and freq values will not vary in time. Also they will all start and
>> end together, which is very unnatural. You could also make a bank of
>> oscillators manually, in which case you can have a different length or
>> envelop for each partial. (e.g. you can have one single sine wave
>> generator instrument that is triggered from within another instrument
>> with one note per harmonic.)
>
> Maybe my original request was not clear. I want time-varying partials
> with independent envelopes. That was my whole point. I just want them
> to be exact harmonics rather than varying in frequency. So I want to
> do something like the hetro utility does (although it seems to be
> broken) and manually force the frequencies to be constant.
>
> So if I use the pvs opcodes, how do I interpret the table output? I
> undersatnd what you are saying, that I'm looking in fft bins to find
> the strength of partials--- but there will be many ffts over each time
> window. Also I need to put the data in some kind of format for
> oscillator playback, but I'm not sure which opcode to use. There are
> so many, and the descriptions are confusing to me (I don't have a
> background in understanding all these types of analysis). Plus, in
> many cases the input format to an opcode is poorly documented (or not
> documented at all).
>



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-11-02 04:11
FromMichael Mossey
SubjectRe: [Csnd] decomposition into sine waves

I'm not sure what i will want eventually... i use sampled pianos to play some of my music but i don't always like the result.. a piano-like sound but with harmonic partials offers other possibilities for expression and beauty

Sent from phone, that's why it is short

On Nov 1, 2011 5:15 PM, "peiman khosravi" <peimankhosravi@gmail.com> wrote:
OK, reading your post I get what you're after. Just to be clear. If
your partials are not harmonic then you want to 'quantize' them to the
harmonic ratios? Do you want them to snap to the nearest harmonic?

P



On 2 November 2011 00:09, peiman khosravi <peimankhosravi@gmail.com> wrote:
> What I don't get is this: you want the sound to be harmonic but you
> want to base it on analysis. Then you'll need to analyse a sound that
> is harmonic in the first place. In which case you can use any of the
> analysis methods available in Csound (e.g. I'd recommend pvs or ATS).
>
> P
>
> On 2 November 2011 00:01, peiman khosravi <peimankhosravi@gmail.com> wrote:
>> Well in this case it's easy. You can just zero the non-harmonic
>> partials of the pvs stream and then synthesize with pvsadsyn.
>>
>> But what type of sound are you analyzing anyway? You could always use
>> the ATS opcodes too.
>>
>> P
>>
>> On 1 November 2011 22:59, Dennis Raddle <dennis.raddle@gmail.com> wrote:
>>> On Tue, Nov 1, 2011 at 1:33 AM, peiman khosravi
>>> <peimankhosravi@gmail.com> wrote:
>>>> Just to be clear here this is what I mean:
>>> ...
>>>> Of course the sound is not going to be that interesting since your amp
>>>> and freq values will not vary in time. Also they will all start and
>>>> end together, which is very unnatural. You could also make a bank of
>>>> oscillators manually, in which case you can have a different length or
>>>> envelop for each partial. (e.g. you can have one single sine wave
>>>> generator instrument that is triggered from within another instrument
>>>> with one note per harmonic.)
>>>
>>> Maybe my original request was not clear. I want time-varying partials
>>> with independent envelopes. That was my whole point. I just want them
>>> to be exact harmonics rather than varying in frequency. So I want to
>>> do something like the hetro utility does (although it seems to be
>>> broken) and manually force the frequencies to be constant.
>>>
>>> So if I use the pvs opcodes, how do I interpret the table output? I
>>> undersatnd what you are saying, that I'm looking in fft bins to find
>>> the strength of partials--- but there will be many ffts over each time
>>> window. Also I need to put the data in some kind of format for
>>> oscillator playback, but I'm not sure which opcode to use. There are
>>> so many, and the descriptions are confusing to me (I don't have a
>>> background in understanding all these types of analysis). Plus, in
>>> many cases the input format to an opcode is poorly documented (or not
>>> documented at all).
>>>
>>> Dennis
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>>
>>>
>>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-11-02 09:24
FromRichard Dobson
SubjectRe: [Csnd] decomposition into sine waves
In that case, the question is whether the analysis approach is relevant 
at all as you are removing most of the properties that make it 
piano-like - just synthesise the sounds you do want. With harmonic 
partials and a "piano-like" decay (even a plain exponential might be 
sufficient), plus a small amount of reverb, it will be closer to a harp, 
harpsichord, or some otherwise generic plucked string, depending on the 
slope of the attack and on the relative decay rate of each partial.

Richard Dobson

On 02/11/2011 04:11, Michael Mossey wrote:
> I'm not sure what i will want eventually... i use sampled pianos to play
> some of my music but i don't always like the result.. a piano-like sound
> but with harmonic partials offers other possibilities for expression and
> beauty
>
...


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"