Fwd: Re: merging mono files

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Fwd: Re: merging mono files

Dr. Mark Bugeja MD
Hi. I hope I can explain.

Loops are markers that allow appropriate software to keep sounding a note (recorded sample) played digitally on a MIDI keyboard for as long as the note is held down even though the recorded sample may be of only a few seconds' duration.

The release marker is placed in the point where the note is released in the actual recorded sample and where the sounds starts to fade away. The software needs to know that moment especially if there are multiple releases available for that note that would represent "staccato", "portato" and longer held notes. This exercise renders more realism when recorded samples are played from a "sampleset" loaded in software like jOrgan, GrandOrgue and Hauptwerk.

Picture (42kB): https://mega.nz/#!dQIwkDKI!QlrmlYHywFqpG9ujJfJLBm_1skxaYz88AJJJy4Euxs0

In the example demonstated there is no release marker as the "tail" of the waveform was removed and saved as a separate file. So the end of a loops would be the release marker in such instances.

Clearly from this picture loops and markers were not retained in the merger using sox though the exercise was purely a simple exercise without any frills of extra codes.

Regards

Mark


On 08/12/2016 08:12, Jan Stary wrote:
I hope that loops and markers (cues) are not erased in the process!!!
I think you need to explain what you mean by that. I would expect audio 
files
processed by sox to contain just audio data; I don't understand how one 
could
contain loop or marker information, and therefore I also don't 
understand how
you could possibly expect sox to conserve such information.
Some handheld recorders, for example, allow for saving "markers"
in the file. This is not inbetween the samples, obviously;
these are saved in the header.

A typical application of that is e.g. a journalist marking "next
question" or a field recording marking "next song". I have a ZOOM H1
recorder and a Microtrack II recorder which do that.

I believe SoX does preserve that information in the audio header,
but it's been a long time I checked so I am not sure.

What Mark has seem to be sampled trumpet notes,
so I don't know what kind of markers would that use and why,
but let's see what he reports.

	Jan


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users







Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jan Stary
On Dec 08 14:36:54, [hidden email] wrote:

> Loops are markers that allow appropriate software to keep sounding a note
> (recorded sample) played digitally on a MIDI keyboard for as long as the
> note is held down even though the recorded sample may be of only a few
> seconds' duration.
>
> The release marker is placed in the point where the note is released in the
> actual recorded sample and where the sounds starts to fade away. The
> software needs to know that moment especially if there are multiple releases
> available for that note that would represent "staccato", "portato" and
> longer held notes. This exercise renders more realism when recorded samples
> are played from a "sampleset" loaded in software like jOrgan, GrandOrgue and
> Hauptwerk.

This would be a perfect beginning of your original post.
Now I understand why you need to preserve them: you are building
and actual sample library to be used with MIDI. Indeed, attack
and sustain and release and decay are indisposable.

> Picture (42kB):
> https://mega.nz/#!dQIwkDKI!QlrmlYHywFqpG9ujJfJLBm_1skxaYz88AJJJy4Euxs0

An error occurred while loading MEGA.
Filename: :0
Exception: out of memory
Please try again later. We apologize for the inconvenience

> In the example demonstated there is no release marker as the "tail" of the
> waveform was removed and saved as a separate file. So the end of a loops
> would be the release marker in such instances.
>
> Clearly from this picture loops and markers were not retained in the merger
> using sox though the exercise was purely a simple exercise without any
> frills of extra codes.

I don't have the picture, but I thnik I can picture it.
How is a piece of audio software (a clickwty editor)
expected to display a waveform with cue points such as release?
Especially if there is more than one possible release point?

Can you please post some of the original files (that do have
the markers) so that we make actually look at them?

        Jan

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD

The mega links works - just tried it myself.

These are the original left and right wav samples and the stereo (sox generated) file together with the bat file used.

https://mega.nz/#!oYYlARqQ!HMwkzCuDoFjBQvUwEFJjnrDbuJrN5kQ6ptKlEV5QWng


On 09/12/2016 14:51, Jan Stary wrote:
On Dec 08 14:36:54, [hidden email] wrote:
Loops are markers that allow appropriate software to keep sounding a note
(recorded sample) played digitally on a MIDI keyboard for as long as the
note is held down even though the recorded sample may be of only a few
seconds' duration.

The release marker is placed in the point where the note is released in the
actual recorded sample and where the sounds starts to fade away. The
software needs to know that moment especially if there are multiple releases
available for that note that would represent "staccato", "portato" and
longer held notes. This exercise renders more realism when recorded samples
are played from a "sampleset" loaded in software like jOrgan, GrandOrgue and
Hauptwerk.
This would be a perfect beginning of your original post.
Now I understand why you need to preserve them: you are building
and actual sample library to be used with MIDI. Indeed, attack
and sustain and release and decay are indisposable.

Picture (42kB):
https://mega.nz/#!dQIwkDKI!QlrmlYHywFqpG9ujJfJLBm_1skxaYz88AJJJy4Euxs0
An error occurred while loading MEGA.
Filename: :0
Exception: out of memory
Please try again later. We apologize for the inconvenience

In the example demonstated there is no release marker as the "tail" of the
waveform was removed and saved as a separate file. So the end of a loops
would be the release marker in such instances.

Clearly from this picture loops and markers were not retained in the merger
using sox though the exercise was purely a simple exercise without any
frills of extra codes.
I don't have the picture, but I thnik I can picture it.
How is a piece of audio software (a clickwty editor)
expected to display a waveform with cue points such as release?
Especially if there is more than one possible release point?

Can you please post some of the original files (that do have
the markers) so that we make actually look at them?

	Jan

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users





Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Erich Eckner
Hi,

I just had a brief look at your example files and it looks like the mono
files are actually stereo, but with one channel muted (in retrospect I
think, you mentioned that). So the correct sox comman to combine these
would be

sox -M left.wav right.wav stereo.wav remix 1 4

this imports all 4 channels (actual left channel, silent right channel
in left file, silent left channel in right file, actual right channel)
to sox and exports only the actual left and right in one file (a.k.a.
stereo).
However, this will still not preserve the markers.

regards,
Erich

On 09.12.2016 15:10, Dr. Mark Bugeja MD wrote:

> The mega links works - just tried it myself.
>
> These are the original left and right wav samples and the stereo (sox
> generated) file together with the bat file used.
>
> https://mega.nz/#!oYYlARqQ!HMwkzCuDoFjBQvUwEFJjnrDbuJrN5kQ6ptKlEV5QWng
>
>
> On 09/12/2016 14:51, Jan Stary wrote:
>> On Dec 08 14:36:54, [hidden email] wrote:
>>> Loops are markers that allow appropriate software to keep sounding a
>>> note
>>> (recorded sample) played digitally on a MIDI keyboard for as long as the
>>> note is held down even though the recorded sample may be of only a few
>>> seconds' duration.
>>>
>>> The release marker is placed in the point where the note is released
>>> in the
>>> actual recorded sample and where the sounds starts to fade away. The
>>> software needs to know that moment especially if there are multiple
>>> releases
>>> available for that note that would represent "staccato", "portato" and
>>> longer held notes. This exercise renders more realism when recorded
>>> samples
>>> are played from a "sampleset" loaded in software like jOrgan,
>>> GrandOrgue and
>>> Hauptwerk.
>> This would be a perfect beginning of your original post.
>> Now I understand why you need to preserve them: you are building
>> and actual sample library to be used with MIDI. Indeed, attack
>> and sustain and release and decay are indisposable.
>>
>>> Picture (42kB):
>>> https://mega.nz/#!dQIwkDKI!QlrmlYHywFqpG9ujJfJLBm_1skxaYz88AJJJy4Euxs0
>> An error occurred while loading MEGA.
>> Filename: :0
>> Exception: out of memory
>> Please try again later. We apologize for the inconvenience
>>
>>> In the example demonstated there is no release marker as the "tail"
>>> of the
>>> waveform was removed and saved as a separate file. So the end of a loops
>>> would be the release marker in such instances.
>>>
>>> Clearly from this picture loops and markers were not retained in the
>>> merger
>>> using sox though the exercise was purely a simple exercise without any
>>> frills of extra codes.
>> I don't have the picture, but I thnik I can picture it.
>> How is a piece of audio software (a clickwty editor)
>> expected to display a waveform with cue points such as release?
>> Especially if there is more than one possible release point?
>>
>> Can you please post some of the original files (that do have
>> the markers) so that we make actually look at them?
>>
>>     Jan
>>
>> ------------------------------------------------------------------------------
>>
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today.http://sdm.link/xeonphi
>> _______________________________________________
>> Sox-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/xeonphi
>
>
>
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD

neither will it preserve pitch information I noticed. :-(

Ok.... if I were to carry on with sox, what syntax would I need to use so that all the 61 files in a folder are matched up with the corresponding ones to output files with the same name in a different folder?

The files are called by notes on a scale preceded by a number eg 036-C.wav, 037-C#.wav, 038-D.wav, and so on. I therefore need to match the 036-C.wav in the left folder with the 036-C.wav in the right folder.

Mark


On 09/12/2016 18:48, Erich Eckner wrote:
Hi,

I just had a brief look at your example files and it looks like the mono
files are actually stereo, but with one channel muted (in retrospect I
think, you mentioned that). So the correct sox comman to combine these
would be

sox -M left.wav right.wav stereo.wav remix 1 4

this imports all 4 channels (actual left channel, silent right channel
in left file, silent left channel in right file, actual right channel)
to sox and exports only the actual left and right in one file (a.k.a.
stereo).
However, this will still not preserve the markers.

regards,
Erich

On 09.12.2016 15:10, Dr. Mark Bugeja MD wrote:
The mega links works - just tried it myself.

These are the original left and right wav samples and the stereo (sox
generated) file together with the bat file used.

https://mega.nz/#!oYYlARqQ!HMwkzCuDoFjBQvUwEFJjnrDbuJrN5kQ6ptKlEV5QWng


On 09/12/2016 14:51, Jan Stary wrote:
On Dec 08 14:36:54, [hidden email] wrote:
Loops are markers that allow appropriate software to keep sounding a
note
(recorded sample) played digitally on a MIDI keyboard for as long as the
note is held down even though the recorded sample may be of only a few
seconds' duration.

The release marker is placed in the point where the note is released
in the
actual recorded sample and where the sounds starts to fade away. The
software needs to know that moment especially if there are multiple
releases
available for that note that would represent "staccato", "portato" and
longer held notes. This exercise renders more realism when recorded
samples
are played from a "sampleset" loaded in software like jOrgan,
GrandOrgue and
Hauptwerk.
This would be a perfect beginning of your original post.
Now I understand why you need to preserve them: you are building
and actual sample library to be used with MIDI. Indeed, attack
and sustain and release and decay are indisposable.

Picture (42kB):
https://mega.nz/#!dQIwkDKI!QlrmlYHywFqpG9ujJfJLBm_1skxaYz88AJJJy4Euxs0
An error occurred while loading MEGA.
Filename: :0
Exception: out of memory
Please try again later. We apologize for the inconvenience

In the example demonstated there is no release marker as the "tail"
of the
waveform was removed and saved as a separate file. So the end of a loops
would be the release marker in such instances.

Clearly from this picture loops and markers were not retained in the
merger
using sox though the exercise was purely a simple exercise without any
frills of extra codes.
I don't have the picture, but I thnik I can picture it.
How is a piece of audio software (a clickwty editor)
expected to display a waveform with cue points such as release?
Especially if there is more than one possible release point?

Can you please post some of the original files (that do have
the markers) so that we make actually look at them?

    Jan

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

Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi



_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users


      

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi


_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users




Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jan Stary
On Dec 09 19:58:33, [hidden email] wrote:
> Ok.... if I were to carry on with sox, what syntax would I need to use so
> that all the 61 files in a folder are matched up with the corresponding ones
> to output files with the same name in a different folder?

http://marc.info/?l=sox-users&m=148118243012683&w=2


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
In reply to this post by Dr. Mark Bugeja MD
On 2016-12-09 18:58, Dr. Mark Bugeja MD wrote:

> neither will it preserve pitch information I noticed. :-(
>
> Ok.... if I were to carry on with sox, what syntax would I need to use
> so that all the 61 files in a folder are matched up with the
> corresponding ones to output files with the same name in a different
> folder?
>
> The files are called by notes on a scale preceded by a number eg
> 036-C.wav, 037-C#.wav, 038-D.wav, and so on. I therefore need to match
> the 036-C.wav in the left folder with the 036-C.wav in the right
> folder.

Someone will need to give you a small program that can do that.  I'm not
going to,
because the language I write my utilities in won't be on your system and
you'd
have to install and configure it, and understand what you were doing
before you
could move on and actually use it.

But someone established elsewhere in the thread that VBS (I think it
was) will run
on your system.  I know nothing about VBS but someone will tell you what
to do.

Jan Stary has - again - pointed you at some code that would work on a
Linux system
but not on Windows.  In essence what it does is

  - makes a list of all the files in (eg a 'left files' folder), whose
names end in "wav"
  - then one at a time, work through that list, and:
      - work out the full name of the corresponding 'right' file
      - work out the full name of the corresponding stereo file
      - issue a sox command with all three names in it

As Jan pointed out, a simple loop like this isn't a terribly good idea;
it's better if
there are some sanity checks in it as well - making sure that the
derived 'right' file
actually exists before you try to use it, make sure that the result file
doesn't exist,
stop if the sox command fails...   If it were my code I would probably
also check that
the left & right files had the exact same size before they were used.


--
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD
In reply to this post by Jan Stary

Thanks for that reply. Would that code, reproduced here,

for left in TrumpetL/*wav; do
		name=${left##*/}
		right=TrumpetR/$name
		sox -M $left $right stereo-$name
	done

create a new folder called Trumpet and have the stereo files produced from the merger?

I am assuming this is the bat file I need to create.

Mark


On 09/12/2016 23:55, Jan Stary wrote:
On Dec 09 19:58:33, [hidden email] wrote:
Ok.... if I were to carry on with sox, what syntax would I need to use so
that all the 61 files in a folder are matched up with the corresponding ones
to output files with the same name in a different folder?
http://marc.info/?l=sox-users&m=148118243012683&w=2


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users





Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD
In reply to this post by Jeremy Nicoll - ml sox users

The files have to match in name not size


On 10/12/2016 00:41, Jeremy Nicoll - ml sox users wrote:
On 2016-12-09 18:58, Dr. Mark Bugeja MD wrote:
neither will it preserve pitch information I noticed. :-(

Ok.... if I were to carry on with sox, what syntax would I need to use
so that all the 61 files in a folder are matched up with the
corresponding ones to output files with the same name in a different
folder?

The files are called by notes on a scale preceded by a number eg
036-C.wav, 037-C#.wav, 038-D.wav, and so on. I therefore need to match
the 036-C.wav in the left folder with the 036-C.wav in the right
folder.
Someone will need to give you a small program that can do that.  I'm not 
going to,
because the language I write my utilities in won't be on your system and 
you'd
have to install and configure it, and understand what you were doing 
before you
could move on and actually use it.

But someone established elsewhere in the thread that VBS (I think it 
was) will run
on your system.  I know nothing about VBS but someone will tell you what 
to do.

Jan Stary has - again - pointed you at some code that would work on a 
Linux system
but not on Windows.  In essence what it does is

  - makes a list of all the files in (eg a 'left files' folder), whose 
names end in "wav"
  - then one at a time, work through that list, and:
      - work out the full name of the corresponding 'right' file
      - work out the full name of the corresponding stereo file
      - issue a sox command with all three names in it

As Jan pointed out, a simple loop like this isn't a terribly good idea; 
it's better if
there are some sanity checks in it as well - making sure that the 
derived 'right' file
actually exists before you try to use it, make sure that the result file 
doesn't exist,
stop if the sox command fails...   If it were my code I would probably 
also check that
the left & right files had the exact same size before they were used.






Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
On 2016-12-10 06:44, Dr. Mark Bugeja MD wrote:
> The files have to match in name not size

Oh?

I think what you mean is that you WANT the final stereo file to have the
same (note/pitch) name as the left & right parts.

But from everything you've said, as each pair of left & right files are
meant to
have been created from the same original source file, they should have
the exact
same size.  Putting a check that that's actually the case into a script
that
is automating merging is the kind of thing a programmer would do as an
example
of 'sanity checking'.  It should always be true, but if it isn't it's
better
that the script stops what it's doing so the user can investigate why.

On the other hand, if you already have lots of pairs of files which are
not the
same size... why is that?

Maybe they contain the same number of audio samples, but different
amounts of header
data?  If that's commonly the case I would add to my script calls of sox
with the
stat or stats (or both) effects to check in more detail that the audio
in each file
has common characteristics.

I might also change code that expected files to be the same size, to
something that
(say) accepted only very small differences in size.


It's normal for carefully-written programs to check that everything they
do actually
works, because a program can get into a terrible mess if it just issues
commands and
assumes that every one of them did exactly what was hoped.  Depending
somewhat on the
language that a program is written in, maybe two thirds of the code in a
program will
be all about checking for problems and recovering from them.

--
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD

Hi all,

What you are saying is right. I did find one pair of files that have different lengths of audio. This surprised me somewhat. Generally, the files are identical in length and carry the loop marks in exactly the same place.

Irrespective of any differences, I would still like to merge all the pairs of files into stereo. It should not be such a difficult task recreating loops again and inserting pitch tuning data. LoopAuditioneer does all that quite fast and what is left is to check that the loops do not present clicks.... again.... I can do pretty well and efficiently having done the job so often.

So, forget loops and marks and other data as the issue is complicating itself unnecessarily.

The question remains how can I use SoX (what is the script that the program recognises to accomplish the task) to automate the merging process of a number of L and R pairs of recordings into single stereo files in a separate folder. As has been pointed out the L and R files are stereo themselves with one channel muted or blank. The script must essentially match the name of the file pairs which are located in respective Left and Right folders eg BourdoneL and BourdoneR, PrincipalL and PrincipalR, TrumpetL and TrumpetR, etc.

Mark


On 10/12/2016 10:23, Jeremy Nicoll - ml sox users wrote:
On 2016-12-10 06:44, Dr. Mark Bugeja MD wrote:
The files have to match in name not size
Oh?

I think what you mean is that you WANT the final stereo file to have the
same (note/pitch) name as the left & right parts.

But from everything you've said, as each pair of left & right files are 
meant to
have been created from the same original source file, they should have 
the exact
same size.  Putting a check that that's actually the case into a script 
that
is automating merging is the kind of thing a programmer would do as an 
example
of 'sanity checking'.  It should always be true, but if it isn't it's 
better
that the script stops what it's doing so the user can investigate why.

On the other hand, if you already have lots of pairs of files which are 
not the
same size... why is that?

Maybe they contain the same number of audio samples, but different 
amounts of header
data?  If that's commonly the case I would add to my script calls of sox 
with the
stat or stats (or both) effects to check in more detail that the audio 
in each file
has common characteristics.

I might also change code that expected files to be the same size, to 
something that
(say) accepted only very small differences in size.


It's normal for carefully-written programs to check that everything they 
do actually
works, because a program can get into a terrible mess if it just issues 
commands and
assumes that every one of them did exactly what was hoped.  Depending 
somewhat on the
language that a program is written in, maybe two thirds of the code in a 
program will
be all about checking for problems and recovering from them.





Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jan Stary
In reply to this post by Dr. Mark Bugeja MD
On Dec 10 07:42:16, [hidden email] wrote:

> Thanks for that reply. Would that code, reproduced here,
>
> for left in TrumpetL/*wav; do
> name=${left##*/}
> right=TrumpetR/$name
> sox -M $left $right stereo-$name
> done
>
> create a new folder called *Trum**pet* and have the stereo files produced
> from the merger?

No. This would create the merged files in the current directory.
That could trivially be changed by running "mkdir Trumpet" first
and then "sox -M $left $right Trumpet/stereo-$name" instead of the above.

> I am assuming this is the bat file I need to create.

No. As I said in the original post, this is written for the
standard UNIX shell. The syntax of your widows command prompt
surely is different. I don't speak that.

Do not just run some code snippet someone offers you here or elsewhere.
Invest enough time into writing it yourself from scratch to understand
precisely what it does. It will be a few lines anyway.

        Jan

>
>
> On 09/12/2016 23:55, Jan Stary wrote:
> > On Dec 09 19:58:33, [hidden email] wrote:
> > > Ok.... if I were to carry on with sox, what syntax would I need to use so
> > > that all the 61 files in a folder are matched up with the corresponding ones
> > > to output files with the same name in a different folder?
> > http://marc.info/?l=sox-users&m=148118243012683&w=2
> >
> >
> > ------------------------------------------------------------------------------
> > Developer Access Program for Intel Xeon Phi Processors
> > Access to Intel Xeon Phi processor-based developer platforms.
> > With one year of Intel Parallel Studio XE.
> > Training and support from Colfax.
> > Order your platform today.http://sdm.link/xeonphi
> > _______________________________________________
> > Sox-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/sox-users
> >
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus

> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/xeonphi

> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jan Stary
In reply to this post by Dr. Mark Bugeja MD
On Dec 10 11:18:05, [hidden email] wrote:

> Hi all,
>
> What you are saying is right. I did find one pair of files that have
> different lengths of audio. This surprised me somewhat. Generally, the files
> are identical in length and carry the loop marks in exactly the same place.
>
> Irrespective of any differences, I would still like to merge all the pairs
> of files into stereo. It should not be such a difficult task recreating
> loops again and inserting pitch tuning data. LoopAuditioneer does all that
> quite fast and what is left is to check that the loops do not present
> clicks.... again.... I can do pretty well and efficiently having done the
> job so often.
>
> So, forget loops and marks and other data as the issue is complicating
> itself unnecessarily.

It seems to me that this is the gist of your problem.
Merging the mono files int ocorresponding stereo files
is a triviality. Losing the loops and marks means
you will _not_ have what you want anyway.

Do you intend to process each and every of the 2000 resulting
files manually in LoopAuditioner to recreate the loops?


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD

Well not all. Many files are "releases" and these would play at the end of the corresponding main file (the moment a MIDI keyboard key is released). That amounts to 75% of the files. So loops will need to be created and checked for only 25% of those approx 500 files and they can be processed literally over a few minutes with LoopAuditioneer including pitch information insertion. Checking the loops will take a few days. But I've been doing this regularly for thousands of files often having an average of 6 loops per sample! It is tiring and might cause damage to the ears with time, sadly.

Merging is the big job. I'd be happy if I can automate this process. If you cannot solve it because you are not versed with Windows, how am I expected to sort that out when I don't even come close to understanding the "logic" behind your string of characters and why it should be different in Windows? I think I can safely state that I would be far more confident performing a heart transplant than to play around with this code business. :-D Consider me dylexic for coding!

Regards,

Mark


On 10/12/2016 22:53, Jan Stary wrote:
On Dec 10 11:18:05, [hidden email] wrote:
Hi all,

What you are saying is right. I did find one pair of files that have
different lengths of audio. This surprised me somewhat. Generally, the files
are identical in length and carry the loop marks in exactly the same place.

Irrespective of any differences, I would still like to merge all the pairs
of files into stereo. It should not be such a difficult task recreating
loops again and inserting pitch tuning data. LoopAuditioneer does all that
quite fast and what is left is to check that the loops do not present
clicks.... again.... I can do pretty well and efficiently having done the
job so often.

So, forget loops and marks and other data as the issue is complicating
itself unnecessarily.
It seems to me that this is the gist of your problem.
Merging the mono files int ocorresponding stereo files
is a triviality. Losing the loops and marks means
you will _not_ have what you want anyway.

Do you intend to process each and every of the 2000 resulting
files manually in LoopAuditioner to recreate the loops?


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users





Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Erich Eckner
Hi,

a quick search for "bash to windows shell converter" on google lead to:

http://stackoverflow.com/questions/3200018/how-do-i-convert-a-bash-shell-script-to-a-bat-file

wich seems to explain nearly all parts, you need to "translate" the bash
scrip from Jan Stary into a .bat file.

regards,
Erich

On 10.12.2016 23:28, Dr. Mark Bugeja MD wrote:

> Well not all. Many files are "releases" and these would play at the end
> of the corresponding main file (the moment a MIDI keyboard key is
> released). That amounts to 75% of the files. So loops will need to be
> created and checked for only 25% of those approx 500 files and they can
> be processed literally over a few minutes with LoopAuditioneer including
> pitch information insertion. Checking the loops will take a few days.
> But I've been doing this regularly for thousands of files often having
> an average of 6 loops per sample! It is tiring and might cause damage to
> the ears with time, sadly.
>
> Merging is the big job. I'd be happy if I can automate this process. If
> you cannot solve it because you are not versed with Windows, how am I
> expected to sort that out when I don't even come close to understanding
> the "logic" behind your string of characters and why it should be
> different in Windows? I think I can safely state that I would be far
> more confident performing a heart transplant than to play around with
> this code business. :-D Consider me dylexic for coding!
>
> Regards,
>
> Mark
>
>
> On 10/12/2016 22:53, Jan Stary wrote:
>> On Dec 10 11:18:05, [hidden email] wrote:
>>> Hi all,
>>>
>>> What you are saying is right. I did find one pair of files that have
>>> different lengths of audio. This surprised me somewhat. Generally,
>>> the files
>>> are identical in length and carry the loop marks in exactly the same
>>> place.
>>>
>>> Irrespective of any differences, I would still like to merge all the
>>> pairs
>>> of files into stereo. It should not be such a difficult task recreating
>>> loops again and inserting pitch tuning data. LoopAuditioneer does all
>>> that
>>> quite fast and what is left is to check that the loops do not present
>>> clicks.... again.... I can do pretty well and efficiently having done
>>> the
>>> job so often.
>>>
>>> So, forget loops and marks and other data as the issue is complicating
>>> itself unnecessarily.
>> It seems to me that this is the gist of your problem.
>> Merging the mono files int ocorresponding stereo files
>> is a triviality. Losing the loops and marks means
>> you will _not_ have what you want anyway.
>>
>> Do you intend to process each and every of the 2000 resulting
>> files manually in LoopAuditioner to recreate the loops?
>>
>>
>> ------------------------------------------------------------------------------
>>
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today.http://sdm.link/xeonphi
>> _______________________________________________
>> Sox-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/xeonphi
>
>
>
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Kevin Conder
On Sun, Dec 11, 2016 at 12:43 AM, Erich Eckner <[hidden email]> wrote:

> a quick search for "bash to windows shell converter" on google lead to:
>
> http://stackoverflow.com/questions/3200018/how-do-i-convert-a-bash-shell-script-to-a-bat-file
>
> wich seems to explain nearly all parts, you need to "translate" the bash
> scrip from Jan Stary into a .bat file.

Here's a quick VBScript file that I wrote instead. Make sure you
change the soxCommand variable to point to where your sox.exe file is
installed. Change all of the directory variables to your actual
directory locations before running it. Save the script as
"combine.vbs" and run it using "cscript combine.vbs".

    ' combine.vbs - Combine audio files from different directories.
    Option Explicit

    Dim exec
    Dim file
    Dim fileName
    Dim fso
    Dim leftDir
    Dim leftFolder
    Dim rightDir
    Dim shell
    Dim soxCommand
    Dim stereoDir
    Dim subFolder
    Dim subName

    ' Make sure these paths are correct before running.
    soxCommand = "C:\Program Files (x86)\sox-14-4-2\sox.exe"
    leftDir = "C:\Users\markb\Desktop\instruments\Basson16L\"
    rightDir = "C:\Users\markb\Desktop\instruments\Basson16R\"
    stereoDir = "C:\Users\markb\Desktop\instruments\Basson16S\"

    ' Use standard Windows objects.
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set shell = CreateObject("WScript.Shell")


    Sub CreateDir(name)
        ' Create a directory, if it does not exist.
        If Not fso.FolderExists(name) Then
            fso.CreateFolder(name)
        End If
    End Sub


    ' Create a directory for the combined stereo files.
    CreateDir(stereoDir)

    ' Loop through all of the subdirectories in the Left directory.
    Set leftFolder = fso.GetFolder(leftDir)
    For Each subFolder in leftFolder.SubFolders
        ' Create a corresponding subdirectory for the combined files.
        subName = subFolder.name
        CreateDir(stereoDir & subFolder.name)

        ' Loop through all of the the files in the subdirectory.
        For Each file in subFolder.Files
            ' Execute the sox command for each file.
            fileName = file.Name
            Set exec = shell.Exec(soxCommand & " -M " & _
                                   leftDir & subName & "\" & fileName & " " & _
                                   rightDir & subName & "\" & fileName & " " & _
                                   stereoDir & subName & "\" & fileName)

            WScript.Echo stereoDir & subName & "\" & fileName
        Next
    Next

    WScript.Echo "Done."

--
Kevin Conder

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
On 2016-12-11 07:44, Kevin Conder wrote:

> Here's a quick VBScript file that I wrote instead.

Phew!  I was just trying (as a VBS neophyte) to get my head round this
problem, and
now I don't have to.  I'd suggest two changes to it though.  Where you
have Mark
define various dirs:

>     leftDir = "C:\Users\markb\Desktop\instruments\Basson16L\"
>     rightDir = "C:\Users\markb\Desktop\instruments\Basson16R\"
>     stereoDir = "C:\Users\markb\Desktop\instruments\Basson16S\"

it'd be easier for him (as he's going to have to change these values a
lot) if he replaces
those three lines with:

       Dim pathDir
       Dim sampname

       pathDir  = "C:\Users\markb\Desktop\instruments\"

       sampname = "Basson16"                   ' a sample name, without
trailing L or R

       leftDir   = pathDir & sampname & "L\"
       rightDir  = pathDir & sampname & "R\"
       stereoDir = pathDir & sampname & "S\"


then each time he'll only need to change the 'sampname' value.


Also, when you actually issue the sox command:

>             Set exec = shell.Exec(soxCommand & " -M " & _
>                                    leftDir & subName & "\" & fileName &
> " " & _
>                                    rightDir & subName & "\" & fileName
> & " " & _
>                                    stereoDir & subName & "\" &
> fileName)

the last line of that probably needs to be

       stereoDir & subName & "\" & filename & " remix 1 4")

--
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD
In reply to this post by Kevin Conder

Thanks all for your willingness and attempts to help in this issue. But it's like trying to discuss quantum physics with a 1 year old baby or a total moron.

I am hopping off the train. I can't get to understand the language you people are so conversant with. From this reply, I don't even know which part of the text should be script for the "bat" (or is it "vbs" now) file. I am sending all the files back to my friend for him to sort out.

Regards and a Blessed Christmas to all.

Mark


On 11/12/2016 08:44, Kevin Conder wrote:
On Sun, Dec 11, 2016 at 12:43 AM, Erich Eckner [hidden email] wrote:

a quick search for "bash to windows shell converter" on google lead to:

http://stackoverflow.com/questions/3200018/how-do-i-convert-a-bash-shell-script-to-a-bat-file

wich seems to explain nearly all parts, you need to "translate" the bash
scrip from Jan Stary into a .bat file.
Here's a quick VBScript file that I wrote instead. Make sure you
change the soxCommand variable to point to where your sox.exe file is
installed. Change all of the directory variables to your actual
directory locations before running it. Save the script as
"combine.vbs" and run it using "cscript combine.vbs".

    ' combine.vbs - Combine audio files from different directories.
    Option Explicit

    Dim exec
    Dim file
    Dim fileName
    Dim fso
    Dim leftDir
    Dim leftFolder
    Dim rightDir
    Dim shell
    Dim soxCommand
    Dim stereoDir
    Dim subFolder
    Dim subName

    ' Make sure these paths are correct before running.
    soxCommand = "C:\Program Files (x86)\sox-14-4-2\sox.exe"
    leftDir = "C:\Users\markb\Desktop\instruments\Basson16L\"
    rightDir = "C:\Users\markb\Desktop\instruments\Basson16R\"
    stereoDir = "C:\Users\markb\Desktop\instruments\Basson16S\"

    ' Use standard Windows objects.
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set shell = CreateObject("WScript.Shell")


    Sub CreateDir(name)
        ' Create a directory, if it does not exist.
        If Not fso.FolderExists(name) Then
            fso.CreateFolder(name)
        End If
    End Sub


    ' Create a directory for the combined stereo files.
    CreateDir(stereoDir)

    ' Loop through all of the subdirectories in the Left directory.
    Set leftFolder = fso.GetFolder(leftDir)
    For Each subFolder in leftFolder.SubFolders
        ' Create a corresponding subdirectory for the combined files.
        subName = subFolder.name
        CreateDir(stereoDir & subFolder.name)

        ' Loop through all of the the files in the subdirectory.
        For Each file in subFolder.Files
            ' Execute the sox command for each file.
            fileName = file.Name
            Set exec = shell.Exec(soxCommand & " -M " & _
                                   leftDir & subName & "\" & fileName & " " & _
                                   rightDir & subName & "\" & fileName & " " & _
                                   stereoDir & subName & "\" & fileName)

            WScript.Echo stereoDir & subName & "\" & fileName
        Next
    Next

    WScript.Echo "Done."





Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Erich Eckner
Hi,

regarding quantum physics for a one year old: that's not too hard - I've
tried and he already understands, that electrons only have descrete
energy levels and may only absorb/emitt discrete amounts of energy ...

regarding the vb-script:
From Kevins answer, you take everything that's indented (starting at "'
combine.vbs - Combine audio ...'" and ending at "WScript.Echo .."), put
that into a file named "combine.vbs" and execute that file with the
command "cscript combine.vbs" from within a command shell.

If you, however, chose to give up, that's also fine (at least for me).

regards,
Erich

On 11.12.2016 10:38, Dr. Mark Bugeja MD wrote:

> Thanks all for your willingness and attempts to help in this issue. But
> it's like trying to discuss quantum physics with a 1 year old baby or a
> total moron.
>
> I am hopping off the train. I can't get to understand the language you
> people are so conversant with. From this reply, I don't even know which
> part of the text should be script for the "bat" (or is it "vbs" now)
> file. I am sending all the files back to my friend for him to sort out.
>
> Regards and a Blessed Christmas to all.
>
> Mark
>
>
> On 11/12/2016 08:44, Kevin Conder wrote:
>> On Sun, Dec 11, 2016 at 12:43 AM, Erich Eckner <[hidden email]> wrote:
>>
>>> a quick search for "bash to windows shell converter" on google lead to:
>>>
>>> http://stackoverflow.com/questions/3200018/how-do-i-convert-a-bash-shell-script-to-a-bat-file
>>>
>>>
>>> wich seems to explain nearly all parts, you need to "translate" the bash
>>> scrip from Jan Stary into a .bat file.
>> Here's a quick VBScript file that I wrote instead. Make sure you
>> change the soxCommand variable to point to where your sox.exe file is
>> installed. Change all of the directory variables to your actual
>> directory locations before running it. Save the script as
>> "combine.vbs" and run it using "cscript combine.vbs".
>>
>>      ' combine.vbs - Combine audio files from different directories.
>>      Option Explicit
>>
>>      Dim exec
>>      Dim file
>>      Dim fileName
>>      Dim fso
>>      Dim leftDir
>>      Dim leftFolder
>>      Dim rightDir
>>      Dim shell
>>      Dim soxCommand
>>      Dim stereoDir
>>      Dim subFolder
>>      Dim subName
>>
>>      ' Make sure these paths are correct before running.
>>      soxCommand = "C:\Program Files (x86)\sox-14-4-2\sox.exe"
>>      leftDir = "C:\Users\markb\Desktop\instruments\Basson16L\"
>>      rightDir = "C:\Users\markb\Desktop\instruments\Basson16R\"
>>      stereoDir = "C:\Users\markb\Desktop\instruments\Basson16S\"
>>
>>      ' Use standard Windows objects.
>>      Set fso = CreateObject("Scripting.FileSystemObject")
>>      Set shell = CreateObject("WScript.Shell")
>>
>>
>>      Sub CreateDir(name)
>>          ' Create a directory, if it does not exist.
>>          If Not fso.FolderExists(name) Then
>>              fso.CreateFolder(name)
>>          End If
>>      End Sub
>>
>>
>>      ' Create a directory for the combined stereo files.
>>      CreateDir(stereoDir)
>>
>>      ' Loop through all of the subdirectories in the Left directory.
>>      Set leftFolder = fso.GetFolder(leftDir)
>>      For Each subFolder in leftFolder.SubFolders
>>          ' Create a corresponding subdirectory for the combined files.
>>          subName = subFolder.name
>>          CreateDir(stereoDir & subFolder.name)
>>
>>          ' Loop through all of the the files in the subdirectory.
>>          For Each file in subFolder.Files
>>              ' Execute the sox command for each file.
>>              fileName = file.Name
>>              Set exec = shell.Exec(soxCommand & " -M " & _
>>                                     leftDir & subName & "\" & fileName
>> & " " & _
>>                                     rightDir & subName & "\" &
>> fileName & " " & _
>>                                     stereoDir & subName & "\" & fileName)
>>
>>              WScript.Echo stereoDir & subName & "\" & fileName
>>          Next
>>      Next
>>
>>      WScript.Echo "Done."
>>
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/xeonphi
>
>
>
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
On 2016-12-11 10:31, Erich Eckner wrote:

> regarding the vb-script:
> From Kevins answer, you take everything that's indented (starting at "'
> combine.vbs - Combine audio ...'" and ending at "WScript.Echo .."), put
> that into a file named "combine.vbs" and execute that file with the
> command "cscript combine.vbs" from within a command shell.

Correct... in the same way that Mark earlier ran a "Hello World" sample
script.

Mark would have to edit the vbs file (using eg Notepad) to make sure
that it
contained the right definitions of the path to wherever he has his
installed
copy of sox.exe, and - in Kevin's code - the place where one of his sets
of
samples lives.  Then running the script would generate all the stereo
files
for that set of L & R samples.

He'd then have to edit the script again to change it so it pointed at a
different
set of samples, and re-run it.  And then change it again, & run it, and
so on.


If Mark made the small change I suggested then the re-edit for each
changing set
of samples would be easier.

--
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
12