From: "Dr. Thomas Tensi" <t.tensi@gmx.de>
To: sox-users@lists.sourceforge.net
Subject: Re: Vary the volume and duty cycle over time
Date: Wed, 24 Feb 2021 22:02:49 +0100 [thread overview]
Message-ID: <0d17728f-a0fc-0672-2382-978f977a7cd3@gmx.de> (raw)
In-Reply-To: <0B45FF1D-0FB9-4292-AEC9-A43C34B5CEAE@contoso.com>
Hello Darryl,
you wrote:
> I’m trying to simulate a square wave signal. So far I have this,
> which should be a 400Hz square wave.
> play -V -r48000 -n synth square 400 0 0
This looks quite realistic to me.
> Is there
> 1. A way to make the amplitude rise and fall over time?
This is easy: you can either use another synth modulation or a tremolo:
play -r48000 -n synth square 400 0 0 synth sine amod 0.5
or
play -r48000 -n synth square 400 0 0 tremolo 0.5 50
where tremolo also allows to set the modulation depth via its second
parameter.
> 2. Vary the duty cycle over time, from say 300Hz to 600Hz and back down
> to 300Hz then repeat?
I am not sure whether you mean a pulse width modulation or a frequency
modulation (the latter sounds like a frequency modulation...)? In
principle some sort of frequency modulation is possible via fmod instead
of amod above, but it is a double-sideband suppressed-carrier amplitude
modulation and not a real frequency modulation as you request.
I do not know of a genuine frequency modulation in real-time.
But when real-time is not required, you could define a sweep parameter
for the synth like e.g.
sox -r 48000 -n part1.wav synth 5 square 300-600
sox -r 48000 -n part2.wav synth 5 square 600-300
play part1.wav part2.wav
The kind of sweep can be specified by giving either '+' '-' '/' or ':'
as the separator between frequencies.
Hope this helps!
Best regards,
Thomas
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
next prev parent reply other threads:[~2021-02-24 21:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 9:01 Vary the volume and duty cycle over time Darryl Lewis
2021-02-24 21:02 ` Dr. Thomas Tensi [this message]
2021-02-24 21:26 ` Darryl Lewis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.sourceforge.net/lists/listinfo/sox-users
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d17728f-a0fc-0672-2382-978f977a7cd3@gmx.de \
--to=sox-users@lists.sourceforge.net \
--cc=thomas@tensi.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/sox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).