Csound Csound-dev Csound-tekno Search About

[Csnd] sfplay, microtuning

Date2011-02-28 08:03
FromStefan Thomas
Subject[Csnd] sfplay, microtuning
Dear community,
I've read in the manual about sfplay:

ar1, ar2 sfplay ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [,
ioffset] [, ienv]
I would like to ask:
how can I use a microtonal-scale generated with cpstmid e.g. with this opcode?


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-02-28 14:22
FromJoel Ross
SubjectRe: [Csnd] sfplay, microtuning
Hi Stefan,

It seems that there is not a frequency to midi converter opcode, but
something like this will do it:

ifreq cpstmid itable
inotevalue = (69. + (1./.057762265) * log( ifreq / 440.))
(modified from the max manual)

- Joel

On 28 February 2011 09:03, Stefan Thomas
 wrote:
> Dear community,
> I've read in the manual about sfplay:
>
> ar1, ar2 sfplay ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [,
> ioffset] [, ienv]
> I would like to ask:
> how can I use a microtonal-scale generated with cpstmid e.g. with this opcode?
>
>
> 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-02-28 16:05
FromAaron Krister Johnson
SubjectRe: [Csnd] sfplay, microtuning
Stefan,

This is (somewhat) equivalent to what Joel is saying:

inotenum  = int(round((log(ifreq/440)/log(2))*12))+69

I just want to point out that you want to feed the 'inotenum' so the nearest sample to the target pitch is chosen in the sample bank....of course, the actual frequency is fed into the 'xfreq' parameter....make sure 'iflag' is set to '1' so that 'xfreq' is interpreted correctly as the literal pitch you want (i.e. 'inotenum' is just there so that the nearest sample is chosen, really)

Caveat emptor---certain soundfonts I've tried (notably Campbell's tuned harpsichord) seem REALLY loud when used by sfplay, to the point of distortion. I don't know if it's a bug, but I've found by experiement that if you have a really distorted, loud sound, it helps to put a 'xamp' correction factor in there, where xamp is between 0 and 1....


AKJ


On Mon, Feb 28, 2011 at 8:22 AM, Joel Ross <joel.binarybrain@gmail.com> wrote:
Hi Stefan,

It seems that there is not a frequency to midi converter opcode, but
something like this will do it:

ifreq cpstmid itable
inotevalue = (69. + (1./.057762265) * log( ifreq / 440.))
(modified from the max manual)

- Joel

On 28 February 2011 09:03, Stefan Thomas
<kontrapunktstefan@googlemail.com> wrote:
> Dear community,
> I've read in the manual about sfplay:
>
> ar1, ar2 sfplay ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [,
> ioffset] [, ienv]
> I would like to ask:
> how can I use a microtonal-scale generated with cpstmid e.g. with this opcode?
>
>
> 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"




--
Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org


Date2011-03-01 21:07
FromStefan Thomas
SubjectRe: [Csnd] sfplay, microtuning
Dear Aaron,
thanks very much!
I will try Your code!

2011/2/28 Aaron Krister Johnson :
> Stefan,
>
> This is (somewhat) equivalent to what Joel is saying:
>
> inotenum  = int(round((log(ifreq/440)/log(2))*12))+69
>
> I just want to point out that you want to feed the 'inotenum' so the nearest
> sample to the target pitch is chosen in the sample bank....of course, the
> actual frequency is fed into the 'xfreq' parameter....make sure 'iflag' is
> set to '1' so that 'xfreq' is interpreted correctly as the literal pitch you
> want (i.e. 'inotenum' is just there so that the nearest sample is chosen,
> really)
>
> Caveat emptor---certain soundfonts I've tried (notably Campbell's tuned
> harpsichord) seem REALLY loud when used by sfplay, to the point of
> distortion. I don't know if it's a bug, but I've found by experiement that
> if you have a really distorted, loud sound, it helps to put a 'xamp'
> correction factor in there, where xamp is between 0 and 1....
>
>
> AKJ
>
>
> On Mon, Feb 28, 2011 at 8:22 AM, Joel Ross 
> wrote:
>>
>> Hi Stefan,
>>
>> It seems that there is not a frequency to midi converter opcode, but
>> something like this will do it:
>>
>> ifreq cpstmid itable
>> inotevalue = (69. + (1./.057762265) * log( ifreq / 440.))
>> (modified from the max manual)
>>
>> - Joel
>>
>> On 28 February 2011 09:03, Stefan Thomas
>>  wrote:
>> > Dear community,
>> > I've read in the manual about sfplay:
>> >
>> > ar1, ar2 sfplay ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [,
>> > ioffset] [, ienv]
>> > I would like to ask:
>> > how can I use a microtonal-scale generated with cpstmid e.g. with this
>> > opcode?
>> >
>> >
>> > 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"
>>
>
>
>
> --
> Aaron Krister Johnson
> http://www.akjmusic.com
> http://www.untwelve.org
>
>


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"