sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Fwd: Re:  merging mono files
       [not found] <a4f1ff10-c573-a233-916f-3f92c66bf9ce@gmail.com>
@ 2016-12-08 13:36 ` Dr. Mark Bugeja MD
  2016-12-09 13:51   ` Jan Stary
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-08 13:36 UTC (permalink / raw)
  To: sox-users


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

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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>





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

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

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

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

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

* Re: Fwd: Re:  merging mono files
  2016-12-08 13:36 ` Fwd: Re: merging mono files Dr. Mark Bugeja MD
@ 2016-12-09 13:51   ` Jan Stary
  2016-12-09 14:10     ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jan Stary @ 2016-12-09 13:51 UTC (permalink / raw)
  To: sox-users

On Dec 08 14:36:54, marcusfb@gmail.com 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

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

* Re: Fwd: Re: merging mono files
  2016-12-09 13:51   ` Jan Stary
@ 2016-12-09 14:10     ` Dr. Mark Bugeja MD
  2016-12-09 17:48       ` Erich Eckner
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-09 14:10 UTC (permalink / raw)
  To: sox-users


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

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, marcusfb@gmail.com 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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-09 14:10     ` Dr. Mark Bugeja MD
@ 2016-12-09 17:48       ` Erich Eckner
  2016-12-09 18:58         ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Erich Eckner @ 2016-12-09 17:48 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1.1: Type: text/plain, Size: 4276 bytes --]

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, marcusfb@gmail.com 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
>> Sox-users@lists.sourceforge.net
>> 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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
> 


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-09 17:48       ` Erich Eckner
@ 2016-12-09 18:58         ` Dr. Mark Bugeja MD
  2016-12-09 22:55           ` Jan Stary
  2016-12-09 23:41           ` Jeremy Nicoll - ml sox users
  0 siblings, 2 replies; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-09 18:58 UTC (permalink / raw)
  To: sox-users


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

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, marcusfb@gmail.com 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
>>> Sox-users@lists.sourceforge.net
>>> 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
>> Sox-users@lists.sourceforge.net
>> 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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-09 18:58         ` Dr. Mark Bugeja MD
@ 2016-12-09 22:55           ` Jan Stary
  2016-12-10  6:42             ` Dr. Mark Bugeja MD
  2016-12-09 23:41           ` Jeremy Nicoll - ml sox users
  1 sibling, 1 reply; 34+ messages in thread
From: Jan Stary @ 2016-12-09 22:55 UTC (permalink / raw)
  To: sox-users

On Dec 09 19:58:33, marcusfb@gmail.com 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

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

* Re: Fwd: Re: merging mono files
  2016-12-09 18:58         ` Dr. Mark Bugeja MD
  2016-12-09 22:55           ` Jan Stary
@ 2016-12-09 23:41           ` Jeremy Nicoll - ml sox users
  2016-12-10  6:44             ` Dr. Mark Bugeja MD
  1 sibling, 1 reply; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-09 23:41 UTC (permalink / raw)
  To: sox-users

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

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

* Re: Fwd: Re: merging mono files
  2016-12-09 22:55           ` Jan Stary
@ 2016-12-10  6:42             ` Dr. Mark Bugeja MD
  2016-12-10 21:49               ` Jan Stary
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-10  6:42 UTC (permalink / raw)
  To: sox-users


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

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?

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, marcusfb@gmail.com 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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-09 23:41           ` Jeremy Nicoll - ml sox users
@ 2016-12-10  6:44             ` Dr. Mark Bugeja MD
  2016-12-10  9:23               ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-10  6:44 UTC (permalink / raw)
  To: sox-users


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

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



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-10  6:44             ` Dr. Mark Bugeja MD
@ 2016-12-10  9:23               ` Jeremy Nicoll - ml sox users
  2016-12-10 10:18                 ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-10  9:23 UTC (permalink / raw)
  To: 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

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

* Re: Fwd: Re: merging mono files
  2016-12-10  9:23               ` Jeremy Nicoll - ml sox users
@ 2016-12-10 10:18                 ` Dr. Mark Bugeja MD
  2016-12-10 21:53                   ` Jan Stary
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-10 10:18 UTC (permalink / raw)
  To: sox-users


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

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



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-10  6:42             ` Dr. Mark Bugeja MD
@ 2016-12-10 21:49               ` Jan Stary
  0 siblings, 0 replies; 34+ messages in thread
From: Jan Stary @ 2016-12-10 21:49 UTC (permalink / raw)
  To: sox-users

On Dec 10 07:42:16, marcusfb@gmail.com 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, marcusfb@gmail.com 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
> > Sox-users@lists.sourceforge.net
> > 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
> Sox-users@lists.sourceforge.net
> 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

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

* Re: Fwd: Re: merging mono files
  2016-12-10 10:18                 ` Dr. Mark Bugeja MD
@ 2016-12-10 21:53                   ` Jan Stary
  2016-12-10 22:28                     ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jan Stary @ 2016-12-10 21:53 UTC (permalink / raw)
  To: sox-users

On Dec 10 11:18:05, marcusfb@gmail.com 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

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

* Re: Fwd: Re: merging mono files
  2016-12-10 21:53                   ` Jan Stary
@ 2016-12-10 22:28                     ` Dr. Mark Bugeja MD
  2016-12-11  6:43                       ` Erich Eckner
  2016-12-11 19:08                       ` Jan Stary
  0 siblings, 2 replies; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-10 22:28 UTC (permalink / raw)
  To: sox-users


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

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, marcusfb@gmail.com 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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-10 22:28                     ` Dr. Mark Bugeja MD
@ 2016-12-11  6:43                       ` Erich Eckner
  2016-12-11  7:44                         ` Kevin Conder
  2016-12-11 19:08                       ` Jan Stary
  1 sibling, 1 reply; 34+ messages in thread
From: Erich Eckner @ 2016-12-11  6:43 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1.1: Type: text/plain, Size: 3964 bytes --]

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, marcusfb@gmail.com 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
>> Sox-users@lists.sourceforge.net
>> 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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
> 


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-11  6:43                       ` Erich Eckner
@ 2016-12-11  7:44                         ` Kevin Conder
  2016-12-11  8:59                           ` Jeremy Nicoll - ml sox users
                                             ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Kevin Conder @ 2016-12-11  7:44 UTC (permalink / raw)
  To: sox-users

On Sun, Dec 11, 2016 at 12:43 AM, Erich Eckner <erich@eckner.net> 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

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

* Re: Fwd: Re: merging mono files
  2016-12-11  7:44                         ` Kevin Conder
@ 2016-12-11  8:59                           ` Jeremy Nicoll - ml sox users
  2016-12-11  9:38                           ` Dr. Mark Bugeja MD
  2016-12-12 11:31                           ` Dr. Mark Bugeja MD
  2 siblings, 0 replies; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-11  8:59 UTC (permalink / raw)
  To: 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

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

* Re: Fwd: Re: merging mono files
  2016-12-11  7:44                         ` Kevin Conder
  2016-12-11  8:59                           ` Jeremy Nicoll - ml sox users
@ 2016-12-11  9:38                           ` Dr. Mark Bugeja MD
  2016-12-11 10:31                             ` Erich Eckner
  2016-12-12 11:31                           ` Dr. Mark Bugeja MD
  2 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-11  9:38 UTC (permalink / raw)
  To: sox-users


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

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 <erich@eckner.net> 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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-11  9:38                           ` Dr. Mark Bugeja MD
@ 2016-12-11 10:31                             ` Erich Eckner
  2016-12-11 11:16                               ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 34+ messages in thread
From: Erich Eckner @ 2016-12-11 10:31 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1.1: Type: text/plain, Size: 4826 bytes --]

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 <erich@eckner.net> 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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
> 


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-11 10:31                             ` Erich Eckner
@ 2016-12-11 11:16                               ` Jeremy Nicoll - ml sox users
  2016-12-11 20:39                                 ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-11 11:16 UTC (permalink / raw)
  To: 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

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

* Re: Fwd: Re: merging mono files
  2016-12-10 22:28                     ` Dr. Mark Bugeja MD
  2016-12-11  6:43                       ` Erich Eckner
@ 2016-12-11 19:08                       ` Jan Stary
  1 sibling, 0 replies; 34+ messages in thread
From: Jan Stary @ 2016-12-11 19:08 UTC (permalink / raw)
  To: sox-users

On Dec 10 23:28:15, marcusfb@gmail.com 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.

OK if you are OK with that ...

> 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

Here's how: learn the Windows *.bat scripting language,
or at least enough of it to write the few lines that do
what you want to do. It will be a fraction of the time
you are willing to spend on manually checking the results.

> and why it should be different in Windows?

Different languages are different.


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

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

* Re: Fwd: Re: merging mono files
  2016-12-11 11:16                               ` Jeremy Nicoll - ml sox users
@ 2016-12-11 20:39                                 ` Dr. Mark Bugeja MD
  2016-12-11 21:48                                   ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-11 20:39 UTC (permalink / raw)
  To: sox-users


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

So before I run the attached vbs file, is it ok?

(please rename to rar as the file would not send)

Mark


On 11/12/2016 12:16, Jeremy Nicoll - ml sox users wrote:
> 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.
>



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

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

[-- Attachment #2: combine.ra_ --]
[-- Type: application/rar, Size: 783 bytes --]

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

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

[-- Attachment #4: 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] 34+ messages in thread

* Re: Fwd: Re: merging mono files
  2016-12-11 20:39                                 ` Dr. Mark Bugeja MD
@ 2016-12-11 21:48                                   ` Jeremy Nicoll - ml sox users
  2016-12-12 10:41                                     ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-11 21:48 UTC (permalink / raw)
  To: sox-users

On 2016-12-11 20:39, Dr. Mark Bugeja MD wrote:
> So before I run the attached vbs file, is it ok?

It looks ok, but you're going to have to edit this file each time you 
want to
merge a different set of samples, and you'll have to change three lines 
in the
right way, each time.

You would be better to replace the lines that say:

   leftDir = "C:\Program Files 
(x86)\sox-14-4-2\input\Recit-Organ\Basson16L\"
   rightDir = "C:\Program Files 
(x86)\sox-14-4-2\input\Recit-Organ\Basson16R\"
   stereoDir = "C:\Program Files 
(x86)\sox-14-4-2\input\Recit-Organ\Basson16S\"

with

   Dim pathDir
   Dim sampname

   pathDir  = "C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\"

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

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


then when you edit the file to process a different set of samples, you 
will only
need to change one line, this one:

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

each time.


And, as I said before, the actual sox command that Kevin's program 
issues is
essentially

   sox -M leftfile ritefile stereofile

but someone-else pointed out that because your input files are NOT mono 
files (ie
not files with only a single channel in them), you really need to issue

   sox -M leftfile ritefile stereofile remix 1 4

and to achieve that you need to find the line that says

   stereoDir & subName & "\" &  fileName)

and change it to

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


For these two changes just copy & paste the text out of this email into 
your
combine.vbs file.


There might be another problem though, depending on which version of 
Windows you
are using, and whether you have UAC turned on (the thing that in W7, W8, 
W8.1 &
W10 asks for your administrator's password when you do things that need 
extra
authority).  You've apparently placed your sample files in

    C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\...

which is a folder, as the name "C:\Program Files (x86)" implies, which 
is meant
to contain programs and other parts of applications, not sample data.  
Normally
on W7 (perhaps) & definitely on W8, W8.1 and W10, Windows will not let a 
running
program create or alter any data files in subfolders of that folder.

It disallows this so that malware cannot write files into C:\Program 
Files...  or
make malicious alterations to files that are correctly installed there.  
Now while
you are just reading audio samples from there, it will work ok, but when 
you run a
sox command that tries to create a stereo file there, Windows should 
either prevent
it, or ask for your admin password EVERY TIME.

The best solution would be for you to move all the audio samples out of 
C:\Program
Files... and put them in a normal place for user data, eg your Documents 
folder, or
a folder on your Desktop.

If you do move them then in your combine.vbs file that you sent, you 
need to change
all three lines that say where the L & R files are and the S file be 
written, or, if
you adopt the code I suggested, you will need to change this line:

   pathDir  = "C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\"

so that it points at the place you moved the sample files to.



> (please rename to rar as the file would not send)

There's no need to attach a file; just copy & paste the contents 
straight into your
email.



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

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

* Re: Fwd: Re: merging mono files
  2016-12-11 21:48                                   ` Jeremy Nicoll - ml sox users
@ 2016-12-12 10:41                                     ` Dr. Mark Bugeja MD
  2016-12-12 12:12                                       ` Dr. Mark Bugeja MD
  2016-12-12 17:46                                       ` Jeremy Nicoll - ml sox users
  0 siblings, 2 replies; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-12 10:41 UTC (permalink / raw)
  To: sox-users


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

This is what I got so far.

' 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

      soxCommand = "C:\Program Files (x86)\sox-14-4-2\sox.exe"

      Dim pathDir
      Dim sampname

      pathDir  = "E:\Recit-Organ\"

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

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

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

      ' Create a directory, if it does not exist.
      Sub CreateDir(name)
          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 & " remix 1 4")

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

      WScript.Echo "Done."

Would I be correct in saying that this will handle files in subfolders 
in the same way?

Mark

On 11/12/2016 22:48, Jeremy Nicoll - ml sox users wrote:
> On 2016-12-11 20:39, Dr. Mark Bugeja MD wrote:
>> So before I run the attached vbs file, is it ok?
> It looks ok, but you're going to have to edit this file each time you
> want to
> merge a different set of samples, and you'll have to change three lines
> in the
> right way, each time.
>
> You would be better to replace the lines that say:
>
>     leftDir = "C:\Program Files
> (x86)\sox-14-4-2\input\Recit-Organ\Basson16L\"
>     rightDir = "C:\Program Files
> (x86)\sox-14-4-2\input\Recit-Organ\Basson16R\"
>     stereoDir = "C:\Program Files
> (x86)\sox-14-4-2\input\Recit-Organ\Basson16S\"
>
> with
>
>     Dim pathDir
>     Dim sampname
>
>     pathDir  = "C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\"
>
>     sampname = "Basson16"      ' a sample name, without a trailing L or R
>
>     leftDir   = pathDir & sampname & "L\"
>     rightDir  = pathDir & sampname & "R\"
>     stereoDir = pathDir & sampname & "S\"
>
>
> then when you edit the file to process a different set of samples, you
> will only
> need to change one line, this one:
>
>     sampname = "Basson16"        ' a sample name, without a trailing L or
> R
>
> each time.
>
>
> And, as I said before, the actual sox command that Kevin's program
> issues is
> essentially
>
>     sox -M leftfile ritefile stereofile
>
> but someone-else pointed out that because your input files are NOT mono
> files (ie
> not files with only a single channel in them), you really need to issue
>
>     sox -M leftfile ritefile stereofile remix 1 4
>
> and to achieve that you need to find the line that says
>
>     stereoDir & subName & "\" &  fileName)
>
> and change it to
>
>     stereoDir & subName & "\" &  filename & " remix 1 4")
>
>
> For these two changes just copy & paste the text out of this email into
> your
> combine.vbs file.
>
>
> There might be another problem though, depending on which version of
> Windows you
> are using, and whether you have UAC turned on (the thing that in W7, W8,
> W8.1 &
> W10 asks for your administrator's password when you do things that need
> extra
> authority).  You've apparently placed your sample files in
>
>      C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\...
>
> which is a folder, as the name "C:\Program Files (x86)" implies, which
> is meant
> to contain programs and other parts of applications, not sample data.
> Normally
> on W7 (perhaps) & definitely on W8, W8.1 and W10, Windows will not let a
> running
> program create or alter any data files in subfolders of that folder.
>
> It disallows this so that malware cannot write files into C:\Program
> Files...  or
> make malicious alterations to files that are correctly installed there.
> Now while
> you are just reading audio samples from there, it will work ok, but when
> you run a
> sox command that tries to create a stereo file there, Windows should
> either prevent
> it, or ask for your admin password EVERY TIME.
>
> The best solution would be for you to move all the audio samples out of
> C:\Program
> Files... and put them in a normal place for user data, eg your Documents
> folder, or
> a folder on your Desktop.
>
> If you do move them then in your combine.vbs file that you sent, you
> need to change
> all three lines that say where the L & R files are and the S file be
> written, or, if
> you adopt the code I suggested, you will need to change this line:
>
>     pathDir  = "C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\"
>
> so that it points at the place you moved the sample files to.
>
>
>
>> (please rename to rar as the file would not send)
> There's no need to attach a file; just copy & paste the contents
> straight into your
> email.
>
>
>



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-11  7:44                         ` Kevin Conder
  2016-12-11  8:59                           ` Jeremy Nicoll - ml sox users
  2016-12-11  9:38                           ` Dr. Mark Bugeja MD
@ 2016-12-12 11:31                           ` Dr. Mark Bugeja MD
  2016-12-12 18:06                             ` Jeremy Nicoll - ml sox users
  2 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-12 11:31 UTC (permalink / raw)
  To: sox-users


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

Does the file need to be placed anywhere in particular eg in the folder 
where the files to be processed are kept. I think not.

When I open the cmd promt window, do I need to configure a path before 
executing the script?

Mark


On 11/12/2016 08:44, Kevin Conder wrote:
> Save the script as
> "combine.vbs" and run it using "cscript combine.vbs".



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-12 10:41                                     ` Dr. Mark Bugeja MD
@ 2016-12-12 12:12                                       ` Dr. Mark Bugeja MD
  2016-12-12 18:00                                         ` Jeremy Nicoll - ml sox users
  2016-12-12 17:46                                       ` Jeremy Nicoll - ml sox users
  1 sibling, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-12 12:12 UTC (permalink / raw)
  To: sox-users


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

Should files in subfolders be handled in the same way as those in the 
main folders, by running the script, then it might be even better to 
separate the L folders from the R folders:

Recit Organ > Left > Bourdon16L
                                  > BassoonHautbois8L
                                  > Cor-De-Buit8L
                                  > etc etc
                       > Right > Bourdon16R
                                      > BassoonHautbois8R
                                      > Cor-De-Buit8R
                                      > etc etc
NB: each folder has a list of files + 3 folders, each with its own list 
of files. Structure and names of L folders correspond to R folders.
           __________________
Then modifying the script to:

             pathDir  = "E:\"

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

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

            __________________

.... also, Stereo files could be placed directly into folders without 
the "S"

Whilst bearing in mind that files have no L or R in their file names, 
lefts and rights being only denoted in the folder names, would this 
alteration to the script be expected to create folders and files under 
the E:\Recit Organ folder with subfolders being created accordingly?

Files names must not be altered.

Mark
On 12/12/2016 11:41, Dr. Mark Bugeja MD wrote:
>
> This is what I got so far.
>
> ' 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
>
>      soxCommand = "C:\Program Files (x86)\sox-14-4-2\sox.exe"
>
>      Dim pathDir
>      Dim sampname
>
>      pathDir  = "E:\Recit-Organ\"
>
>      ' a sample name, without a trailing L or R
>      sampname = "Basson16"
>
>      leftDir   = pathDir & sampname & "L\"
>      rightDir  = pathDir & sampname & "R\"
>      stereoDir = pathDir & sampname & "S\"
>
>      ' Use standard Windows objects.
>      Set fso = CreateObject("Scripting.FileSystemObject")
>      Set shell = CreateObject("WScript.Shell")
>
>      ' Create a directory, if it does not exist.
>      Sub CreateDir(name)
>          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 & " remix 1 4")
>
>              WScript.Echo stereoDir & subName & "\" & fileName
>          Next
>      Next
>
>      WScript.Echo "Done."
>
> Would I be correct in saying that this will handle files in subfolders 
> in the same way?
>
> Mark
>
> On 11/12/2016 22:48, Jeremy Nicoll - ml sox users wrote:
>> On 2016-12-11 20:39, Dr. Mark Bugeja MD wrote:
>>> So before I run the attached vbs file, is it ok?
>> It looks ok, but you're going to have to edit this file each time you
>> want to
>> merge a different set of samples, and you'll have to change three lines
>> in the
>> right way, each time.
>>
>> You would be better to replace the lines that say:
>>
>>     leftDir = "C:\Program Files
>> (x86)\sox-14-4-2\input\Recit-Organ\Basson16L\"
>>     rightDir = "C:\Program Files
>> (x86)\sox-14-4-2\input\Recit-Organ\Basson16R\"
>>     stereoDir = "C:\Program Files
>> (x86)\sox-14-4-2\input\Recit-Organ\Basson16S\"
>>
>> with
>>
>>     Dim pathDir
>>     Dim sampname
>>
>>     pathDir  = "C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\"
>>
>>     sampname = "Basson16"      ' a sample name, without a trailing L or R
>>
>>     leftDir   = pathDir & sampname & "L\"
>>     rightDir  = pathDir & sampname & "R\"
>>     stereoDir = pathDir & sampname & "S\"
>>
>>
>> then when you edit the file to process a different set of samples, you
>> will only
>> need to change one line, this one:
>>
>>     sampname = "Basson16"        ' a sample name, without a trailing L or
>> R
>>
>> each time.
>>
>>
>> And, as I said before, the actual sox command that Kevin's program
>> issues is
>> essentially
>>
>>     sox -M leftfile ritefile stereofile
>>
>> but someone-else pointed out that because your input files are NOT mono
>> files (ie
>> not files with only a single channel in them), you really need to issue
>>
>>     sox -M leftfile ritefile stereofile remix 1 4
>>
>> and to achieve that you need to find the line that says
>>
>>     stereoDir & subName & "\" &  fileName)
>>
>> and change it to
>>
>>     stereoDir & subName & "\" &  filename & " remix 1 4")
>>
>>
>> For these two changes just copy & paste the text out of this email into
>> your
>> combine.vbs file.
>>
>>
>> There might be another problem though, depending on which version of
>> Windows you
>> are using, and whether you have UAC turned on (the thing that in W7, W8,
>> W8.1 &
>> W10 asks for your administrator's password when you do things that need
>> extra
>> authority).  You've apparently placed your sample files in
>>
>>      C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\...
>>
>> which is a folder, as the name "C:\Program Files (x86)" implies, which
>> is meant
>> to contain programs and other parts of applications, not sample data.
>> Normally
>> on W7 (perhaps) & definitely on W8, W8.1 and W10, Windows will not let a
>> running
>> program create or alter any data files in subfolders of that folder.
>>
>> It disallows this so that malware cannot write files into C:\Program
>> Files...  or
>> make malicious alterations to files that are correctly installed there.
>> Now while
>> you are just reading audio samples from there, it will work ok, but when
>> you run a
>> sox command that tries to create a stereo file there, Windows should
>> either prevent
>> it, or ask for your admin password EVERY TIME.
>>
>> The best solution would be for you to move all the audio samples out of
>> C:\Program
>> Files... and put them in a normal place for user data, eg your Documents
>> folder, or
>> a folder on your Desktop.
>>
>> If you do move them then in your combine.vbs file that you sent, you
>> need to change
>> all three lines that say where the L & R files are and the S file be
>> written, or, if
>> you adopt the code I suggested, you will need to change this line:
>>
>>     pathDir  = "C:\Program Files (x86)\sox-14-4-2\input\Recit-Organ\"
>>
>> so that it points at the place you moved the sample files to.
>>
>>
>>
>>> (please rename to rar as the file would not send)
>> There's no need to attach a file; just copy & paste the contents
>> straight into your
>> email.
>>
>>
>>
>



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

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

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

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

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

* Re: Fwd: Re: merging mono files
  2016-12-12 10:41                                     ` Dr. Mark Bugeja MD
  2016-12-12 12:12                                       ` Dr. Mark Bugeja MD
@ 2016-12-12 17:46                                       ` Jeremy Nicoll - ml sox users
  1 sibling, 0 replies; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-12 17:46 UTC (permalink / raw)
  To: sox-users

On 2016-12-12 10:41, Dr. Mark Bugeja MD wrote:
> This is what I got so far.

[snip]

> Would I be correct in saying that this will handle files in subfolders
> in the same way?

Yes.


-- 
Jeremy Nicoll - my opinions are my own

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

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

* Re: Fwd: Re: merging mono files
  2016-12-12 12:12                                       ` Dr. Mark Bugeja MD
@ 2016-12-12 18:00                                         ` Jeremy Nicoll - ml sox users
  2016-12-12 18:15                                           ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-12 18:00 UTC (permalink / raw)
  To: sox-users

On 2016-12-12 12:12, Dr. Mark Bugeja MD wrote:
> Should files in subfolders be handled in the same way as those in the
> main folders, by running the script, then it might be even better to
> separate the L folders from the R folders:
> 
> Recit Organ > Left  > Bourdon16L
>                     > BassoonHautbois8L
>                     > Cor-De-Buit8L
>                     > etc etc
>             > Right > Bourdon16R
>                     > BassoonHautbois8R
>                     > Cor-De-Buit8R
>                     > etc etc

> NB: each folder has a list of files + 3 folders, each with its own
> list of files. Structure and names of L folders correspond to R
> folders.

For the purposes of running the merges I'd suggest you don't change the
structure of the files.

After you've merged them, you can move the individual files around 
however
you please.


> Then modifying the script to:
> 
>             pathDir  = "E:\"
> 
>              ' a sample name, without a trailing L or R
>              sampname = "Recit Organ"
> 
>              leftDir   = pathDir & sampname & "L\"
>              rightDir  = pathDir & sampname & "R\"
>              stereoDir = pathDir & sampname

This will not work because you've lost the "Basson16" (etc) part of a 
sample name.

WORSE, from a programmer's perspective, and likely to complicate your 
understanding
of what the script does, is that having a 'variable' called 'sampname' 
and then
storing in it something that does not include a sample name, just 
obscures what the
code is meant to do.



> .... also, Stereo files could be placed directly into folders without 
> the "S"

Yes, they could be... but at the moment you have a 'standard convention' 
in that
folder names are the base sample name plus one letter.  Programmers like 
simple
ideas like this because it means that if you find in future you need to 
do other
automated manipulation of folders, it's easy to write code that 'knows' 
that every
such folder is named 'samplename' + L/R/S.  If you change that then you 
lose some
knowledge about what's in that kind of folder, and increase the chance 
that you
accidentally damage the wrong files, and you also need to write more 
logic that
knows when the suffix letter is there and when it is not.



-- 
Jeremy Nicoll - my opinions are my own

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

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

* Re: Fwd: Re: merging mono files
  2016-12-12 11:31                           ` Dr. Mark Bugeja MD
@ 2016-12-12 18:06                             ` Jeremy Nicoll - ml sox users
  2016-12-12 18:35                               ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-12 18:06 UTC (permalink / raw)
  To: sox-users

On 2016-12-12 11:31, Dr. Mark Bugeja MD wrote:
> Does the file need to be placed anywhere in particular eg in the
> folder where the files to be processed are kept. I think not.

It doesn't matter where you keep the script.


> When I open the cmd promt window, do I need to configure a path before
> executing the script?

No; execute the command as

C:\> cscript.exe "C:\wherever\you\put\it\combine.vbs"


After you've run it once, then edited the script to make it point at 
another set
of samples, you don't need to retype the whole cscript.exe ...   
command, provided
you still have the command window open on screen.

Just press up arrow and the system will bring the old command back (if 
you press up
several times it will bring back successively older commands).  Once a 
previous
command is visible again, either just press Enter to run it again 
unaltered, or
(though in this case you have no need to) use the left & right arrow 
keys, and insert,
backspace and Del as required, to change the details in the command, 
then press Enter
to run that altered command.

-- 
Jeremy Nicoll - my opinions are my own

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

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

* Re: Fwd: Re: merging mono files
  2016-12-12 18:00                                         ` Jeremy Nicoll - ml sox users
@ 2016-12-12 18:15                                           ` Dr. Mark Bugeja MD
  2016-12-12 18:51                                             ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-12 18:15 UTC (permalink / raw)
  To: sox-users


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

At the end of the day I only need the merged files. By what I suggested, 
I though I could go one step further of automating the lot with a single 
click since, as you say, subfolders are processed too. So I reckoned 
that creating a structure of folders and subfolders like this, the 
entire lot could be processed without having to go back to the script 
and change the name each time.

I hope to get the most out of the script and should I have reasons to 
process other files similary, all I would have to do is keep the 
structure the same irrespective of the different names that other 
samplesets would carry.

Mark


On 12/12/2016 19:00, Jeremy Nicoll - ml sox users wrote:
> On 2016-12-12 12:12, Dr. Mark Bugeja MD wrote:
>> Should files in subfolders be handled in the same way as those in the
>> main folders, by running the script, then it might be even better to
>> separate the L folders from the R folders:
>>
>> Recit Organ > Left  > Bourdon16L
>>                      > BassoonHautbois8L
>>                      > Cor-De-Buit8L
>>                      > etc etc
>>              > Right > Bourdon16R
>>                      > BassoonHautbois8R
>>                      > Cor-De-Buit8R
>>                      > etc etc
>> NB: each folder has a list of files + 3 folders, each with its own
>> list of files. Structure and names of L folders correspond to R
>> folders.
> For the purposes of running the merges I'd suggest you don't change the
> structure of the files.
>
> After you've merged them, you can move the individual files around
> however
> you please.
>
>
>> Then modifying the script to:
>>
>>              pathDir  = "E:\"
>>
>>               ' a sample name, without a trailing L or R
>>               sampname = "Recit Organ"
>>
>>               leftDir   = pathDir & sampname & "L\"
>>               rightDir  = pathDir & sampname & "R\"
>>               stereoDir = pathDir & sampname
> This will not work because you've lost the "Basson16" (etc) part of a
> sample name.
>
> WORSE, from a programmer's perspective, and likely to complicate your
> understanding
> of what the script does, is that having a 'variable' called 'sampname'
> and then
> storing in it something that does not include a sample name, just
> obscures what the
> code is meant to do.
>
>
>
>> .... also, Stereo files could be placed directly into folders without
>> the "S"
> Yes, they could be... but at the moment you have a 'standard convention'
> in that
> folder names are the base sample name plus one letter.  Programmers like
> simple
> ideas like this because it means that if you find in future you need to
> do other
> automated manipulation of folders, it's easy to write code that 'knows'
> that every
> such folder is named 'samplename' + L/R/S.  If you change that then you
> lose some
> knowledge about what's in that kind of folder, and increase the chance
> that you
> accidentally damage the wrong files, and you also need to write more
> logic that
> knows when the suffix letter is there and when it is not.
>
>
>



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

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

[-- Attachment #2: Type: text/plain, Size: 203 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] 34+ messages in thread

* Re: Fwd: Re: merging mono files
  2016-12-12 18:06                             ` Jeremy Nicoll - ml sox users
@ 2016-12-12 18:35                               ` Dr. Mark Bugeja MD
  2016-12-12 19:02                                 ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-12 18:35 UTC (permalink / raw)
  To: sox-users


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

I ran the script. It seems to have merged the files in the subfolders 
but not those in the main folder!


On 12/12/2016 19:06, Jeremy Nicoll - ml sox users wrote:
> C:\> cscript.exe "C:\wherever\you\put\it\combine.vbs"



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

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

[-- Attachment #2: Type: text/plain, Size: 203 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] 34+ messages in thread

* Re: Fwd: Re: merging mono files
  2016-12-12 18:15                                           ` Dr. Mark Bugeja MD
@ 2016-12-12 18:51                                             ` Jeremy Nicoll - ml sox users
  0 siblings, 0 replies; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-12 18:51 UTC (permalink / raw)
  To: sox-users

On 2016-12-12 18:15, Dr. Mark Bugeja MD wrote:
> At the end of the day I only need the merged files. By what I
> suggested, I though I could go one step further of automating the lot
> with a single click since, as you say, subfolders are processed too.
> So I reckoned that creating a structure of folders and subfolders like
> this, the entire lot could be processed without having to go back to
> the script and change the name each time.

That would require a somewhat more complicated script, because you'd be
expecting the thing to work through a list of sample names, then for 
each
of them do what the current script does.

Yes, someone could change the script to do that, but the more logic 
that's
put in a script the more there is to go wrong.



> I hope to get the most out of the script and should I have reasons to
> process other files similary, all I would have to do is keep the
> structure the same irrespective of the different names that other
> samplesets would carry.

You should make an effort to understand how the present script works, 
then.

-- 
Jeremy Nicoll - my opinions are my own

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

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

* Re: Fwd: Re: merging mono files
  2016-12-12 18:35                               ` Dr. Mark Bugeja MD
@ 2016-12-12 19:02                                 ` Jeremy Nicoll - ml sox users
  2016-12-12 20:06                                   ` Dr. Mark Bugeja MD
  0 siblings, 1 reply; 34+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2016-12-12 19:02 UTC (permalink / raw)
  To: sox-users

On 2016-12-12 18:35, Dr. Mark Bugeja MD wrote:
> I ran the script. It seems to have merged the files in the subfolders
> but not those in the main folder!

I don't think you described files being in a main folder.  Your example 
showed
that they were in eg

   \Basson16L\relnnnnn\
& \Basson16R\relnnnnn\

The existing script, given the path and a sample name like "Basson16" 
finds and
merges files in subfolders of Basson16L and Basson16R.

That's what I expected it to need to do, and what Kevin expected it to 
need to do.
If you wanted it to do something else as well, you'd have needed to 
explain that
more clearly.


But more to the point, if you do have sample files in a main folder as 
well as sub-
folders, it's hard to understand why.  Do they not also correspond to a 
particular
stop?  Even if they don't, and they had to be a separate collection, I'd 
have put
them in a dummy subfolder of their own, eg

   \~mainfilesL\relnnnnn\
& \~mainfilesR\relnnnnn\

simply because that would have kept the file structure the same for all 
of them,
& thus kept the scripts simple.  That "~mainfilesL" has a "~" at the 
start so it
would appear at the start of an alphabetically-sorted list of folders.


-- 
Jeremy Nicoll - my opinions are my own

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

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

* Re: Fwd: Re: merging mono files
  2016-12-12 19:02                                 ` Jeremy Nicoll - ml sox users
@ 2016-12-12 20:06                                   ` Dr. Mark Bugeja MD
  0 siblings, 0 replies; 34+ messages in thread
From: Dr. Mark Bugeja MD @ 2016-12-12 20:06 UTC (permalink / raw)
  To: sox-users


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

I did explain before that the main folders have samples PLUS 3 folders, 
each with samples of their own. I just sent a reply to highlight this fact.

I am in the process of creating "main" subfolders, shifting the main 
files there and repeating the process. Seems to be working fine like this.

The structure of the folders is how GrandOrgue and Hauptwerk recognize 
the main files for a note/sound, with releases for those notes in 
appropriate subfolders. There are usually 2 or 3 releases per main file. 
Sometimes the longest release is part of the main file and marked with a 
cue point where it starts hence the additional 2 releases are in 
separate folders. The releases are of different duration to mimic 
staccato (pressing a note which a sharp tap, immediately releasing it), 
a portato (what you get if you hold a note just a bit longer) and the 
sustained release (which is what one would hear on keeping a note held 
for a longer duration). The tails are progressively longer (measured in 
hundreds of milliseconds, of course) and produce the echo heard best in 
a hall or church. This is a fine detail in reproducing notes digitally 
but detectable by musicians. Without the releases, the notes sound dull 
or "dry" as you would get in a small carpeted room.... no echo (no 
reverb) at all.

Thanks. For all intents and purposes..... Mission Accomplished!

There was no way I was going to achieve this on my own. Had I followed 
some advice given hear, I'd still be desperately tearing my hair out and 
banging my forehead on the table.

I must thank in particular Kevin Conder and Jeremy Nicoll who spared me 
a lot of tears, bruises and a fractured skull.... not to mention a 
broken computer screen!

Well done!
Mark

On 12/12/2016 20:02, Jeremy Nicoll - ml sox users wrote:
> On 2016-12-12 18:35, Dr. Mark Bugeja MD wrote:
>> I ran the script. It seems to have merged the files in the subfolders
>> but not those in the main folder!
> I don't think you described files being in a main folder.  Your example
> showed
> that they were in eg
>
>     \Basson16L\relnnnnn\
> & \Basson16R\relnnnnn\
>
> The existing script, given the path and a sample name like "Basson16"
> finds and
> merges files in subfolders of Basson16L and Basson16R.
>
> That's what I expected it to need to do, and what Kevin expected it to
> need to do.
> If you wanted it to do something else as well, you'd have needed to
> explain that
> more clearly.
>
>
> But more to the point, if you do have sample files in a main folder as
> well as sub-
> folders, it's hard to understand why.  Do they not also correspond to a
> particular
> stop?  Even if they don't, and they had to be a separate collection, I'd
> have put
> them in a dummy subfolder of their own, eg
>
>     \~mainfilesL\relnnnnn\
> & \~mainfilesR\relnnnnn\
>
> simply because that would have kept the file structure the same for all
> of them,
> & thus kept the scripts simple.  That "~mainfilesL" has a "~" at the
> start so it
> would appear at the start of an alphabetically-sorted list of folders.
>
>



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

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

[-- Attachment #2: Type: text/plain, Size: 203 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] 34+ messages in thread

end of thread, other threads:[~2016-12-12 20:06 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <a4f1ff10-c573-a233-916f-3f92c66bf9ce@gmail.com>
2016-12-08 13:36 ` Fwd: Re: merging mono files Dr. Mark Bugeja MD
2016-12-09 13:51   ` Jan Stary
2016-12-09 14:10     ` Dr. Mark Bugeja MD
2016-12-09 17:48       ` Erich Eckner
2016-12-09 18:58         ` Dr. Mark Bugeja MD
2016-12-09 22:55           ` Jan Stary
2016-12-10  6:42             ` Dr. Mark Bugeja MD
2016-12-10 21:49               ` Jan Stary
2016-12-09 23:41           ` Jeremy Nicoll - ml sox users
2016-12-10  6:44             ` Dr. Mark Bugeja MD
2016-12-10  9:23               ` Jeremy Nicoll - ml sox users
2016-12-10 10:18                 ` Dr. Mark Bugeja MD
2016-12-10 21:53                   ` Jan Stary
2016-12-10 22:28                     ` Dr. Mark Bugeja MD
2016-12-11  6:43                       ` Erich Eckner
2016-12-11  7:44                         ` Kevin Conder
2016-12-11  8:59                           ` Jeremy Nicoll - ml sox users
2016-12-11  9:38                           ` Dr. Mark Bugeja MD
2016-12-11 10:31                             ` Erich Eckner
2016-12-11 11:16                               ` Jeremy Nicoll - ml sox users
2016-12-11 20:39                                 ` Dr. Mark Bugeja MD
2016-12-11 21:48                                   ` Jeremy Nicoll - ml sox users
2016-12-12 10:41                                     ` Dr. Mark Bugeja MD
2016-12-12 12:12                                       ` Dr. Mark Bugeja MD
2016-12-12 18:00                                         ` Jeremy Nicoll - ml sox users
2016-12-12 18:15                                           ` Dr. Mark Bugeja MD
2016-12-12 18:51                                             ` Jeremy Nicoll - ml sox users
2016-12-12 17:46                                       ` Jeremy Nicoll - ml sox users
2016-12-12 11:31                           ` Dr. Mark Bugeja MD
2016-12-12 18:06                             ` Jeremy Nicoll - ml sox users
2016-12-12 18:35                               ` Dr. Mark Bugeja MD
2016-12-12 19:02                                 ` Jeremy Nicoll - ml sox users
2016-12-12 20:06                                   ` Dr. Mark Bugeja MD
2016-12-11 19:08                       ` 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).