Csound Csound-dev Csound-tekno Search About

[Csnd] read a sample's original pitch

Date2010-04-01 14:50
FromOeyvind Brandtsegg
Subject[Csnd] read a sample's original pitch
Is there a way to read an audio sample's (loaded by gen01) original
pitch in an instrument?
... an opcode called "ftpitch" or something similar.
I guess this information must be available, as loscil can access it.
It would be handy when building all kinds of sample playback methods.

best
Oeyvind


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"

Date2010-04-01 15:37
FromRory Walsh
Subject[Csnd] Re: read a sample's original pitch
Perhaps you can use filelen to find out the length of the sample
you've loaded and then set the frequency according to the length and
the sampling rate.

Rory.


On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
> Is there a way to read an audio sample's (loaded by gen01) original
> pitch in an instrument?
> ... an opcode called "ftpitch" or something similar.
> I guess this information must be available, as loscil can access it.
> It would be handy when building all kinds of sample playback methods.
>
> best
> Oeyvind
>
>
> 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"


Date2010-04-02 01:32
FromOeyvind Brandtsegg
Subject[Csnd] Re: Re: read a sample's original pitch
Yes, I can do this, but I was thinking of the original pitch as in the
pitch of the audio in the file.
It is possible to save the (not necessarily correct, it's an arbitrary
value) pitch with the file, at least for aiff files.
In my editor (soundforge), I can set this in a dialog:
Special - Edit Sample
... with a value called "Midi unity note of sample (C0 to G10)"

This way the information of what midi key should play back the sample
untransposed can be stored in the file.
I only need to access this information in the instrument ... :-)

best
Oeyvind

2010/4/1 Rory Walsh :
> Perhaps you can use filelen to find out the length of the sample
> you've loaded and then set the frequency according to the length and
> the sampling rate.
>
> Rory.
>
>
> On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
>> Is there a way to read an audio sample's (loaded by gen01) original
>> pitch in an instrument?
>> ... an opcode called "ftpitch" or something similar.
>> I guess this information must be available, as loscil can access it.
>> It would be handy when building all kinds of sample playback methods.
>>
>> best
>> Oeyvind
>>
>>
>> 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"


Date2010-04-02 02:50
Fromandy fillebrown
Subject[Csnd] Re: Re: Re: read a sample's original pitch
A lot of times the sample will have attack and release section
combined with a looping section.  In these cases it is generally only
the looping section that will be at the correct pitch.  I'm not sure
how this is implemented in aiff files, but in wav files all this info
is stored in a  chunk, which is probably what loscil is reading.
 Since the code is already there in loscil, it should be relatively
simple to implement something that retrieves the separate sections of
the  chunk (or its equivalent for other formats).  It would be a
convenient way to use those kinds of samples in other opcodes, too,
like diskin2 =)

Cheers,
~ andy.f



On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg  wrote:
> Yes, I can do this, but I was thinking of the original pitch as in the
> pitch of the audio in the file.
> It is possible to save the (not necessarily correct, it's an arbitrary
> value) pitch with the file, at least for aiff files.
> In my editor (soundforge), I can set this in a dialog:
> Special - Edit Sample
> ... with a value called "Midi unity note of sample (C0 to G10)"
>
> This way the information of what midi key should play back the sample
> untransposed can be stored in the file.
> I only need to access this information in the instrument ... :-)
>
> best
> Oeyvind
>
> 2010/4/1 Rory Walsh :
>> Perhaps you can use filelen to find out the length of the sample
>> you've loaded and then set the frequency according to the length and
>> the sampling rate.
>>
>> Rory.
>>
>>
>> On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
>>> Is there a way to read an audio sample's (loaded by gen01) original
>>> pitch in an instrument?
>>> ... an opcode called "ftpitch" or something similar.
>>> I guess this information must be available, as loscil can access it.
>>> It would be handy when building all kinds of sample playback methods.
>>>
>>> best
>>> Oeyvind
>>>
>>>
>>> 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"


Date2010-04-02 08:02
FromAndres Cabrera
Subject[Csnd] Re: Re: Re: Re: read a sample's original pitch
Hi,

But you'd still have to have put the chunk in there, maybe Oeyvind
wants something automatic? I guess this could be a UDO, which scans
the table, and does pitch analysis for a few tens of milliseconds
after the attack, and store that...

Cheers,
Andrés

On Fri, Apr 2, 2010 at 2:50 AM, andy fillebrown
 wrote:
> A lot of times the sample will have attack and release section
> combined with a looping section.  In these cases it is generally only
> the looping section that will be at the correct pitch.  I'm not sure
> how this is implemented in aiff files, but in wav files all this info
> is stored in a  chunk, which is probably what loscil is reading.
>  Since the code is already there in loscil, it should be relatively
> simple to implement something that retrieves the separate sections of
> the  chunk (or its equivalent for other formats).  It would be a
> convenient way to use those kinds of samples in other opcodes, too,
> like diskin2 =)
>
> Cheers,
> ~ andy.f
>
>
>
> On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg  wrote:
>> Yes, I can do this, but I was thinking of the original pitch as in the
>> pitch of the audio in the file.
>> It is possible to save the (not necessarily correct, it's an arbitrary
>> value) pitch with the file, at least for aiff files.
>> In my editor (soundforge), I can set this in a dialog:
>> Special - Edit Sample
>> ... with a value called "Midi unity note of sample (C0 to G10)"
>>
>> This way the information of what midi key should play back the sample
>> untransposed can be stored in the file.
>> I only need to access this information in the instrument ... :-)
>>
>> best
>> Oeyvind
>>
>> 2010/4/1 Rory Walsh :
>>> Perhaps you can use filelen to find out the length of the sample
>>> you've loaded and then set the frequency according to the length and
>>> the sampling rate.
>>>
>>> Rory.
>>>
>>>
>>> On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
>>>> Is there a way to read an audio sample's (loaded by gen01) original
>>>> pitch in an instrument?
>>>> ... an opcode called "ftpitch" or something similar.
>>>> I guess this information must be available, as loscil can access it.
>>>> It would be handy when building all kinds of sample playback methods.
>>>>
>>>> best
>>>> Oeyvind
>>>>
>>>>
>>>> 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"
>
>



-- 


Andrés


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"


Date2010-04-02 12:35
Fromandy fillebrown
Subject[Csnd] Re: Re: Re: Re: Re: read a sample's original pitch
That would be nice, but Oeyvind is talking about the user defined
pitch in the  chunk that Soundforge lets you set (along with the
other info in the chunk like loop start and end).  Since a lot of the
gigasample and kontakt sample files have  chunks, too, it would
be really nice to have access to that info in Csound instead of having
to set the parameters manually each time.

When I have more time I'd like to investigate the loscil opcode to see
exactly how it works.  I strongly suspect it reads the  chunk,
which would mean all the code to make an "ftpitch" opcode is already
there.

Cheers,
~ andy.f



On Fri, Apr 2, 2010 at 3:02 AM, Andres Cabrera  wrote:
> Hi,
>
> But you'd still have to have put the chunk in there, maybe Oeyvind
> wants something automatic? I guess this could be a UDO, which scans
> the table, and does pitch analysis for a few tens of milliseconds
> after the attack, and store that...
>
> Cheers,
> Andrés
>
> On Fri, Apr 2, 2010 at 2:50 AM, andy fillebrown
>  wrote:
>> A lot of times the sample will have attack and release section
>> combined with a looping section.  In these cases it is generally only
>> the looping section that will be at the correct pitch.  I'm not sure
>> how this is implemented in aiff files, but in wav files all this info
>> is stored in a  chunk, which is probably what loscil is reading.
>>  Since the code is already there in loscil, it should be relatively
>> simple to implement something that retrieves the separate sections of
>> the  chunk (or its equivalent for other formats).  It would be a
>> convenient way to use those kinds of samples in other opcodes, too,
>> like diskin2 =)
>>
>> Cheers,
>> ~ andy.f
>>
>>
>>
>> On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg  wrote:
>>> Yes, I can do this, but I was thinking of the original pitch as in the
>>> pitch of the audio in the file.
>>> It is possible to save the (not necessarily correct, it's an arbitrary
>>> value) pitch with the file, at least for aiff files.
>>> In my editor (soundforge), I can set this in a dialog:
>>> Special - Edit Sample
>>> ... with a value called "Midi unity note of sample (C0 to G10)"
>>>
>>> This way the information of what midi key should play back the sample
>>> untransposed can be stored in the file.
>>> I only need to access this information in the instrument ... :-)
>>>
>>> best
>>> Oeyvind
>>>
>>> 2010/4/1 Rory Walsh :
>>>> Perhaps you can use filelen to find out the length of the sample
>>>> you've loaded and then set the frequency according to the length and
>>>> the sampling rate.
>>>>
>>>> Rory.
>>>>
>>>>
>>>> On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
>>>>> Is there a way to read an audio sample's (loaded by gen01) original
>>>>> pitch in an instrument?
>>>>> ... an opcode called "ftpitch" or something similar.
>>>>> I guess this information must be available, as loscil can access it.
>>>>> It would be handy when building all kinds of sample playback methods.
>>>>>
>>>>> best
>>>>> Oeyvind
>>>>>
>>>>>
>>>>> 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"
>>
>>
>
>
>
> --
>
>
> Andrés
>
>
> 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"


Date2010-04-02 13:16
FromAndres Cabrera
Subject[Csnd] Re: Re: Re: Re: Re: Re: read a sample's original pitch
Hi,

I would even suspect Csound already loads that chunk thourhg
libsndfile when it creates the f-table, so it might actually be part
of the f-table struct. So it would probably be very easy to make such
an opcode.

Cheers,
Andrés

On Fri, Apr 2, 2010 at 12:35 PM, andy fillebrown
 wrote:
> That would be nice, but Oeyvind is talking about the user defined
> pitch in the  chunk that Soundforge lets you set (along with the
> other info in the chunk like loop start and end).  Since a lot of the
> gigasample and kontakt sample files have  chunks, too, it would
> be really nice to have access to that info in Csound instead of having
> to set the parameters manually each time.
>
> When I have more time I'd like to investigate the loscil opcode to see
> exactly how it works.  I strongly suspect it reads the  chunk,
> which would mean all the code to make an "ftpitch" opcode is already
> there.
>
> Cheers,
> ~ andy.f
>
>
>
> On Fri, Apr 2, 2010 at 3:02 AM, Andres Cabrera  wrote:
>> Hi,
>>
>> But you'd still have to have put the chunk in there, maybe Oeyvind
>> wants something automatic? I guess this could be a UDO, which scans
>> the table, and does pitch analysis for a few tens of milliseconds
>> after the attack, and store that...
>>
>> Cheers,
>> Andrés
>>
>> On Fri, Apr 2, 2010 at 2:50 AM, andy fillebrown
>>  wrote:
>>> A lot of times the sample will have attack and release section
>>> combined with a looping section.  In these cases it is generally only
>>> the looping section that will be at the correct pitch.  I'm not sure
>>> how this is implemented in aiff files, but in wav files all this info
>>> is stored in a  chunk, which is probably what loscil is reading.
>>>  Since the code is already there in loscil, it should be relatively
>>> simple to implement something that retrieves the separate sections of
>>> the  chunk (or its equivalent for other formats).  It would be a
>>> convenient way to use those kinds of samples in other opcodes, too,
>>> like diskin2 =)
>>>
>>> Cheers,
>>> ~ andy.f
>>>
>>>
>>>
>>> On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg  wrote:
>>>> Yes, I can do this, but I was thinking of the original pitch as in the
>>>> pitch of the audio in the file.
>>>> It is possible to save the (not necessarily correct, it's an arbitrary
>>>> value) pitch with the file, at least for aiff files.
>>>> In my editor (soundforge), I can set this in a dialog:
>>>> Special - Edit Sample
>>>> ... with a value called "Midi unity note of sample (C0 to G10)"
>>>>
>>>> This way the information of what midi key should play back the sample
>>>> untransposed can be stored in the file.
>>>> I only need to access this information in the instrument ... :-)
>>>>
>>>> best
>>>> Oeyvind
>>>>
>>>> 2010/4/1 Rory Walsh :
>>>>> Perhaps you can use filelen to find out the length of the sample
>>>>> you've loaded and then set the frequency according to the length and
>>>>> the sampling rate.
>>>>>
>>>>> Rory.
>>>>>
>>>>>
>>>>> On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
>>>>>> Is there a way to read an audio sample's (loaded by gen01) original
>>>>>> pitch in an instrument?
>>>>>> ... an opcode called "ftpitch" or something similar.
>>>>>> I guess this information must be available, as loscil can access it.
>>>>>> It would be handy when building all kinds of sample playback methods.
>>>>>>
>>>>>> best
>>>>>> Oeyvind
>>>>>>
>>>>>>
>>>>>> 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"
>>>
>>>
>>
>>
>>
>> --
>>
>>
>> Andrés
>>
>>
>> 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"
>
>



-- 


Andrés


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"


Date2010-04-02 13:33
FromOeyvind Brandtsegg
Subject[Csnd] Re: Re: Re: Re: Re: Re: read a sample's original pitch
Yes, exactly.
This will be very nice, looking forward to hear what you find.
best
Oeyvind

2010/4/2 andy fillebrown :
> That would be nice, but Oeyvind is talking about the user defined
> pitch in the  chunk that Soundforge lets you set (along with the
> other info in the chunk like loop start and end).  Since a lot of the
> gigasample and kontakt sample files have  chunks, too, it would
> be really nice to have access to that info in Csound instead of having
> to set the parameters manually each time.
>
> When I have more time I'd like to investigate the loscil opcode to see
> exactly how it works.  I strongly suspect it reads the  chunk,
> which would mean all the code to make an "ftpitch" opcode is already
> there.
>
> Cheers,
> ~ andy.f
>
>
>
> On Fri, Apr 2, 2010 at 3:02 AM, Andres Cabrera  wrote:
>> Hi,
>>
>> But you'd still have to have put the chunk in there, maybe Oeyvind
>> wants something automatic? I guess this could be a UDO, which scans
>> the table, and does pitch analysis for a few tens of milliseconds
>> after the attack, and store that...
>>
>> Cheers,
>> Andrés
>>
>> On Fri, Apr 2, 2010 at 2:50 AM, andy fillebrown
>>  wrote:
>>> A lot of times the sample will have attack and release section
>>> combined with a looping section.  In these cases it is generally only
>>> the looping section that will be at the correct pitch.  I'm not sure
>>> how this is implemented in aiff files, but in wav files all this info
>>> is stored in a  chunk, which is probably what loscil is reading.
>>>  Since the code is already there in loscil, it should be relatively
>>> simple to implement something that retrieves the separate sections of
>>> the  chunk (or its equivalent for other formats).  It would be a
>>> convenient way to use those kinds of samples in other opcodes, too,
>>> like diskin2 =)
>>>
>>> Cheers,
>>> ~ andy.f
>>>
>>>
>>>
>>> On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg  wrote:
>>>> Yes, I can do this, but I was thinking of the original pitch as in the
>>>> pitch of the audio in the file.
>>>> It is possible to save the (not necessarily correct, it's an arbitrary
>>>> value) pitch with the file, at least for aiff files.
>>>> In my editor (soundforge), I can set this in a dialog:
>>>> Special - Edit Sample
>>>> ... with a value called "Midi unity note of sample (C0 to G10)"
>>>>
>>>> This way the information of what midi key should play back the sample
>>>> untransposed can be stored in the file.
>>>> I only need to access this information in the instrument ... :-)
>>>>
>>>> best
>>>> Oeyvind
>>>>
>>>> 2010/4/1 Rory Walsh :
>>>>> Perhaps you can use filelen to find out the length of the sample
>>>>> you've loaded and then set the frequency according to the length and
>>>>> the sampling rate.
>>>>>
>>>>> Rory.
>>>>>
>>>>>
>>>>> On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
>>>>>> Is there a way to read an audio sample's (loaded by gen01) original
>>>>>> pitch in an instrument?
>>>>>> ... an opcode called "ftpitch" or something similar.
>>>>>> I guess this information must be available, as loscil can access it.
>>>>>> It would be handy when building all kinds of sample playback methods.
>>>>>>
>>>>>> best
>>>>>> Oeyvind
>>>>>>
>>>>>>
>>>>>> 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"
>>>
>>>
>>
>>
>>
>> --
>>
>>
>> Andrés
>>
>>
>> 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"


Date2010-04-02 14:02
Fromandy fillebrown
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: read a sample's original pitch
Interesting.  My curiosity is piqued!



On Fri, Apr 2, 2010 at 8:16 AM, Andres Cabrera  wrote:
> Hi,
>
> I would even suspect Csound already loads that chunk thourhg
> libsndfile when it creates the f-table, so it might actually be part
> of the f-table struct. So it would probably be very easy to make such
> an opcode.
>
> Cheers,
> Andrés
>
> On Fri, Apr 2, 2010 at 12:35 PM, andy fillebrown
>  wrote:
>> That would be nice, but Oeyvind is talking about the user defined
>> pitch in the  chunk that Soundforge lets you set (along with the
>> other info in the chunk like loop start and end).  Since a lot of the
>> gigasample and kontakt sample files have  chunks, too, it would
>> be really nice to have access to that info in Csound instead of having
>> to set the parameters manually each time.
>>
>> When I have more time I'd like to investigate the loscil opcode to see
>> exactly how it works.  I strongly suspect it reads the  chunk,
>> which would mean all the code to make an "ftpitch" opcode is already
>> there.
>>
>> Cheers,
>> ~ andy.f
>>
>>
>>
>> On Fri, Apr 2, 2010 at 3:02 AM, Andres Cabrera  wrote:
>>> Hi,
>>>
>>> But you'd still have to have put the chunk in there, maybe Oeyvind
>>> wants something automatic? I guess this could be a UDO, which scans
>>> the table, and does pitch analysis for a few tens of milliseconds
>>> after the attack, and store that...
>>>
>>> Cheers,
>>> Andrés
>>>
>>> On Fri, Apr 2, 2010 at 2:50 AM, andy fillebrown
>>>  wrote:
>>>> A lot of times the sample will have attack and release section
>>>> combined with a looping section.  In these cases it is generally only
>>>> the looping section that will be at the correct pitch.  I'm not sure
>>>> how this is implemented in aiff files, but in wav files all this info
>>>> is stored in a  chunk, which is probably what loscil is reading.
>>>>  Since the code is already there in loscil, it should be relatively
>>>> simple to implement something that retrieves the separate sections of
>>>> the  chunk (or its equivalent for other formats).  It would be a
>>>> convenient way to use those kinds of samples in other opcodes, too,
>>>> like diskin2 =)
>>>>
>>>> Cheers,
>>>> ~ andy.f
>>>>
>>>>
>>>>
>>>> On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg  wrote:
>>>>> Yes, I can do this, but I was thinking of the original pitch as in the
>>>>> pitch of the audio in the file.
>>>>> It is possible to save the (not necessarily correct, it's an arbitrary
>>>>> value) pitch with the file, at least for aiff files.
>>>>> In my editor (soundforge), I can set this in a dialog:
>>>>> Special - Edit Sample
>>>>> ... with a value called "Midi unity note of sample (C0 to G10)"
>>>>>
>>>>> This way the information of what midi key should play back the sample
>>>>> untransposed can be stored in the file.
>>>>> I only need to access this information in the instrument ... :-)
>>>>>
>>>>> best
>>>>> Oeyvind
>>>>>
>>>>> 2010/4/1 Rory Walsh :
>>>>>> Perhaps you can use filelen to find out the length of the sample
>>>>>> you've loaded and then set the frequency according to the length and
>>>>>> the sampling rate.
>>>>>>
>>>>>> Rory.
>>>>>>
>>>>>>
>>>>>> On 1 April 2010 14:50, Oeyvind Brandtsegg  wrote:
>>>>>>> Is there a way to read an audio sample's (loaded by gen01) original
>>>>>>> pitch in an instrument?
>>>>>>> ... an opcode called "ftpitch" or something similar.
>>>>>>> I guess this information must be available, as loscil can access it.
>>>>>>> It would be handy when building all kinds of sample playback methods.
>>>>>>>
>>>>>>> best
>>>>>>> Oeyvind
>>>>>>>
>>>>>>>
>>>>>>> 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"
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>> Andrés
>>>
>>>
>>> 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"
>>
>>
>
>
>
> --
>
>
> Andrés
>
>
> 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"


Date2010-04-02 14:05
FromVictor Lazzarini
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: read a sample's original pitch
I think something like that should do:

typedef struct _basf{
OPDS h;
MYFLT *ibas, *ifn;
}BASF;

int base_frequency_find(CSOUND *csound, BASF *p){

ftp = csound->FTnp2Find(csound,*p->ifn);
*p->ibas = ftp->cvtbas;

return OK;
}


and in csound code

ivar   basf   ifn

Victor

On 2 Apr 2010, at 13:33, Oeyvind Brandtsegg wrote:

> Yes, exactly.
> This will be very nice, looking forward to hear what you find.
> best
> Oeyvind
>
> 2010/4/2 andy fillebrown :
>> That would be nice, but Oeyvind is talking about the user defined
>> pitch in the  chunk that Soundforge lets you set (along with  
>> the
>> other info in the chunk like loop start and end).  Since a lot of the
>> gigasample and kontakt sample files have  chunks, too, it would
>> be really nice to have access to that info in Csound instead of  
>> having
>> to set the parameters manually each time.
>>
>> When I have more time I'd like to investigate the loscil opcode to  
>> see
>> exactly how it works.  I strongly suspect it reads the  chunk,
>> which would mean all the code to make an "ftpitch" opcode is already
>> there.
>>
>> Cheers,
>> ~ andy.f
>>
>>
>>
>> On Fri, Apr 2, 2010 at 3:02 AM, Andres Cabrera  
>>  wrote:
>>> Hi,
>>>
>>> But you'd still have to have put the chunk in there, maybe Oeyvind
>>> wants something automatic? I guess this could be a UDO, which scans
>>> the table, and does pitch analysis for a few tens of milliseconds
>>> after the attack, and store that...
>>>
>>> Cheers,
>>> Andrés
>>>
>>> On Fri, Apr 2, 2010 at 2:50 AM, andy fillebrown
>>>  wrote:
>>>> A lot of times the sample will have attack and release section
>>>> combined with a looping section.  In these cases it is generally  
>>>> only
>>>> the looping section that will be at the correct pitch.  I'm not  
>>>> sure
>>>> how this is implemented in aiff files, but in wav files all this  
>>>> info
>>>> is stored in a  chunk, which is probably what loscil is  
>>>> reading.
>>>>  Since the code is already there in loscil, it should be relatively
>>>> simple to implement something that retrieves the separate  
>>>> sections of
>>>> the  chunk (or its equivalent for other formats).  It would  
>>>> be a
>>>> convenient way to use those kinds of samples in other opcodes, too,
>>>> like diskin2 =)
>>>>
>>>> Cheers,
>>>> ~ andy.f
>>>>
>>>>
>>>>
>>>> On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg >>> > wrote:
>>>>> Yes, I can do this, but I was thinking of the original pitch as  
>>>>> in the
>>>>> pitch of the audio in the file.
>>>>> It is possible to save the (not necessarily correct, it's an  
>>>>> arbitrary
>>>>> value) pitch with the file, at least for aiff files.
>>>>> In my editor (soundforge), I can set this in a dialog:
>>>>> Special - Edit Sample
>>>>> ... with a value called "Midi unity note of sample (C0 to G10)"
>>>>>
>>>>> This way the information of what midi key should play back the  
>>>>> sample
>>>>> untransposed can be stored in the file.
>>>>> I only need to access this information in the instrument ... :-)
>>>>>
>>>>> best
>>>>> Oeyvind
>>>>>
>>>>> 2010/4/1 Rory Walsh :
>>>>>> Perhaps you can use filelen to find out the length of the sample
>>>>>> you've loaded and then set the frequency according to the  
>>>>>> length and
>>>>>> the sampling rate.
>>>>>>
>>>>>> Rory.
>>>>>>
>>>>>>
>>>>>> On 1 April 2010 14:50, Oeyvind Brandtsegg   
>>>>>> wrote:
>>>>>>> Is there a way to read an audio sample's (loaded by gen01)  
>>>>>>> original
>>>>>>> pitch in an instrument?
>>>>>>> ... an opcode called "ftpitch" or something similar.
>>>>>>> I guess this information must be available, as loscil can  
>>>>>>> access it.
>>>>>>> It would be handy when building all kinds of sample playback  
>>>>>>> methods.
>>>>>>>
>>>>>>> best
>>>>>>> Oeyvind
>>>>>>>
>>>>>>>
>>>>>>> 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"
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>>
>>> Andrés
>>>
>>>
>>> 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"


Date2010-04-02 14:08
FromVictor Lazzarini
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: read a sample's original pitch
correction:
FUNC *ftp = csound->FTnp2Find(csound,p->ifn);


On 2 Apr 2010, at 14:05, Victor Lazzarini wrote:

> I think something like that should do:
>
> typedef struct _basf{
> OPDS h;
> MYFLT *ibas, *ifn;
> }BASF;
>
> int base_frequency_find(CSOUND *csound, BASF *p){
>
> ftp = csound->FTnp2Find(csound,*p->ifn);
> *p->ibas = ftp->cvtbas;
>
> return OK;
> }
>
>
> and in csound code
>
> ivar   basf   ifn
>
> Victor
>
> On 2 Apr 2010, at 13:33, Oeyvind Brandtsegg wrote:
>
>> Yes, exactly.
>> This will be very nice, looking forward to hear what you find.
>> best
>> Oeyvind
>>
>> 2010/4/2 andy fillebrown :
>>> That would be nice, but Oeyvind is talking about the user defined
>>> pitch in the  chunk that Soundforge lets you set (along with  
>>> the
>>> other info in the chunk like loop start and end).  Since a lot of  
>>> the
>>> gigasample and kontakt sample files have  chunks, too, it  
>>> would
>>> be really nice to have access to that info in Csound instead of  
>>> having
>>> to set the parameters manually each time.
>>>
>>> When I have more time I'd like to investigate the loscil opcode to  
>>> see
>>> exactly how it works.  I strongly suspect it reads the  chunk,
>>> which would mean all the code to make an "ftpitch" opcode is already
>>> there.
>>>
>>> Cheers,
>>> ~ andy.f
>>>
>>>
>>>
>>> On Fri, Apr 2, 2010 at 3:02 AM, Andres Cabrera >> > wrote:
>>>> Hi,
>>>>
>>>> But you'd still have to have put the chunk in there, maybe Oeyvind
>>>> wants something automatic? I guess this could be a UDO, which scans
>>>> the table, and does pitch analysis for a few tens of milliseconds
>>>> after the attack, and store that...
>>>>
>>>> Cheers,
>>>> Andrés
>>>>
>>>> On Fri, Apr 2, 2010 at 2:50 AM, andy fillebrown
>>>>  wrote:
>>>>> A lot of times the sample will have attack and release section
>>>>> combined with a looping section.  In these cases it is generally  
>>>>> only
>>>>> the looping section that will be at the correct pitch.  I'm not  
>>>>> sure
>>>>> how this is implemented in aiff files, but in wav files all this  
>>>>> info
>>>>> is stored in a  chunk, which is probably what loscil is  
>>>>> reading.
>>>>> Since the code is already there in loscil, it should be relatively
>>>>> simple to implement something that retrieves the separate  
>>>>> sections of
>>>>> the  chunk (or its equivalent for other formats).  It  
>>>>> would be a
>>>>> convenient way to use those kinds of samples in other opcodes,  
>>>>> too,
>>>>> like diskin2 =)
>>>>>
>>>>> Cheers,
>>>>> ~ andy.f
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Apr 1, 2010 at 8:32 PM, Oeyvind Brandtsegg >>>> > wrote:
>>>>>> Yes, I can do this, but I was thinking of the original pitch as  
>>>>>> in the
>>>>>> pitch of the audio in the file.
>>>>>> It is possible to save the (not necessarily correct, it's an  
>>>>>> arbitrary
>>>>>> value) pitch with the file, at least for aiff files.
>>>>>> In my editor (soundforge), I can set this in a dialog:
>>>>>> Special - Edit Sample
>>>>>> ... with a value called "Midi unity note of sample (C0 to G10)"
>>>>>>
>>>>>> This way the information of what midi key should play back the  
>>>>>> sample
>>>>>> untransposed can be stored in the file.
>>>>>> I only need to access this information in the instrument ... :-)
>>>>>>
>>>>>> best
>>>>>> Oeyvind
>>>>>>
>>>>>> 2010/4/1 Rory Walsh :
>>>>>>> Perhaps you can use filelen to find out the length of the sample
>>>>>>> you've loaded and then set the frequency according to the  
>>>>>>> length and
>>>>>>> the sampling rate.
>>>>>>>
>>>>>>> Rory.
>>>>>>>
>>>>>>>
>>>>>>> On 1 April 2010 14:50, Oeyvind Brandtsegg   
>>>>>>> wrote:
>>>>>>>> Is there a way to read an audio sample's (loaded by gen01)  
>>>>>>>> original
>>>>>>>> pitch in an instrument?
>>>>>>>> ... an opcode called "ftpitch" or something similar.
>>>>>>>> I guess this information must be available, as loscil can  
>>>>>>>> access it.
>>>>>>>> It would be handy when building all kinds of sample playback  
>>>>>>>> methods.
>>>>>>>>
>>>>>>>> best
>>>>>>>> Oeyvind
>>>>>>>>
>>>>>>>>
>>>>>>>> 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"
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>> Andrés
>>>>
>>>>
>>>> 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"
>



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"


Date2010-04-02 22:02
Fromthorin kerr
Subject[Csnd] Re: read a sample's original pitch
The sndinfo utility gives you this info too.

I seem to remember you're a pythonista Oeyvind. Well, for what it's
worth, you can access sndinfo output from python doing something along
the lines of:

import sys
class Whatever()

.... cs = some csound instance...
.... path = path to audio file ...

        args = csnd.CsoundArgVList()
        args.Append('sndinfo')
        args.Append('-i')
        args.Append(path)
        old_stdout = sys.stdout
        sys.stdout = self         #yes... change the standard output.
        err = self.cs.RunUtility('sndinfo', args.argc(), args.argv())
        sys.stdout = old_stdout  #probably ought to put it back the way it was.

        sys.stdout = self
        err = self.cs.RunUtility('sndinfo', args.argc(), args.argv())

def write(self, char):
    ... the write method of your class intercepts the characters
(char) from stdout... so, just collect them somewhere.




TK


On Thu, Apr 1, 2010 at 11:50 PM, Oeyvind Brandtsegg  wrote:
> Is there a way to read an audio sample's (loaded by gen01) original
> pitch in an instrument?
> ... an opcode called "ftpitch" or something similar.
> I guess this information must be available, as loscil can access it.
> It would be handy when building all kinds of sample playback methods.
>
> best
> Oeyvind
>
>
> 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"


Date2010-04-02 22:10
Fromjoachim heintz
Subject[Csnd] Re: Re: read a sample's original pitch
or get the  chunk by python and receive it in a csound  
instrument via the python opcodes?


Am 02.04.2010 um 23:02 schrieb thorin kerr:

> The sndinfo utility gives you this info too.
>
> I seem to remember you're a pythonista Oeyvind. Well, for what it's
> worth, you can access sndinfo output from python doing something along
> the lines of:
>
> import sys
> class Whatever()
>
> .... cs = some csound instance...
> .... path = path to audio file ...
>
>        args = csnd.CsoundArgVList()
>        args.Append('sndinfo')
>        args.Append('-i')
>        args.Append(path)
>        old_stdout = sys.stdout
>        sys.stdout = self         #yes... change the standard output.
>        err = self.cs.RunUtility('sndinfo', args.argc(), args.argv())
>        sys.stdout = old_stdout  #probably ought to put it back the  
> way it was.
>
>        sys.stdout = self
>        err = self.cs.RunUtility('sndinfo', args.argc(), args.argv())
>
> def write(self, char):
>    ... the write method of your class intercepts the characters
> (char) from stdout... so, just collect them somewhere.
>
>
>
>
> TK
>
>
> On Thu, Apr 1, 2010 at 11:50 PM, Oeyvind Brandtsegg  > wrote:
>> Is there a way to read an audio sample's (loaded by gen01) original
>> pitch in an instrument?
>> ... an opcode called "ftpitch" or something similar.
>> I guess this information must be available, as loscil can access it.
>> It would be handy when building all kinds of sample playback methods.
>>
>> best
>> Oeyvind
>>
>>
>> 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"

Date2010-04-02 23:10
FromOeyvind Brandtsegg
Subject[Csnd] Re: Re: read a sample's original pitch
Ha, yes, it would be tempting to do something in Python to work around it :-),
but for the particular application I'm working would rather not do that.
I'm doing a MaxForLive device, and there's already Live-running
Max-running-Csound, so it's an unsteady cardboard-house as it is
without adding Python on top of it...
best
Oeyvind

2010/4/2 thorin kerr :
> The sndinfo utility gives you this info too.
>
> I seem to remember you're a pythonista Oeyvind. Well, for what it's
> worth, you can access sndinfo output from python doing something along
> the lines of:
>
> import sys
> class Whatever()
>
> .... cs = some csound instance...
> .... path = path to audio file ...
>
>        args = csnd.CsoundArgVList()
>        args.Append('sndinfo')
>        args.Append('-i')
>        args.Append(path)
>        old_stdout = sys.stdout
>        sys.stdout = self         #yes... change the standard output.
>        err = self.cs.RunUtility('sndinfo', args.argc(), args.argv())
>        sys.stdout = old_stdout  #probably ought to put it back the way it was.
>
>        sys.stdout = self
>        err = self.cs.RunUtility('sndinfo', args.argc(), args.argv())
>
> def write(self, char):
>    ... the write method of your class intercepts the characters
> (char) from stdout... so, just collect them somewhere.
>
>
>
>
> TK
>
>
> On Thu, Apr 1, 2010 at 11:50 PM, Oeyvind Brandtsegg  wrote:
>> Is there a way to read an audio sample's (loaded by gen01) original
>> pitch in an instrument?
>> ... an opcode called "ftpitch" or something similar.
>> I guess this information must be available, as loscil can access it.
>> It would be handy when building all kinds of sample playback methods.
>>
>> best
>> Oeyvind
>>
>>
>> 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"