Csound Csound-dev Csound-tekno Search About

[Csnd] FM B3 broken?

Date2018-12-16 12:14
FromRichard
Subject[Csnd] FM B3 broken?

Is FM B3 broken? I only get a single pitch note with this csd (csound 6.09.1 on OS X):

<CsoundSynthesizer>

<CsOptions>

-odac1 -Ma

</CsOptions>

<CsInstruments>

0dbfs=1

instr 1

;print p4,p5

ifreq cpsmidi

iamp ampmidi 0dbfs * 0.3

kenv madsr 0.001, 0, iamp, 0.2

kc1 = 1 ; mod index

kc2 = 1 ; cross fade

kvrate = 6

kvdpth line 0, p3, .1

asig fmb3 kenv, k(ifreq), kc1, kc2, kvdpth, kvrate

outs asig/2, asig/2

endin

</CsInstruments>

<CsScore>

</CsScore>

</CsoundSynthesizer>


Date2018-12-16 13:05
Fromzappfinger
SubjectRe: [Csnd] FM B3 broken?
BTW, FM2ModCar.csd (an example in QtCsound) has this same behaviour: only a
single tone is produced.
Other examples work ok in Qt



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-16 15:49
Fromjoachim heintz
SubjectRe: [Csnd] FM B3 broken?
i expect a single tone with a variable spectrum, not?  and that's what i 
hear.
not sure it is because you use an old csound version; perhaps you 
upgrade to 6.12?

	joachim



On 16/12/18 14:05, zappfinger wrote:
> BTW, FM2ModCar.csd (an example in QtCsound) has this same behaviour: only a
> single tone is produced.
> Other examples work ok in Qt
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-16 17:19
FromRichard
SubjectRe: [Csnd] FM B3 broken?
Ok its working, I must have had some wrong parameters to the fmb3 call...

On 16/12/2018 16:49, joachim heintz wrote:

> i expect a single tone with a variable spectrum, not?  and that's what 
> i hear.
> not sure it is because you use an old csound version; perhaps you 
> upgrade to 6.12?
>
>     joachim
>
>
>
> On 16/12/18 14:05, zappfinger wrote:
>> BTW, FM2ModCar.csd (an example in QtCsound) has this same behaviour: 
>> only a
>> single tone is produced.
>> Other examples work ok in Qt
>>
>>
>>
>> -- 
>> Sent from: 
>> http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-17 02:20
FromPete Goodeve
SubjectRe: [Csnd] FM B3 broken?
AttachmentsNone  

Date2018-12-17 07:42
FromRichard van Bemmelen
SubjectRe: [Csnd] FM B3 broken?
I changed the vibrato depth kvdpth to a fixed, low value (0.1) and then it sort of worked.
It looks like the algorythm is a bit unstable, because when I play the midi keyboard with very low velocity, the high pitch note returns...
Almost like a resonant peak.

Richard

Op ma 17 dec. 2018 om 03:20 schreef Pete Goodeve <pete.goodeve@computer.org>:
> Ok its working, I must have had some wrong parameters to the fmb3 call...

So what exactly did you do?  I thought I'd check for myself, and whatever
I do I get that single note (D in the octave above middle-C)!  I've tried
in both Csound5(where the table parameters are not optional) and
 Csound6 (where they are).

What's really odd is that fmb3.csd seems to work fine.  By default
it uses 220Hz, but if I change it to 440, say, it's fine with that, too.
I edited the file to use a score parameter for pitch, and that's fine
as well,  However, as soon as I try to get the pitch from MIDI, it
goes back to the monotonous 'D'!

Totally befuddled...!

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2018-12-17 12:33
Fromjpff
SubjectRe: [Csnd] FM B3 broken?
Not having a MIDI setup I have kept out of this discusson.  However in the 
cases wen it misbehaves what are the actural pitch and amplitude 
parameters fet to fmb3?  If the self-same parameters work from the score 
then the issue lies with MIDi.  If t does not hen there is a case for 
investigation of the opcode.
==John ff


On Sun, 16 Dec 2018, Pete Goodeve wrote:

>> Ok its working, I must have had some wrong parameters to the fmb3 call...
>
> So what exactly did you do?  I thought I'd check for myself, and whatever
> I do I get that single note (D in the octave above middle-C)!  I've tried
> in both Csound5(where the table parameters are not optional) and
> Csound6 (where they are).
>
> What's really odd is that fmb3.csd seems to work fine.  By default
> it uses 220Hz, but if I change it to 440, say, it's fine with that, too.
> I edited the file to use a score parameter for pitch, and that's fine
> as well,  However, as soon as I try to get the pitch from MIDI, it
> goes back to the monotonous 'D'!
>
> Totally befuddled...!
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-17 22:18
FromRichard
SubjectRe: [Csnd] FM B3 broken?
I can reproduce it by setting the vibrato depth to 0...

On 17/12/2018 13:33, jpff wrote:
> Not having a MIDI setup I have kept out of this discusson.  However in 
> the cases wen it misbehaves what are the actural pitch and amplitude 
> parameters fet to fmb3?  If the self-same parameters work from the 
> score then the issue lies with MIDi.  If t does not hen there is a 
> case for investigation of the opcode.
> ==John ff
>
>
> On Sun, 16 Dec 2018, Pete Goodeve wrote:
>
>>> Ok its working, I must have had some wrong parameters to the fmb3 
>>> call...
>>
>> So what exactly did you do?  I thought I'd check for myself, and 
>> whatever
>> I do I get that single note (D in the octave above middle-C)! I've tried
>> in both Csound5(where the table parameters are not optional) and
>> Csound6 (where they are).
>>
>> What's really odd is that fmb3.csd seems to work fine.  By default
>> it uses 220Hz, but if I change it to 440, say, it's fine with that, too.
>> I edited the file to use a score parameter for pitch, and that's fine
>> as well,  However, as soon as I try to get the pitch from MIDI, it
>> goes back to the monotonous 'D'!
>>
>> Totally befuddled...!
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-17 22:20
FromPete Goodeve
SubjectRe: [Csnd] FM B3 broken?
AttachmentsNone  

Date2018-12-17 22:23
FromPete Goodeve
SubjectRe: [Csnd] FM B3 broken?
AttachmentsNone  

Date2018-12-19 19:37
Fromjpff
SubjectRe: [Csnd] FM B3 broken?
If the vibraro deo
pth is a constat zero I hear a higher note but if the depth decreases to 
zero I do nit get anyting odd.  Also looking at the spectrum seems not to 
have anything untowards.  I did try te other B3 opcode but did not work 
out how to use it yet (STKBeeThree)

I wil look at the originak code if I can find it.


On Mon, 17 Dec 2018, Pete Goodeve wrote:

> On Mon, Dec 17, 2018 at 11:18:44PM +0100, Richard wrote:
>> I can reproduce it by setting the vibrato depth to 0...
>
> Oops!  Crossed mails... (:-/)
>
> 	-- Pete --
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-19 21:46
Fromjpff
SubjectRe: [Csnd] FM B3 broken?
I think it is an initiakisation ting.  If I call rhe samre note twie with 
identical parameters the first ishigh, the second is OK
Not sure what yet.
>
> On Mon, 17 Dec 2018, Pete Goodeve wrote:
>
>> On Mon, Dec 17, 2018 at 11:18:44PM +0100, Richard wrote:
>>> I can reproduce it by setting the vibrato depth to 0...
>> 
>> Oops!  Crossed mails... (:-/)
>>
>> 	-- Pete --
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> 
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-20 04:24
FromPete Goodeve
SubjectRe: [Csnd] FM B3 broken?
AttachmentsNone  

Date2018-12-20 06:41
FromPete Goodeve
SubjectRe: [Csnd] FM B3 broken?
AttachmentsNone  

Date2018-12-20 11:01
FromJohn ff
SubjectRe: [Csnd] FM B3 broken?
I noticed that and changed the code to zero affect

⁣Sent from TypeApp ​

On Dec 20, 2018, 06:42, at 06:42, Pete Goodeve  wrote:
>I'd guess this is the problem:
>
>In fm4op.c: hammondB3(...):
>
>	....
>      if (*p->modDepth > FL(0.0)) {
>        p->v_rate = *p->vibFreq * p->vibWave->flen * csound->onedsr;
>        temp = FL(1.0) + (*p->modDepth * FL(0.1) *
>                          Wave_tick(&p->v_time, (int)p->vibWave->flen,
>                              p->vibWave->ftable, p->v_rate, FL(0.0)));
>        temp *= p->baseFreq * csound->onedsr;
>        p->w_rate[0] = p->ratios[0] * temp * p->waves[0]->flen;
>        p->w_rate[1] = p->ratios[1] * temp * p->waves[1]->flen;
>        p->w_rate[2] = p->ratios[2] * temp * p->waves[2]->flen;
>        p->w_rate[3] = p->ratios[3] * temp * p->waves[3]->flen;
>      }
>      lastOutput = FM4Alg8_tick(p, c1, c2);
>	....
>
>All those variables never get set if modDepth is never
>greater-than-zero,
>but FM4Alg8_tick(...) uses them!
>
>Strangely none of the other 'fm...' opcodes has any value check
>on modDepth, but if it is necessary, some default computations
>in an else clause should fix things, i'd think.  [Can't conveniently
>compile right now, so I can't verify...]
>
>	-- Pete --
>
>
>
>On Wed, Dec 19, 2018 at 08:24:37PM -0800, Pete Goodeve wrote:
>> On Wed, Dec 19, 2018 at 07:37:18PM +0000, jpff wrote:
>> > If the vibraro depth is a constat zero I hear a higher note but if
>the depth decreases to zero I do nit get anyting odd.
>> 
>> Confirmed...  With a single score note sustained for a few seconds,
>> if I use something like:
>>   kvdpth linseg 0.2, p3/2, 0.0, p3/2, 0.0
>> the vibrato just decays to nothing and the pitch stays steady.
>> 
>> If I use:
>>   kvdpth linseg 0.0, p3/2, 0.0, p3/2, 0.2
>> the pitch is wrong to start, but corrects as soon as kvdepth
>> rises from zero.
>> 
>> 	-- Pete --
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>Csound mailing list
>Csound@listserv.heanet.ie
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-20 18:30
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] FM B3 broken?
AttachmentsNone  

Date2018-12-20 23:50
Fromjpff
SubjectRe: [Csnd] FM B3 broken?
Oh dear -- my test program was wrong.  It was the initialisation of w_rate 
after all.  Will commit fix next.

On Thu, 20 Dec 2018, pete.goodeve@COMPUTER.ORG wrote:

> On Thu, Dec 20, 2018 at 11:01:32AM +0000, John ff wrote:
>> I noticed that and changed the code to zero affect
>
> That's.... really strange!  No further ideas right now.
>
> 	-- Pete --
>
> :>
>>
>> On Dec 20, 2018, 06:42, at 06:42, Pete Goodeve  wrote:
>>> I'd guess this is the problem:
>>>
>>> In fm4op.c: hammondB3(...):
>>>
>>> 	....
>>>      if (*p->modDepth > FL(0.0)) {
>>>        p->v_rate = *p->vibFreq * p->vibWave->flen * csound->onedsr;
>>>        temp = FL(1.0) + (*p->modDepth * FL(0.1) *
>>>                          Wave_tick(&p->v_time, (int)p->vibWave->flen,
>>>                              p->vibWave->ftable, p->v_rate, FL(0.0)));
>>>        temp *= p->baseFreq * csound->onedsr;
>>>        p->w_rate[0] = p->ratios[0] * temp * p->waves[0]->flen;
>>>        p->w_rate[1] = p->ratios[1] * temp * p->waves[1]->flen;
>>>        p->w_rate[2] = p->ratios[2] * temp * p->waves[2]->flen;
>>>        p->w_rate[3] = p->ratios[3] * temp * p->waves[3]->flen;
>>>      }
>>>      lastOutput = FM4Alg8_tick(p, c1, c2);
>>> 	....
>>>
>>> All those variables never get set if modDepth is never
>>> greater-than-zero,
>>> but FM4Alg8_tick(...) uses them!
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-12-21 03:50
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] FM B3 broken?
AttachmentsNone