Fwd: Re: merging mono files

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

Re: Fwd: Re: merging mono files

Jan Stary
On Dec 10 23:28:15, [hidden email] 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
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

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

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.





Avast logo

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



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

combine.ra_ (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
On 2016-12-11 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
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD

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.







Avast logo

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



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

Re: Fwd: Re: merging mono files

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

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




Avast logo

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



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

Re: Fwd: Re: merging mono files

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

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.








Avast logo

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



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

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
In reply to this post by Dr. Mark Bugeja MD
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
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
In reply to this post by Dr. Mark Bugeja MD
On 2016-12-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
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
In reply to this post by Dr. Mark Bugeja MD
On 2016-12-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
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

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

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.







Avast logo

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



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

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

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"




Avast logo

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



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
In reply to this post by Dr. Mark Bugeja MD
On 2016-12-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
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Jeremy Nicoll - ml sox users
In reply to this post by Dr. Mark Bugeja MD
On 2016-12-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
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Re: merging mono files

Dr. Mark Bugeja MD

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.






Avast logo

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



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
12