mp3's and commandline nyquist

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

mp3's and commandline nyquist

Alex Ryu
Hello
I have two questions - first, is it possible to read mp3's in Nyquist?
 I have not found any documentation about it, so I suspect the answer
is no, but here's hoping.
Given that it's not - I need to process many mp3's - so many that I do
not have the space to batch-convert them (using sox) to wav's.  What I
would like to do is (using python, on Windows)
loop through the files, converting each one (calling sox from python),
analyzing it using a Nyquist function, and then delete the wav file.
I have not figured out how to use Nyquist from the commandline in this
manner, however.  Also, is there an expensive Lisp VM start-up period,
or some such that will hurt performance?
Thank you for any help

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
Reply | Threaded
Open this post in threaded view
|

Re: mp3's and commandline nyquist

Gale
Administrator

| From Alex Ryu <[hidden email]>
| Thu, 14 Jul 2011 15:56:58 -0400
| Subject: [Audacity-nyquist] mp3's and commandline nyquist

> I have two questions - first, is it possible to read mp3's in Nyquist?
>  I have not found any documentation about it, so I suspect the answer
> is no, but here's hoping.
> Given that it's not - I need to process many mp3's - so many that I do
> not have the space to batch-convert them (using sox) to wav's.  What I
> would like to do is (using python, on Windows)
> loop through the files, converting each one (calling sox from python),
> analyzing it using a Nyquist function, and then delete the wav file.
> I have not figured out how to use Nyquist from the commandline in this
> manner, however.  Also, is there an expensive Lisp VM start-up period,
> or some such that will hurt performance?

Not sure this will help, but... what is the purpose of what you want do
to? Is importing the MP3s into Audacity as PCM sufficient?

If Audacity supports what you want to do in Nyquist (what analysis do
you want to do?) then it's possible to run arbitrary Nyquist code in a
chain batch process (in Audacity Beta). Audacity clears its temp space
after processing each file in the chain. You need to edit and compile
Audacity code though:
http://forum.audacityteam.org/viewtopic.php?f=20&t=57129 





Gale

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
rbd
Reply | Threaded
Open this post in threaded view
|

Re: mp3's and commandline nyquist

rbd
In reply to this post by Alex Ryu
Nyquist does not currently read mp3s. I would suggest that you use
Nyquist rather than Python to call a conversion program using Nyquist's
SYSTEM function. Then you can operate on the file and delete it, again
using SYSTEM.

If you really want to call Nyquist from the command line, that's
possible, but the only arguments you can pass in are files to load, so
to pass arbitrary arguments, you need to write the arguments into
expressions in a file that can be loaded as XLISP source.

As for startup overhead, here's a measurement on my MacBook Pro starting
nyquist and loading a file that calls (EXIT). (Probably, the files are
cached so this is not a cold start).

real    0m0.160s
user    0m0.034s
sys    0m0.012s


-Roger

On 7/14/11 3:56 PM, Alex Ryu wrote:

> Hello
> I have two questions - first, is it possible to read mp3's in Nyquist?
>   I have not found any documentation about it, so I suspect the answer
> is no, but here's hoping.
> Given that it's not - I need to process many mp3's - so many that I do
> not have the space to batch-convert them (using sox) to wav's.  What I
> would like to do is (using python, on Windows)
> loop through the files, converting each one (calling sox from python),
> analyzing it using a Nyquist function, and then delete the wav file.
> I have not figured out how to use Nyquist from the commandline in this
> manner, however.  Also, is there an expensive Lisp VM start-up period,
> or some such that will hurt performance?
> Thank you for any help
>

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
Reply | Threaded
Open this post in threaded view
|

Re: mp3's and commandline nyquist

edgar-rft
Am Fri, 15 Jul 2011 10:35:55 -0400
schrieb Roger Dannenberg <[hidden email]>:

> Nyquist does not currently read mp3s. I would suggest that you use
> Nyquist rather than Python to call a conversion program using
> Nyquist's SYSTEM function. Then you can operate on the file and
> delete it, again using SYSTEM.

@roger: The Nyquist SYSTEM function does not work under Windows.

See nyquist/sys/win/winfun.c:

LVAL xsystem (V) { return NIL; }

@alex: the startup overhead is very small, but it may happen that
you need to start Nyquist under Windows with a custom-made init.lsp
in case Nyquist doesn't find its library and runtime directories.

At the beginning of the Nyquist manual is explained how this works.

- edgar

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
rbd
Reply | Threaded
Open this post in threaded view
|

Re: mp3's and commandline nyquist

rbd
Thanks, edgar. I think maybe SYSTEM was not implemented in the Windows
port because there was no simple way to do it at the time. I see there
is a CreateProcess() for Win2K and above, and it appears that would be a
very simple way to implement SYSTEM, so I'll try to do that before long.
If anyone could use this feature right away, let me know. -Roger

On 7/15/11 2:24 PM, edgar wrote:

> Am Fri, 15 Jul 2011 10:35:55 -0400
> schrieb Roger Dannenberg<[hidden email]>:
>
>> Nyquist does not currently read mp3s. I would suggest that you use
>> Nyquist rather than Python to call a conversion program using
>> Nyquist's SYSTEM function. Then you can operate on the file and
>> delete it, again using SYSTEM.
> @roger: The Nyquist SYSTEM function does not work under Windows.
>
> See nyquist/sys/win/winfun.c:
>
> LVAL xsystem (V) { return NIL; }
>
> @alex: the startup overhead is very small, but it may happen that
> you need to start Nyquist under Windows with a custom-made init.lsp
> in case Nyquist doesn't find its library and runtime directories.
>
> At the beginning of the Nyquist manual is explained how this works.
>
> - edgar
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Audacity-nyquist mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-nyquist

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
Reply | Threaded
Open this post in threaded view
|

Re: mp3's and commandline nyquist

edgar-rft
Am Sat, 16 Jul 2011 11:02:07 -0400
schrieb Roger Dannenberg <[hidden email]>:

> Thanks, edgar. I think maybe SYSTEM was not implemented in the
> Windows port because there was no simple way to do it at the time. I
> see there is a CreateProcess() for Win2K and above, and it appears
> that would be a very simple way to implement SYSTEM, so I'll try to
> do that before long. If anyone could use this feature right away, let
> me know. -Roger

Don't know how much it helps (I'm a horribly bad C programmer and have
no Windows system at hand to test it), but here is the Windows SYSTEM
version from Tom Almy's XLISP PLUS:

/* xsystem - execute a system command */
LVAL xsystem()
{
     int ok;
     if (moreargs()) {
          MEMCPY(buf, getstring(xlgastring()), STRMAX);
          xllastarg();
     }
     else {
          strcpy(buf, "dosprmpt.pif");
     }
     ok = WinExec(buf, SW_SHOWNORMAL);
     return (ok > 32 ? s_true : cvfixnum((FIXTYPE)errno));
}

The full sourcecode can be downloaded from:

http://almy.us/files/xl305src.zip

The SYSTEM function is defined in "win32stu.c".

- edgar

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist
rbd
Reply | Threaded
Open this post in threaded view
|

Re: mp3's and commandline nyquist

rbd
Note: Microsoft says do not use WinExec due to some security problems.
Use CreateProcess instead.

Since WinExec dates back to 16-bit windows, I'm not sure why Nyquist
doesn't support SYSTEM on Windows. I guess I either did not know about
WinExec or didn't bother much with the Windows implementation at the time.

-Roger

On 7/16/11 4:46 PM, edgar wrote:

> Am Sat, 16 Jul 2011 11:02:07 -0400
> schrieb Roger Dannenberg<[hidden email]>:
>
>> Thanks, edgar. I think maybe SYSTEM was not implemented in the
>> Windows port because there was no simple way to do it at the time. I
>> see there is a CreateProcess() for Win2K and above, and it appears
>> that would be a very simple way to implement SYSTEM, so I'll try to
>> do that before long. If anyone could use this feature right away, let
>> me know. -Roger
> Don't know how much it helps (I'm a horribly bad C programmer and have
> no Windows system at hand to test it), but here is the Windows SYSTEM
> version from Tom Almy's XLISP PLUS:
>
> /* xsystem - execute a system command */
> LVAL xsystem()
> {
>       int ok;
>       if (moreargs()) {
>            MEMCPY(buf, getstring(xlgastring()), STRMAX);
>            xllastarg();
>       }
>       else {
>            strcpy(buf, "dosprmpt.pif");
>       }
>       ok = WinExec(buf, SW_SHOWNORMAL);
>       return (ok>  32 ? s_true : cvfixnum((FIXTYPE)errno));
> }
>
> The full sourcecode can be downloaded from:
>
> http://almy.us/files/xl305src.zip
>
> The SYSTEM function is defined in "win32stu.c".
>
> - edgar
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Audacity-nyquist mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-nyquist

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Audacity-nyquist mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-nyquist