Creating audio with command line

Still new to all of this? Feel free to post in any of the subforums on this site, but in this subforum newbie questions are especially encouraged!

Moderators: MattKingUSA, khz

Post Reply
foul_owl
Established Member
Posts: 18
Joined: Thu Jul 21, 2011 9:56 pm
Been thanked: 2 times

Creating audio with command line

Post by foul_owl »

I'm looking for a way to do some very basic audio creation with the command line.

Basically just a few waveform generators, changing some parameters like pan, shape and tuning, modulate a few parameters with LFO, then send to one or two more plugins like Dragonfly Reverb.

Then just running a midi file through the synth and small plugin chain and render the result to wav.

I realize I can do this in a DAW like Ardour, but would really prefer command line for my use case.

I'm guessing maybe this is possible with just ffmpeg and lv2?

If so, what does the syntax look like, especially parameter modulation? If I can see some examples of the syntax I can easily run with that. And what's a very basic LV2 synth plugin that can generate audio from midi?

User avatar
Loki Harfagr
Established Member
Posts: 268
Joined: Thu Aug 02, 2018 1:28 pm
Has thanked: 151 times
Been thanked: 53 times

Re: Creating audio with command line

Post by Loki Harfagr »

You may like to use the synth function in SoX (theoretically in every GNU/Linux extended toolbox)

just in case that'd help you as a start here a few easy examples:

Code: Select all

 type SIREN SIRENZ
SIREN is a function
SIREN () 
{ 
    play -n synth 10 sin 220-28160
}
SIRENZ is a function
SIRENZ () 
{ 
    play -n synth 12 sin 110-8160 synth 15 sin 28160-110 synth 9.5 squa 28160-55 tremolo 39 70 flanger 5 3 44 71 .77
}

#>: cat  /usr/local/bin/TICK
#!/bin/sh
###
trap _exeunt EXIT
_exeunt(){
	###	echo " Going Down..."
	exit 0
}
###	click/metronome for fun, TICK tempo [note]
###	ex (classical soud):  TICK 134
###	ex ("electronic" sound):  TICK 165 C8
###
###	defaukt to: tempo 120 and "classical"
T=${1:-120}
S=${2:-G1}
###	parametres delay and fade, forcibly related to tempo
###	fade would play the interval time while delay acts the "cut"
F1=$(echo "60/${T}" | bc -l)
TK=$(echo "0.99*60/${T}" | bc -l)
###	Et voila ;-)
play -n synth pl ${S}  delay ${TK} fade 0 ${F1} norm -6 repeat 999999999

 type ALARMZ
ALARMZ is a function
ALARMZ () 
{ 
    play -n synth 1 sin 20-15000 tremolo 39 70 flanger 5 3 44 71 .77 repeat -
}

(*edited: one more example, with FX)

Post Reply