Re: Vary the volume and duty cycle over time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you Thomas, 
I think you've answered my questions.

On 25/2/21, 8:11 am, "Dr. Thomas Tensi" <t.tensi@xxxxxx> wrote:

    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@xxxxxxxxxxxxxxxxxxxxx
    https://lists.sourceforge.net/lists/listinfo/sox-users


_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users




[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux