LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2021, 08:33 AM   #1
icovnik
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Rep: Reputation: 5
Console audio recording, editing, mixing for garabe rock'n'roll


Hello,

Does anyone use linux for music mastering? You know, you record some tracks in a garage jam session (4x drums, guitar, bass, voice) on some digital mixer. Transfer recorded wav files to linux. Fire Audacity. Apply some filters to some tracks, other filters to other tracks. Nothing fancy, we are lo-fi garage band having fun Then join input into some songs to listen to. Then practice and repeat the same on next jam session.

OK, everything is fine. Except I am not really happy with my audio workflow. I am heavy console user and working with Audacity isn't really best for me. I was wondering, is there a way to use some console-oriented programs to process audio? E.g. normalize input (each track differently), use some compressor, some low-pass filters, high-pass filters, amplify something, mix together, use fade-out, .... you name it. Something like write some common parameters to some bash script, then run that script. It applies all filters and does everything. Then listen to output, change some presets in script, run again... etc.

So are there command-line programs to do this stuf? Or is there a way to control Audacity, Ardour, .. another program to do this in batch mode? Just fire the script, wait some, get results. Or are there some audio filters/effects I can use at command-line and script them by myself?

Thanks for any advice!

ico
 
Old 08-24-2021, 01:34 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
You can definitely use ffmpeg and/or sox for all of this.
https://trac.ffmpeg.org/wiki
https://ffmpeg.org/ffmpeg.html
http://sox.sourceforge.net/
Random search result for downmixing with ffmpeg:
https://stackoverflow.com/questions/...ms-into-stereo
 
Old 08-28-2021, 01:18 PM   #3
icovnik
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Original Poster
Rep: Reputation: 5
ffmpeg audio processing, pan filter

ondoho: Wow, I did some video recodings with ffmpeg but I didn't dive too much into it. And now after learning more about ffmpeg's filters I am truly impressed! That's the advice I was asking. Thank you!

Just quick question about ffmpeg's pan filter. I am trying to create stereo output from some mono wav files (and position it "in space") but I am unable to do it. It allways ends with error "Too many inputs specified for the "pan" filter.". My command:

ffmpeg -i ch1.wav -i ch2.wav -filter_complex "[0:0][1:0]pan=2c|c0=c0|c1=c1" -ac 2 out.wav

What is wrong with my command?

Thanks
 
Old 08-28-2021, 01:55 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I'm sorry but I have no idea.
I always do web searches that suggest commands. Lots of stuff on stackoverflow.com
 
Old 08-28-2021, 02:01 PM   #5
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,112
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
Nixcraft is another source for good scripts.
https://www.cyberciti.biz/faq/page/191/

Shotgun link
 
Old 08-28-2021, 04:37 PM   #6
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,138
Blog Entries: 6

Rep: Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827
Quote:
I am trying to create stereo output from some mono wav files
Let me make a couple of .wav files.

Examples:
Code:
mplayer myfile1.mp3 -vc dummy -vo null -ao pcm:file=audio1.wav
mplayer myfile2.mp3 -vc dummy -vo null -ao pcm:file=audio2.wav

ffprobe audio1.wav
...
Input #0, wav, from 'audio1.wav':
  Duration: 00:26:30.00, bitrate: 1024 kb/s
  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 32000 Hz, 2 channels, s16, 1024 kb/s
  

ffmpeg -i audio1.wav -i audio2.wav -filter_complex amerge -c:a libmp3lame -b:a 128k -vn audio1.mp3

ffprobe audio1.mp3
...
Input #0, mp3, from 'audio1.mp3':
  Metadata:
    encoder         : Lavf58.76.100
  Duration: 00:26:30.05, start: 0.034531, bitrate: 128 kb/s
  Stream #0:0: Audio: mp3, 32000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.13
Also
Code:
sox -M audio1.wav audio2.wav audio3.wav delay .05 0 0
 
Old 08-29-2021, 12:40 PM   #7
icovnik
LQ Newbie
 
Registered: Jan 2007
Posts: 11

Original Poster
Rep: Reputation: 5
Thank you for your help. It proves again that it pays off to study a bit

teck: I was struggling with creating stereo from multiple instruments with pan filter, which can place respective instruments (mono source streams) "in space" - guitar 75% to left channel, 25% to right, kick drum 50-50, voice a bit to the right... etc. Now I found out that if I first "amerge" all separate streams, then feed amerge's output into pan filter. I don't know whether it is the right way to do it but it works for me. Like this:

Code:
ffmpeg -hide_banner \
-i kick.wav -i snare.wav -i cymbals.wav -i guitar.wav \
-filter_complex \
" \
    [0:0][1:0][2:0][3:0]amerge=inputs=4, \
    pan='stereo| \
        c0 = c0+c1+1.1*c2+0.7*c3 | \
        c1 = c0+c1+0.9*c2+1.3*c3 \
    ' \
" \
-ac 2 \
out.wav
So - we have 4x 1-channel streams, join it into 1x 4-channel stream with amerge, then place those into output stereo channels with pan filter. I was unable to use pan without this step.

For someone searching for similar help - pan filter doesn't like output channel layout with a space before | (e.g. "stereo |..." isn't OK, "stereo|.." is, spaces in outdef is OK). "," between filters connects output from 1st filter to input of 2nd. If you use ";" between filters, it is something like a sequence of filters - run this filter; then run that; ...
 
  


Reply

Tags
audacity, audio, command line, mixing, music production



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Roll up, roll up, Microsoft's rolled up dozens of OS fixes LXer Syndicated Linux News 0 11-22-2014 05:33 PM
Ubuntu 9.04 ready to rock-n-roll codywohlers LinuxQuestions.org Member Intro 2 05-17-2009 11:16 PM
Trying to build a Live-Install CD, should I give ROCK a roll? MasterC ROCK 1 03-12-2006 03:48 AM
Quakeworld won't rock n' roll :( WhiteChedda Linux - Games 2 10-05-2003 09:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration