Csound Csound-dev Csound-tekno Search About

[Csnd] Ring modulation one audiofile by another

Date2024-01-29 08:09
FromFreemind
Subject[Csnd] Ring modulation one audiofile by another
Hi!

After long pause with cSound, I'm trying to remember the programming in it.

How to ring-modulate one file by another one in cSound?

Best regards,

Vadim
 
 
--
Vadim Kupriyanov

Date2024-01-29 08:24
From"Peter P."
SubjectRe: [Csnd] Ring modulation one audiofile by another
AttachmentsNone  

Date2024-01-29 09:51
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Ring modulation one audiofile by another
Hi Vadim,

Here’s an example (btw the correct spelling is Csound not cSound)

instr 1
p3 = min(filelen(p4), filelen(p5)) 
a1 diskin  p4
a2 diskin  p5
      out a1*a2
endin

schedule(1, 0, 0, "fox.wav", "beats.wav")

HTH
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 29 Jan 2024, at 08:09, Freemind <00000feca4c3aaff-dmarc-request@LISTSERV.HEANET.IE> wrote:
> 
> *Warning*
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Hi!
> 
> After long pause with cSound, I'm trying to remember the programming in it.
> 
> How to ring-modulate one file by another one in cSound?
> 
> Best regards,
> 
> Vadim
>     --
> Vadim Kupriyanov
> 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

Date2024-01-29 09:52
FromST Music
SubjectRe: [Csnd] Ring modulation one audiofile by another
Not to seem pedantic, but ring modulation is a form of amplitude modulation but not the same. 

Amplitude modulation uses a unipolar signal to modulate the carrier and the carrier remains audible (carrier + sidebands). Ring modation uses a bipolar signal to modulate the carrier and only the sidebands are audible.

<CsoundSynthesizer>
<CsOptions>
 -odac
</CsOptions>
<CsInstruments>

sr = 48000
ksmps = 32
nchnls = 1
0dbfs  = 1

instr AmpMod
  aCarrier diskin "beats.wav", 1, 0, 1
  aModulator diskin "anditsall.wav", 1, 0, 1
  aSig = aCarrier * (aModulator/2 + .5)
  out aSig
endin

schedule "AmpMod", 0, 16

instr RingMod
  aCarrier diskin "beats.wav", 1, 0, 1
  aModulator diskin "anditsall.wav", 1, 0, 1
  aSig = aCarrier * aModulator
  out aSig
endin

schedule "RingMod", 16, 16

</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>

Best,
Scott

On Mon, Jan 29, 2024, 3:25 a.m. Peter P. <peterparker@fastmail.com> wrote:
* Freemind <00000feca4c3aaff-dmarc-request@LISTSERV.HEANET.IE> [2024-01-29 09:19]:
>
> Hi!
>
> After long pause with cSound, I'm trying to remember the programming in it.
>
> How to ring-modulate one file by another one in cSound?
Multiply their amplitudes. Ring modulation is actually amplitude
modulation.

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

Date2024-01-29 09:58
FromST Music
SubjectRe: [Csnd] Ring modulation one audiofile by another
Ok, that's downright fluky - Victor & I must have posted seconds apart :)

On Mon, Jan 29, 2024, 4:52 a.m. ST Music <stunes6556@gmail.com> wrote:
Not to seem pedantic, but ring modulation is a form of amplitude modulation but not the same. 

Amplitude modulation uses a unipolar signal to modulate the carrier and the carrier remains audible (carrier + sidebands). Ring modation uses a bipolar signal to modulate the carrier and only the sidebands are audible.

<CsoundSynthesizer>
<CsOptions>
 -odac
</CsOptions>
<CsInstruments>

sr = 48000
ksmps = 32
nchnls = 1
0dbfs  = 1

instr AmpMod
  aCarrier diskin "beats.wav", 1, 0, 1
  aModulator diskin "anditsall.wav", 1, 0, 1
  aSig = aCarrier * (aModulator/2 + .5)
  out aSig
endin

schedule "AmpMod", 0, 16

instr RingMod
  aCarrier diskin "beats.wav", 1, 0, 1
  aModulator diskin "anditsall.wav", 1, 0, 1
  aSig = aCarrier * aModulator
  out aSig
endin

schedule "RingMod", 16, 16

</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>

Best,
Scott

On Mon, Jan 29, 2024, 3:25 a.m. Peter P. <peterparker@fastmail.com> wrote:
* Freemind <00000feca4c3aaff-dmarc-request@LISTSERV.HEANET.IE> [2024-01-29 09:19]:
>
> Hi!
>
> After long pause with cSound, I'm trying to remember the programming in it.
>
> How to ring-modulate one file by another one in cSound?
Multiply their amplitudes. Ring modulation is actually amplitude
modulation.

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

Date2024-01-29 10:36
From"Peter P."
SubjectRe: [Csnd] Ring modulation one audiofile by another
AttachmentsNone  

Date2024-01-29 21:49
Fromjoachim heintz
SubjectRe: [Csnd] Ring modulation one audiofile by another
yes, and perhaps it is most easy to consider AM as a mix of RM and the 
carrier signal.
so in your example:
instr AmpMod
   aCarrier diskin "beats.wav", 1, 0, 1
   aModulator diskin "anditsall.wav", 1, 0, 1
   aRM = aCarrier * aModulator
   aAM = aRM + aCarrier
   out aAM (or aAM/2)
endin
then we are free to weight like
   aAM = aRM/2 + aCarrier
or
   aAM = aRM + aCarrier/2
and we do not have to care about the modulator always staying above zero 
etc.

	joachim

On 29/01/2024 10:52, ST Music wrote:
> Not to seem pedantic, but ring modulation is a form of amplitude 
> modulation but not the same.
> 
> Amplitude modulation uses a unipolar signal to modulate the carrier and 
> the carrier remains audible (carrier + sidebands). Ring modation uses a 
> bipolar signal to modulate the carrier and only the sidebands are audible.
> 
> 
> 
>   -odac
> 
> 
> 
> sr = 48000
> ksmps = 32
> nchnls = 1
> 0dbfs  = 1
> 
> instr AmpMod
>    aCarrier diskin "beats.wav", 1, 0, 1
>    aModulator diskin "anditsall.wav", 1, 0, 1
>    aSig = aCarrier * (aModulator/2 + .5)
>    out aSig
> endin
> 
> schedule "AmpMod", 0, 16
> 
> instr RingMod
>    aCarrier diskin "beats.wav", 1, 0, 1
>    aModulator diskin "anditsall.wav", 1, 0, 1
>    aSig = aCarrier * aModulator
>    out aSig
> endin
> 
> schedule "RingMod", 16, 16
> 
> 
> 
> 
> 
> 
> Best,
> Scott
> 
> On Mon, Jan 29, 2024, 3:25 a.m. Peter P.  > wrote:
> 
>     * Freemind <00000feca4c3aaff-dmarc-request@LISTSERV.HEANET.IE
>     >
>     [2024-01-29 09:19]:
>      >
>      > Hi!
>      >
>      > After long pause with cSound, I'm trying to remember the
>     programming in it.
>      >
>      > How to ring-modulate one file by another one in cSound?
>     Multiply their amplitudes. Ring modulation is actually amplitude
>     modulation.
> 
>     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