Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free (Read 32032 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #25
drag and drop so a cmd file would work but a bat which would convert one file after another doesn't
the complete bat would be
Code: [Select]
@echo off
set PATH="C:\Program Files\Audio-Resampler\"
set ART=%PATH%\art.exe
FOR %%A IN ("*.wav") DO %ART% %%A "%%~nxA-24-down-pitch.wav" -4 --pitch=-72
that is supposed to pick every file with the extension ".wav" in one folder and encodes them with changed pitch one after another. It puts out the error "extra unknown argument:!"

thanks for looking into it, fooball
I quickly tried this on a Windows VM and I got that error when there were spaces in the WAV filename, like the quotes weren't being passed down to the application.

I was able to fix it by renaming the WAV files, but someone familiar with these kinds of issues on Windows could probably fix the batch file.

Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #26
Will quotation marks here help?
 
FOR %%A IN ("*.wav") DO %ART%  "%%A"  "%%~nxA-24-down-pitch.wav" -4 --pitch=-72

Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #27
Will quotation marks here help?
 
FOR %%A IN ("*.wav") DO %ART%  "%%A"  "%%~nxA-24-down-pitch.wav" -4 --pitch=-72

Yup, that's the fix. Thanks!

Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #28
There are lots of things wrong with this, eg the command search path gets re-written but not restored, and if you wanted to use other commands within the .bat they're not on the search path any more!

More tomorrow.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #29
I think this might do it:

Code: [Select]
@ECHO OFF

REM **********************************************************************
REM Drag&drop pitch shifter.  Supports selecting and dropping up to 255
REM files and/or folders.  For folders, all files within that folder are processed
REM (non-recursive).  Any file that is not .wav is ignored.  Output filenames
REM are the same as the input plus a suffix.
REM
REM The .bat can also be run on the command line, with files and folders
REM listed as parameters.  Filenames can include wild cards.
REM **********************************************************************

SET PROCESS="C:\Program Files\Audio-Resampler\art.exe"
SET SUFFIX="-24-down-pitch"
SET SWITCHES="-4 --pitch=-72"

:mainloop

REM Exit if parameter list is empty.
IF [%1]==[] GOTO end

REM Loop over all entities within a folder or which match the filename specification...
FOR %%G IN ("%1") DO (

  REM ...and ignore any non-wav file extension
  IF -i [%%~xG]==[.WAV] (

    REM Preserve original working directory and change to directory of
    REM current file.
    PUSHD "%%~dpG"

    REM
    "%PROCESS%" %%G "%%~dpnG%SUFFIX%.wav" %SWITCHES%

    REM Restore original working directory.
    POPD

  )
)

REM Shift all parameters down (discarding %1), and loop.
SHIFT
GOTO mainloop

:end

I might have to help debug it.  SS64.com is a superb resource.

I like to put my executable utilities on the standard command path by creating a link within (eg) Windows\System32 directly to the executable (wherever that might be, usually in a development folder).
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #30
There's an "oops" in the above, next rev (all I've done is wrap a %%G in double-quotes, add an EXIT, and add to the comments):

Code: [Select]
@ECHO OFF

REM **********************************************************************
REM Drag&drop pitch shifter.  Supports selecting and dropping up to 255
REM files and/or folders.  For folders, all files within that folder are processed
REM (non-recursive).  Any file that is not .wav is ignored.  Output filenames
REM are the same as the input plus a suffix.
REM
REM The .bat can also be run on the command line, with files and folders
REM listed as input parameters.  Filenames can include wild cards.
REM **********************************************************************

SET PROCESS="C:\Program Files\Audio-Resampler\art.exe"
SET SUFFIX="-24-down-pitch"
SET SWITCHES="-4 --pitch=-72"

:mainloop

REM Exit if parameter list is empty.
IF [%1]==[] GOTO end

REM Loop over all entities within a folder or which match the filename specification...
FOR %%G IN ("%1") DO (

  REM ...and ignore any non-wav file extension
  IF -i [%%~xG]==[.WAV] (

    REM Preserve original working directory and change to directory of
    REM current file.
    PUSHD "%%~dpG"

    REM Run the process on the current file.
    "%PROCESS%" "%%G" "%%~dpnG%SUFFIX%.wav" %SWITCHES%

    REM Restore original working directory.
    POPD

  )
)

REM Shift all parameters down (discarding %1), and loop.
REM NB: files/folders dropped onto the .bat are assigned to
REM %1-255.
SHIFT
GOTO mainloop

:end
EXIT
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #31
Will quotation marks here help?
 FOR %%A IN ("*.wav") DO %ART%  "%%A"  "%%~nxA-24-down-pitch.wav" -4 --pitch=-72
that works perfect. Thanks a lot.

There are lots of things wrong with this, eg the command search path gets re-written but not restored, and if you wanted to use other commands within the .bat they're not on the search path any more!
Your variant is something else, very interesting. However I never had any issues with any errors in my simple/half assed variant ;-)
I use that within ffmpeg for years.


Re: Changing Pitch -0,1% - 4,271% (PAL/NTSC) without changing length, artefact-free

Reply #32
But you said:
...which would process all .wav files in one folder. That would be amazing.  I tried it but it wasn't supported. So far I only used is as a drag and drop cmd which worked.
...so how much more "amazing" that my script can not only process all .wav files in one folder (on the command line) but drag&drop multiple files and folders, no command line required?  Your choice, I don't care (and I still think it's a fool's errand).
It's your privilege to disagree, but that doesn't make you right and me wrong.