sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Multiple Pipes in series - possible?
@ 2021-06-29 11:46 Brandon Lincoln Snyder
  2021-06-29 12:28 ` Stuart Naylor
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Brandon Lincoln Snyder @ 2021-06-29 11:46 UTC (permalink / raw)
  To: sox-users


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

Hello everyone! New sox user here. Is it possible to run multiple pipe
operations in series?


For example, instead of:

"sox"  "|'sox'   'input-audio.wav' -p  gain 0.0" "output-audio.wav"


and then


"sox"  "|'sox'   'output-audio.wav' -p  gain 0.0" "output-audio-2.wav"


is it possible to have the pipe in the first command to be in the input for
the pipe in the second command? Something like:


"sox"  "|'sox'   '"|'sox'   'input-audio.wav' -p  gain 0.0"' -p  gain 0.0"
"output-audio2.wav"


^this command as it is here does not work, but perhaps it is a trivial
problem in my syntax.


The goal is to run many pipe operations without needing to write
intermediate files.


Thanks.

best,

Brandon

-- 
Brandon Lincoln Snyder
Composer <https://www.brandonlincolnsnyder.com/works> | Musician
<https://www.brandonlincolnsnyder.com/give-sound-receive-sound> | Writer
<https://www.brandonlincolnsnyder.com/writings> - Stuttgart, Germany
Bachelor of Arts in Music - Harvard University 2018
brandonlincolnsnyder.com

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

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



[-- 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] 7+ messages in thread

* Re: Multiple Pipes in series - possible?
  2021-06-29 11:46 Multiple Pipes in series - possible? Brandon Lincoln Snyder
@ 2021-06-29 12:28 ` Stuart Naylor
  2021-06-29 14:39 ` Jan Stary
  2021-06-29 14:42 ` Måns Rullgård
  2 siblings, 0 replies; 7+ messages in thread
From: Stuart Naylor @ 2021-06-29 12:28 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net


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

Just use /tmp as what is the difference?

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Brandon Lincoln Snyder<mailto:branlsnyder@gmail.com>
Sent: 29 June 2021 12:47
To: sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net>
Subject: [SoX-users] Multiple Pipes in series - possible?


Hello everyone! New sox user here. Is it possible to run multiple pipe operations in series?



For example, instead of:

"sox"  "|'sox'   'input-audio.wav' -p  gain 0.0" "output-audio.wav"



and then



"sox"  "|'sox'   'output-audio.wav' -p  gain 0.0" "output-audio-2.wav"



is it possible to have the pipe in the first command to be in the input for the pipe in the second command? Something like:



"sox"  "|'sox'   '"|'sox'   'input-audio.wav' -p  gain 0.0"' -p  gain 0.0" "output-audio2.wav"



^this command as it is here does not work, but perhaps it is a trivial problem in my syntax.



The goal is to run many pipe operations without needing to write intermediate files.



Thanks.

best,

Brandon

--
Brandon Lincoln Snyder
Composer<https://www.brandonlincolnsnyder.com/works> | Musician<https://www.brandonlincolnsnyder.com/give-sound-receive-sound> | Writer<https://www.brandonlincolnsnyder.com/writings> - Stuttgart, Germany
Bachelor of Arts in Music - Harvard University 2018
brandonlincolnsnyder.com<http://brandonlincolnsnyder.com>


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

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



[-- 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] 7+ messages in thread

* Re: Multiple Pipes in series - possible?
  2021-06-29 11:46 Multiple Pipes in series - possible? Brandon Lincoln Snyder
  2021-06-29 12:28 ` Stuart Naylor
@ 2021-06-29 14:39 ` Jan Stary
  2021-06-29 14:42 ` Måns Rullgård
  2 siblings, 0 replies; 7+ messages in thread
From: Jan Stary @ 2021-06-29 14:39 UTC (permalink / raw)
  To: sox-users

On Jun 29 13:46:30, branlsnyder@gmail.com wrote:
> Is it possible to run multiple pipe operations in series?

Yes. That's what a pipe is.

SoX will read from stdin and write to stdout
if the filename given is '-', so you can pipe
anything you want to and from sox.

> For example, instead of:
> "sox"  "|'sox'   'input-audio.wav' -p  gain 0.0" "output-audio.wav"
> and then
> "sox"  "|'sox'   'output-audio.wav' -p  gain 0.0" "output-audio-2.wav"
> is it possible to have the pipe in the first command to be in the input for
> the pipe in the second command? Something like:
> "sox"  "|'sox'   '"|'sox'   'input-audio.wav' -p  gain 0.0"' -p  gain 0.0"
> "output-audio2.wav"

This is not a very good example, as this pipeline does nothing.
Tell us what you actually want to do.

	Jan



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

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

* Re: Multiple Pipes in series - possible?
  2021-06-29 11:46 Multiple Pipes in series - possible? Brandon Lincoln Snyder
  2021-06-29 12:28 ` Stuart Naylor
  2021-06-29 14:39 ` Jan Stary
@ 2021-06-29 14:42 ` Måns Rullgård
  2021-06-30  9:59   ` Brandon Lincoln Snyder
  2 siblings, 1 reply; 7+ messages in thread
From: Måns Rullgård @ 2021-06-29 14:42 UTC (permalink / raw)
  To: Brandon Lincoln Snyder; +Cc: sox-users

Brandon Lincoln Snyder <branlsnyder@gmail.com> writes:

> Hello everyone! New sox user here. Is it possible to run multiple pipe
> operations in series?
>
> For example, instead of:
>
> "sox"  "|'sox'   'input-audio.wav' -p  gain 0.0" "output-audio.wav"
>
> and then
>
> "sox"  "|'sox'   'output-audio.wav' -p  gain 0.0" "output-audio-2.wav"
>
> is it possible to have the pipe in the first command to be in the input for
> the pipe in the second command? Something like:
>
> "sox"  "|'sox'   '"|'sox'   'input-audio.wav' -p  gain 0.0"' -p  gain 0.0"
> "output-audio2.wav"
>
> ^this command as it is here does not work, but perhaps it is a trivial
> problem in my syntax.
>
> The goal is to run many pipe operations without needing to write
> intermediate files.

What are you actually trying to achieve?

-- 
Måns Rullgård


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

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

* Re: Multiple Pipes in series - possible?
  2021-06-29 14:42 ` Måns Rullgård
@ 2021-06-30  9:59   ` Brandon Lincoln Snyder
  2021-06-30 10:21     ` Jeremy Nicoll - ml sox users
  2021-07-01 16:50     ` Jan Stary
  0 siblings, 2 replies; 7+ messages in thread
From: Brandon Lincoln Snyder @ 2021-06-30  9:59 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: sox-users


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

Thanks everybody for these first thoughts.

In my example from earlier, I was trying to build a minimum working example
to help me understand the syntax for running sox pipes in series. In other
words, how can I use the stdout in a pipe as an stdin for another pipe?

I'm trying to build an application at the moment, where serial sox pipe
processes could be used in many different ways. For instance, I'd like to
eventually make something similar to the MC system
<https://docs.cycling74.com/max8/vignettes/mc_topic> in MaxMSP.

best,
Brandon

On Tue, Jun 29, 2021 at 4:42 PM Måns Rullgård <mans@mansr.com> wrote:

> Brandon Lincoln Snyder <branlsnyder@gmail.com> writes:
>
> > Hello everyone! New sox user here. Is it possible to run multiple pipe
> > operations in series?
> >
> > For example, instead of:
> >
> > "sox"  "|'sox'   'input-audio.wav' -p  gain 0.0" "output-audio.wav"
> >
> > and then
> >
> > "sox"  "|'sox'   'output-audio.wav' -p  gain 0.0" "output-audio-2.wav"
> >
> > is it possible to have the pipe in the first command to be in the input
> for
> > the pipe in the second command? Something like:
> >
> > "sox"  "|'sox'   '"|'sox'   'input-audio.wav' -p  gain 0.0"' -p  gain
> 0.0"
> > "output-audio2.wav"
> >
> > ^this command as it is here does not work, but perhaps it is a trivial
> > problem in my syntax.
> >
> > The goal is to run many pipe operations without needing to write
> > intermediate files.
>
> What are you actually trying to achieve?
>
> --
> Måns Rullgård
>


-- 
Brandon Lincoln Snyder
Composer <https://www.brandonlincolnsnyder.com/works> | Musician
<https://www.brandonlincolnsnyder.com/give-sound-receive-sound> | Writer
<https://www.brandonlincolnsnyder.com/writings> - Stuttgart, Germany
Bachelor of Arts in Music - Harvard University 2018
brandonlincolnsnyder.com

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

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



[-- 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] 7+ messages in thread

* Re: Multiple Pipes in series - possible?
  2021-06-30  9:59   ` Brandon Lincoln Snyder
@ 2021-06-30 10:21     ` Jeremy Nicoll - ml sox users
  2021-07-01 16:50     ` Jan Stary
  1 sibling, 0 replies; 7+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2021-06-30 10:21 UTC (permalink / raw)
  To: sox-users

On 2021-06-30 10:59, Brandon Lincoln Snyder wrote:

> In my example from earlier, I was trying to build a minimum working 
> example
> to help me understand the syntax for running sox pipes in series. In 
> other
> words, how can I use the stdout in a pipe as an stdin for another pipe?

Did you look at the manual?  In its simplest form, sox uses - to denote
reading from stdin and/or writing to stdout.  See the section on 
"special
filenames".

Moreover the description of the -p option says

−p, −−sox−pipe

  This can be used in place of an output filename to specify that the
  SoX command should be used as in input pipe to another SoX command.
  For example, the command:

  play "|sox −n −p synth 2" "|sox −n −p synth 2 tremolo 10" stat

  plays two ‘files’ in succession, each with different effects.

  −p is in fact an alias for ‘−t sox −’.



Note the last sentence, which sets -t (as described in the special
filenames text) and also has a following "-".





> I'm trying to build an application at the moment, where serial sox pipe
> processes could be used in many different ways.

It would help me to understand what you're trying to do if you explained
whether you want just to process a single source file (ie something that
already exists) or if you're trying to take continuous incoming sound 
and
do something to it.

Are you trying to make multiple copies of that source and send each of
them somewhere else, possibly with different effects applied to each 
one?

Are you hoping, if the destinations are playback devices playing in real
time, that the sound playing at each one will be in-sync with each 
other?

Are you expecting the playbacks, if there are any, to be in a known sync
with the input (ie delayed by a predictable number of mS)?




For instance, I'd like to
> eventually make something similar to the MC system
> <https://docs.cycling74.com/max8/vignettes/mc_topic> in MaxMSP.

You may know what you mean, but I don't.  That page is too 
general/vague.

What /specific/ thing are you trying to do?


-- 
Jeremy Nicoll - my opinions are my own


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

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

* Re: Multiple Pipes in series - possible?
  2021-06-30  9:59   ` Brandon Lincoln Snyder
  2021-06-30 10:21     ` Jeremy Nicoll - ml sox users
@ 2021-07-01 16:50     ` Jan Stary
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Stary @ 2021-07-01 16:50 UTC (permalink / raw)
  To: sox-users

On Jun 30 11:59:15, branlsnyder@gmail.com wrote:
> In my example from earlier, I was trying to build a minimum working example
> to help me understand the syntax for running sox pipes in series. In other
> words, how can I use the stdout in a pipe as an stdin for another pipe?

sox input - | sox - - | sox - - | sox - output

If it's only effect you want to cascade, there's even
no nedd for that, just run sox in out effect1 effect2 effect3.

This is described in the manual.
Have you read the manual?

> I'm trying to build an application at the moment, where serial sox pipe
> processes could be used in many different ways.

That doesn;t really say anything.

> For instance, I'd like to
> eventually make something similar to the MC system
> <https://docs.cycling74.com/max8/vignettes/mc_topic> in MaxMSP.

Don't assume people know what MaxMSP is or does.
I still have no idea what you are actualy trying to do.
Give us a specific example of what you are doing, audio-wise.




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

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

end of thread, other threads:[~2021-07-01 16:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 11:46 Multiple Pipes in series - possible? Brandon Lincoln Snyder
2021-06-29 12:28 ` Stuart Naylor
2021-06-29 14:39 ` Jan Stary
2021-06-29 14:42 ` Måns Rullgård
2021-06-30  9:59   ` Brandon Lincoln Snyder
2021-06-30 10:21     ` Jeremy Nicoll - ml sox users
2021-07-01 16:50     ` Jan Stary

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