List Info

Thread: SAL experiments with Nyquist in Audacity




SAL experiments with Nyquist in Audacity
country flaguser name
Germany
2008-02-13 03:18:31
> Edgar wrote:
> 
> > ... I think SAL could work without changing the
Audacity/Nyquist
> > C code but I just simply still haven't tried to
tell the truth.
> 
> Roger wrote:
>
> I agree -- I think you could include the new sal code
in the Nyquist
> runtime for Audacity. To program in SAL without help
from Audacity,
> you would have to write SAL programs as a big string,
pass the string
> to the compiler, and run the result (but this is how
SAL mode works
> internally anyway).
> 
> Eventually, Audacity should recognize SAL plugins and
compile them for
> you, but maybe we should get more experience with SAL
first --
> I wouldn't advise integrating SAL just yet.
> 
> If anyone wants to try building some experimental SAL
support into
> Audacity, I'll be happy to answer questions that
arise.
> 
> -Roger
> 

Some results of my SAL experiments with Audacity. Here is a
copy of
my modifications in the Audacity Nyquist init.lsp file. A
copy of the
file can also be found in the attachment.

----------------- contents of Audacity Nyquist init.lsp
------------------

; init.lsp -- default Nyquist startup file
(load "nyinit.lsp")

; add your customizations here:
;    e.g. (setf *default-sf-dir* "...")

; (load "test.lsp")

;; --- sal ---

;; WHEN in Audacity still has the problem that only one
function after the
;; predicate is allowed, otherwise an error is raised. So
the first thing
;; I got with testing SAL was ERROR: WHEN - TOO MANY
ARGUMENTS.
;;
(defmacro when (pred &rest args)
  (if pred `(progn ,args)))

;; SAL.LSP and SAL-PARSE.LSP are unmodified copies from
Nyquist 3.01
;;
(load "sal.lsp")
(load "sal-parse.lsp")
(setf *sal-call-stack* nil) ; usually done by: (sal)
;;
;; test code: (sal-compile "play osc(60)" t nil
nil)

;; --- CAUTION: experimental code ---

;; COMMENT: the code is still some sort of wacky,
;; and in no way intended as a permanent or final solution.

;; SAL-COMPILE needs PLAY, otherwise it refuses to work.
PLAY seems
;; to be called only ONCE [and only if needed] by
SAL-COMPILE but:
;; (defun play (expr) (setf s expr)) ; is no good idea
;;
(defmacro play (expr) (setf *nyquist-code* expr))

;; you can write: (sal-string "<sal-code>")
on the Audacity
;; Nyquist prompt and everything else will go
automatically:
;;
(defun sal-string (sal-string)
  (setf *nyquist-code* nil)
  (sal-compile sal-string t nil nil)
  (when *nyquist-code* (eval *nyquist-code*)))

;; --- end of sal ---

-------------------- end of Audacity Nyquist init.lsp
--------------------

Maybe it's possible to add a XLISP read macro to enable
reading
SAL code from an plugin directly but I first must
investigate the
Audacity NYX code because I know that the Lisp reader [for
reading
the Audacity plugin code] is called via C code directly from
NYX to
enable e.g. parsing of the plugin header lines.

But in principle SAL could work without really big changes.

- edgar




-- 
The author of this email does not necessarily endorse the
following advertisements, which are the sole responsibility
of the advertiser:


____________________________________________________________
_________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten
zu sparen!
http://smartsurfer.web.de/?mc=100071&dis
tributionid=000000000066


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Audacity-nyquist mailing list
Audacity-nyquistlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audaci
ty-nyquist

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )