Csound Csound-dev Csound-tekno Search About

[Csnd] Code Share: Rhythmic FM Waves

Date2020-09-25 02:53
FromSteven Yi
Subject[Csnd] Code Share: Rhythmic FM Waves
Hi All,

I thought I'd share another sound design using 4 operator FM that has
a Cascade + Parallel Modulator setup:

https://ide.csound.com/editor/V98HgenVwUWDhF4EW3r3

The primary instrument code is as follows:

instr FM4OP
  ifreq = p4
  kfreq = oscil(p5, array(1,4,2,3,7)) * ifreq

  kmodfreq = kfreq
  kmodfreq2 = kfreq * 4

  amod2 = oscili(kmodfreq2 * oscil(.7, array(0,4,2,3,5)), kmodfreq2)
  amod = oscili(kmodfreq * oscil(1, array(0,4,5,1,3)), kmodfreq + amod2)

  amodp = oscili(ifreq * 6 * expon:a(4, p3, .001), ifreq * 6)
  asig = oscili(.25, kfreq + amod + amodp)

  asig *= expon:a(0.5, p3, .001)

  pan_verb_mix(asig, random:i(0.3, 0.7), 0.5)
endin

(Uses an oscil UDO from livecode.orc that accepts arrays for
wavetable; pan_verb_mix is also from that library and is for hooking
into the mixer)

The layout of operators is [ amod2 -> amod  -> asig ] for the cascade
and amodp for the additional parallel modulator.

I rather enjoyed this one as I thought the rhythmic modulation of the
indices at different rates made for an interesting evolution of
timbre. (Reminded me a little of Korg-style wave sequencing.)

Enjoy!
Steven

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

Date2020-09-25 08:03
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Code Share: Rhythmic FM Waves
Nice sounds!
I was unfamiliar with the use of arrays to make a sequence of frequencies for an oscillator. Could you help me understand how this works:
 oscil(p5, array(1,4,2,3,7))
?
All best
Øyvind

fre. 25. sep. 2020 kl. 03:53 skrev Steven Yi <stevenyi@gmail.com>:
Hi All,

I thought I'd share another sound design using 4 operator FM that has
a Cascade + Parallel Modulator setup:

https://ide.csound.com/editor/V98HgenVwUWDhF4EW3r3

The primary instrument code is as follows:

instr FM4OP
  ifreq = p4
  kfreq = oscil(p5, array(1,4,2,3,7)) * ifreq

  kmodfreq = kfreq
  kmodfreq2 = kfreq * 4

  amod2 = oscili(kmodfreq2 * oscil(.7, array(0,4,2,3,5)), kmodfreq2)
  amod = oscili(kmodfreq * oscil(1, array(0,4,5,1,3)), kmodfreq + amod2)

  amodp = oscili(ifreq * 6 * expon:a(4, p3, .001), ifreq * 6)
  asig = oscili(.25, kfreq + amod + amodp)

  asig *= expon:a(0.5, p3, .001)

  pan_verb_mix(asig, random:i(0.3, 0.7), 0.5)
endin

(Uses an oscil UDO from livecode.orc that accepts arrays for
wavetable; pan_verb_mix is also from that library and is for hooking
into the mixer)

The layout of operators is [ amod2 -> amod  -> asig ] for the cascade
and amodp for the additional parallel modulator.

I rather enjoyed this one as I thought the rhythmic modulation of the
indices at different rates made for an interesting evolution of
timbre. (Reminded me a little of Korg-style wave sequencing.)

Enjoy!
Steven

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

Date2020-09-25 14:56
FromSteven Yi
SubjectRe: [Csnd] Code Share: Rhythmic FM Waves
Thanks!  The oscil is a UDO from livecode.orc here:

https://github.com/kunstmusik/csound-live-code/blob/master/livecode.orc#L966-L974

and the code is pretty simple:

/** Custom non-interpolating oscil that takes in kfrequency and array
to use as oscillator table
data. Outputs k-rate signal. */
opcode oscil, k, kk[]
  kfreq, kin[] xin
  ilen = lenarray(kin)
  kphs = phasor:k(kfreq)
  kout = kin[int(kphs * ilen) % ilen]
  xout kout
endop

It's going to copy the array input every k-pass as that's what happens
with UDOs in CS6 but otherwise it works out well.

On Fri, Sep 25, 2020 at 3:03 AM Oeyvind Brandtsegg  wrote:
>
> Nice sounds!
> I was unfamiliar with the use of arrays to make a sequence of frequencies for an oscillator. Could you help me understand how this works:
>  oscil(p5, array(1,4,2,3,7))
> ?
> All best
> Øyvind
>
> fre. 25. sep. 2020 kl. 03:53 skrev Steven Yi :
>>
>> Hi All,
>>
>> I thought I'd share another sound design using 4 operator FM that has
>> a Cascade + Parallel Modulator setup:
>>
>> https://ide.csound.com/editor/V98HgenVwUWDhF4EW3r3
>>
>> The primary instrument code is as follows:
>>
>> instr FM4OP
>>   ifreq = p4
>>   kfreq = oscil(p5, array(1,4,2,3,7)) * ifreq
>>
>>   kmodfreq = kfreq
>>   kmodfreq2 = kfreq * 4
>>
>>   amod2 = oscili(kmodfreq2 * oscil(.7, array(0,4,2,3,5)), kmodfreq2)
>>   amod = oscili(kmodfreq * oscil(1, array(0,4,5,1,3)), kmodfreq + amod2)
>>
>>   amodp = oscili(ifreq * 6 * expon:a(4, p3, .001), ifreq * 6)
>>   asig = oscili(.25, kfreq + amod + amodp)
>>
>>   asig *= expon:a(0.5, p3, .001)
>>
>>   pan_verb_mix(asig, random:i(0.3, 0.7), 0.5)
>> endin
>>
>> (Uses an oscil UDO from livecode.orc that accepts arrays for
>> wavetable; pan_verb_mix is also from that library and is for hooking
>> into the mixer)
>>
>> The layout of operators is [ amod2 -> amod  -> asig ] for the cascade
>> and amodp for the additional parallel modulator.
>>
>> I rather enjoyed this one as I thought the rhythmic modulation of the
>> indices at different rates made for an interesting evolution of
>> timbre. (Reminded me a little of Korg-style wave sequencing.)
>>
>> Enjoy!
>> Steven
>>
>> 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

Date2020-09-25 17:40
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Code Share: Rhythmic FM Waves
Ah that is neat! 

fre. 25. sep. 2020, 3:56 p.m. skrev Steven Yi <stevenyi@gmail.com>:
Thanks!  The oscil is a UDO from livecode.orc here:

https://github.com/kunstmusik/csound-live-code/blob/master/livecode.orc#L966-L974

and the code is pretty simple:

/** Custom non-interpolating oscil that takes in kfrequency and array
to use as oscillator table
data. Outputs k-rate signal. */
opcode oscil, k, kk[]
  kfreq, kin[] xin
  ilen = lenarray(kin)
  kphs = phasor:k(kfreq)
  kout = kin[int(kphs * ilen) % ilen]
  xout kout
endop

It's going to copy the array input every k-pass as that's what happens
with UDOs in CS6 but otherwise it works out well.

On Fri, Sep 25, 2020 at 3:03 AM Oeyvind Brandtsegg <obrandts@gmail.com> wrote:
>
> Nice sounds!
> I was unfamiliar with the use of arrays to make a sequence of frequencies for an oscillator. Could you help me understand how this works:
>  oscil(p5, array(1,4,2,3,7))
> ?
> All best
> Øyvind
>
> fre. 25. sep. 2020 kl. 03:53 skrev Steven Yi <stevenyi@gmail.com>:
>>
>> Hi All,
>>
>> I thought I'd share another sound design using 4 operator FM that has
>> a Cascade + Parallel Modulator setup:
>>
>> https://ide.csound.com/editor/V98HgenVwUWDhF4EW3r3
>>
>> The primary instrument code is as follows:
>>
>> instr FM4OP
>>   ifreq = p4
>>   kfreq = oscil(p5, array(1,4,2,3,7)) * ifreq
>>
>>   kmodfreq = kfreq
>>   kmodfreq2 = kfreq * 4
>>
>>   amod2 = oscili(kmodfreq2 * oscil(.7, array(0,4,2,3,5)), kmodfreq2)
>>   amod = oscili(kmodfreq * oscil(1, array(0,4,5,1,3)), kmodfreq + amod2)
>>
>>   amodp = oscili(ifreq * 6 * expon:a(4, p3, .001), ifreq * 6)
>>   asig = oscili(.25, kfreq + amod + amodp)
>>
>>   asig *= expon:a(0.5, p3, .001)
>>
>>   pan_verb_mix(asig, random:i(0.3, 0.7), 0.5)
>> endin
>>
>> (Uses an oscil UDO from livecode.orc that accepts arrays for
>> wavetable; pan_verb_mix is also from that library and is for hooking
>> into the mixer)
>>
>> The layout of operators is [ amod2 -> amod  -> asig ] for the cascade
>> and amodp for the additional parallel modulator.
>>
>> I rather enjoyed this one as I thought the rhythmic modulation of the
>> indices at different rates made for an interesting evolution of
>> timbre. (Reminded me a little of Korg-style wave sequencing.)
>>
>> Enjoy!
>> Steven
>>
>> 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
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

Date2020-10-01 22:34
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] Code Share: Rhythmic FM Waves
nice.  thanks.  

Dr. Richard Boulanger



On Thu, Sep 24, 2020 at 9:54 PM Steven Yi <stevenyi@gmail.com> wrote:
Hi All,

I thought I'd share another sound design using 4 operator FM that has
a Cascade + Parallel Modulator setup:

https://us-west-2.protection.sophos.com?d=csound.com&u=aHR0cHM6Ly9pZGUuY3NvdW5kLmNvbS9lZGl0b3IvVjk4SGdlblZ3VVdEaEY0RVczcjM=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=OVZKVTJuekxzU0R0RXhqdGlPL2hZVFhLOUlsZnlEWW5ZNVVyY2tmb3VZST0=&h=cfdbc9d3bcff48b5a72e39b73a8b34b9

The primary instrument code is as follows:

instr FM4OP
  ifreq = p4
  kfreq = oscil(p5, array(1,4,2,3,7)) * ifreq

  kmodfreq = kfreq
  kmodfreq2 = kfreq * 4

  amod2 = oscili(kmodfreq2 * oscil(.7, array(0,4,2,3,5)), kmodfreq2)
  amod = oscili(kmodfreq * oscil(1, array(0,4,5,1,3)), kmodfreq + amod2)

  amodp = oscili(ifreq * 6 * expon:a(4, p3, .001), ifreq * 6)
  asig = oscili(.25, kfreq + amod + amodp)

  asig *= expon:a(0.5, p3, .001)

  pan_verb_mix(asig, random:i(0.3, 0.7), 0.5)
endin

(Uses an oscil UDO from livecode.orc that accepts arrays for
wavetable; pan_verb_mix is also from that library and is for hooking
into the mixer)

The layout of operators is [ amod2 -> amod  -> asig ] for the cascade
and amodp for the additional parallel modulator.

I rather enjoyed this one as I thought the rhythmic modulation of the
indices at different rates made for an interesting evolution of
timbre. (Reminded me a little of Korg-style wave sequencing.)

Enjoy!
Steven

Csound mailing list
Csound@listserv.heanet.ie
https://us-west-2.protection.sophos.com?d=heanet.ie&u=aHR0cHM6Ly9saXN0c2Vydi5oZWFuZXQuaWUvY2dpLWJpbi93YT9BMD1DU09VTkQ=&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=V2MrMzVGMU1BZEZaZ1lZck9kUnhTTC9YN1BHMnUxSDd4THhWY0dLeURxYz0=&h=cfdbc9d3bcff48b5a72e39b73a8b34b9
Send bugs reports to
        https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9jc291bmQvaXNzdWVz&e=cmJvdWxhbmdlckBiZXJrbGVlLmVkdQ==&t=cWpnbGx6KzZUci9yQkZQMDNaTDdyZFdzK1l1WDE0TVhzOXR1dHltRUx5RT0=&h=cfdbc9d3bcff48b5a72e39b73a8b34b9
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