sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* What´s wrong with my batch script?
@ 2017-09-22 23:26 AE Photos02
  2017-09-23 14:10 ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 6+ messages in thread
From: AE Photos02 @ 2017-09-22 23:26 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 1117 bytes --]

Hello everyone.

I am making a script that is supposed to mix together 2 separate versions
of the same files. So far so good. Now it has to be able to do this in a
batch of all files in one folder, to an output file, a mixed file.

The idea is to have samples called *sweep1.wav be combined with the files
called *sweep2.wav. So far my script is combining *only* one specific *"sweep1"
file*, the last in my list *(which is number 3)*, with one the correct
"sweep2" file.


*Here´s the script so far:*

-------------------------

for file in ./*sweep1*

do

for file2 in ./*sweep2*

    do

        out=COMBINED

        sox -V4 -m -v 1 $file -v 1 $file2 $file-$out.wav

    done

done

--------------------------


As you may see I have put -v 1 in front of both of the files. If I do not,
the two files will be mixed with a linear gain of 0.5, I guess half of its
linear gain value.

Hope someone can see my error here. The output should be the combination of
the two first files with the same file name tokens. The method is "mix",
-m.


-- 
Best regards
Kristopher

[-- Attachment #1.2: Type: text/html, Size: 2168 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: What´s wrong with my batch script?
@ 2017-09-24 17:21 AE Photos02
  2017-09-24 19:04 ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 6+ messages in thread
From: AE Photos02 @ 2017-09-24 17:21 UTC (permalink / raw)
  To: Sox-Users


[-- Attachment #1.1: Type: text/plain, Size: 2092 bytes --]

  
  

 Okay. I see. I'm doing it on a Mac with bash in terminal. Do I need to do a "for each" and an "echo" or something? Or perhaps specify the thing more? I'm new to bash and Sox.   
  

  
Thanks for any help!   
  

  
  

  
  
>   
> On Sep 23, 2017 at 4:27 PM,  <Jan Stary (mailto:hans@stare.cz)>  wrote:
>   
>   
>   
>  On Sep 23 15:10:34, jn.ml.sxu.88@wingsandbeaks.org.uk wrote:  >  On 2017-09-23 00:26, AE Photos02 wrote:  >   >  Hello everyone.  >   >   >   >  I am making a script that is supposed to mix together 2 separate  >   >  versions  >   >  of the same files. So far so good. Now it has to be able to do this in a  >   >  batch of all files in one folder, to an output file, a mixed file.  >   >   >   >  The idea is to have samples called *sweep1.wav be combined with the  >   >  files  >   >  called *sweep2.wav. So far my script is combining *only* one specific  >   >  *"sweep1"  >   >  file*, the last in my list *(which is number 3)*, with one the correct  >   >  "sweep2" file.  >   >   >   >   >   >  *Here´s the script so far:*  >   >   >   >  -------------------------  >   >   >   >  for file in ./*sweep1*  >   >   >   >  do  >   >   >   >  for file2 in ./*sweep2*  >   >   >   >  do  >   >   >   >  out=COMBINED  >   >   >   >  sox -V4 -m -v 1 $file -v 1 $file2 $file-$out.wav  >   >   >   >  done  >   >   >   >  done  >   >   >   >  -------------------------- This is most probably a shell scripting problem which has nothing to do with SoX.  >   >  for file in ./*sweep1*  >   >  do  >   >  for file2 in ./*sweep2* You are combining every *sweep1* file with every *sweep2* file, overwriting the output over and over again. Of course the last wins. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users  
>
>   
  
  
 

[-- Attachment #1.2: Type: text/html, Size: 2554 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-25 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 23:26 What´s wrong with my batch script? AE Photos02
2017-09-23 14:10 ` Jeremy Nicoll - ml sox users
2017-09-23 14:27   ` Jan Stary
  -- strict thread matches above, loose matches on Subject: below --
2017-09-24 17:21 AE Photos02
2017-09-24 19:04 ` Jeremy Nicoll - ml sox users
2017-09-25 21:14   ` AE Photos02

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).