|
From: Ramon Gonzalez-A. <rg...@us...> - 2007-04-10 14:12:16
|
Update of /cvsroot/foo/foo/elkfoo/scm/control/interface-lib In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv25676 Modified Files: sp-patchgen-funs.foo Log Message: several corrections & addenda Index: sp-patchgen-funs.foo =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/control/interface-lib/sp-patchgen-funs.foo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sp-patchgen-funs.foo 27 Feb 2005 20:06:33 -0000 1.2 --- sp-patchgen-funs.foo 10 Apr 2007 14:12:12 -0000 1.3 *************** *** 24,28 **** ((pair? Input) (map (lambda (x) (Atten Amp x)) Input)) (#t (mul~ Amp Input)))) ! (define (SP-Component Vars Input) (let* ((Type (car Vars)) --- 24,28 ---- ((pair? Input) (map (lambda (x) (Atten Amp x)) Input)) (#t (mul~ Amp Input)))) ! (define (SP-Component Vars Input) (let* ((Type (car Vars)) *************** *** 127,130 **** --- 127,131 ---- (cond ; ((string-ci=? Format "Incremental") 'incremental) + ((string-ci=? Format "PCM24") 'pcm24) ((string-ci=? Format "Float") 'float) ((string-ci=? Format "Short") 'short) *************** *** 140,143 **** --- 141,145 ---- ((string-ci=? Type "Wav") 'wav) ((string-ci=? Type "Aiff") 'aiff) + ((string-ci=? Type "Aif") 'aiff) ((string-ci=? Type "Snd") 'snd) ((string-ci=? Type "Paf") 'paf) *************** *** 176,179 **** --- 178,188 ---- (/ (field 'duration) (field 'srate)) (- (field 'factor))))) + (define (setorfflag sym Lst) + (if (eq? sym 'off) + (or (assq 'offset Lst) (assq 'off Lst) (assq 'Offset Lst)) + (if (eq? sym 'ref) + (or (assq 'reference Lst) (assq 'ref Lst) (assq 'Reference Lst)) + (or (assq 'factor Lst) (assq 'amp Lst) (assq 'Factor Lst))))) + (define (SPrun-Modify filnam Lst) (let* ((filnam (make-sndname (putimx filnam))) *************** *** 185,209 **** (context) (context2) (header) ! (factor) (offset) (aux)) (if (symbol? (car Ls2)) (set! Ls2 (list (list-head Ls2 2) (clean (list-tail Ls2 2))))) (define (field name) (cadr (assq name header))) ! (if (or (assq 'offset Ls2) ! (assq 'off Ls2) ! (assq 'Offset Ls2)) (SPrun-Undo filnam (car Lst))) (set! context (with-input-from-file (string-append name "c") read-context)) (set! header (with-input-from-file (string-append name "t") read)) ! (set! aux (assq 'offset Ls2)) ! (if (not aux) (set! aux (assq 'Offset Ls2))) ! (if (not aux) (set! aux (assq 'off Ls2))) ! (if aux (set! offset (+ (/ (field 'offset) (field 'srate)) (cadr aux))) ! (set! offset (/ (field 'offset) (field 'srate)))) ! (set! aux (assq 'factor Ls2)) ! (if (not aux) (set! aux (assq 'Factor Ls2))) ! (if (not aux) (set! aux (assq 'amp Ls2))) ! (if aux (set! factor (cadr aux)) ! (set! factor (field 'factor))) (set! context2 (copy-context context)) (run-task --- 194,225 ---- (context) (context2) (header) ! (factor) (offset) (reference) (aux) ! (offflg #f) (refflg #f) (facflg #f)) (if (symbol? (car Ls2)) (set! Ls2 (list (list-head Ls2 2) (clean (list-tail Ls2 2))))) (define (field name) (cadr (assq name header))) ! ! (set! offflg (setorfflag 'off Ls2)) ! (set! refflg (setorfflag 'ref Ls2)) ! (set! facflg (setorfflag 'fac Ls2)) ! ! (if (or offflg refflg) (SPrun-Undo filnam (car Lst))) ! (set! context (with-input-from-file (string-append name "c") read-context)) (set! header (with-input-from-file (string-append name "t") read)) ! ! (set! offset ! (if offflg ! (+ (/ (field 'offset) (field 'srate)) (cadr offflg)) ! (/ (field 'offset) (field 'srate)))) ! (set! reference ! (if refflg ! (+ (/ (field 'reference) (field 'srate)) (cadr refflg)) ! (/ (field 'reference) (field 'srate)))) ! (set! factor (if facflg (cadr facflg) ! (field 'factor))) ! (set! context2 (copy-context context)) (run-task *************** *** 213,217 **** (field 'srate) (field 'blocksize)) (/ (field 'duration) (field 'srate)) factor))) ! (define (SP-run Data . Args) (let ((Args (clean Args)) --- 229,241 ---- (field 'srate) (field 'blocksize)) (/ (field 'duration) (field 'srate)) factor))) ! ; ! ;; Dummy function which returns same data as given to allow in the ! ;; next-compat.foo file a redefinition in order to take into account ! ;; the confussion between reference and offset in all the older versions ! ; ! (define (help-RefOff-NextCompat Ref Off) (list Ref Off)) ! ; ! ;; ! ; (define (SP-run Data . Args) (let ((Args (clean Args)) *************** *** 222,226 **** (Mode 'punch) (Off 0) (Ref 0) (Sclr 1) (Nfctr 1) (Chns) (SRat) (SRc) - ; (Format 'float) (Type 'aiff) (Format #f) (Type #f) (Offctxt) (Durctxt) (Chnctxt) (Pflg #t) --- 246,249 ---- *************** *** 266,272 **** ((number? Data) (set! Off (assq 'Offset Args)) (set! Sclr (assq 'Factor Args)) ! (if (or Off Sclr) ! (SPrun-Modify Filename (list Data Off Sclr)) (error 'SP-run "Cannot Modify with this data ~a" Data))) (#t (error 'SP-run "Cannot Modify with this data ~a" Data)))) --- 289,296 ---- ((number? Data) (set! Off (assq 'Offset Args)) + (set! Ref (assq 'Reference Args)) (set! Sclr (assq 'Factor Args)) ! (if (or Off Ref Sclr) ! (SPrun-Modify Filename (list Data Off Ref Sclr)) (error 'SP-run "Cannot Modify with this data ~a" Data))) (#t (error 'SP-run "Cannot Modify with this data ~a" Data)))) *************** *** 333,340 **** (if flg (begin (if Pflg (prn " Making Task == <<Ref Off SRc Blk>> ==> " Ref Off SRc Blk)) ! (set! tsk (make-task Ref Off Workfile ctxt Mode SRc Blk)) (if Pflg (prn " Synthesizing = <<Duration Factor>> ==> "Dur Sclr)) --- 357,374 ---- (if flg (begin + ; + ;; We use a dummy function help-RefOff-NextCompat + ;; which is redefined in the next-compat.foo + ;; to solve the old confussion between reference and offset. + ;; This dummy function is defined above and does nothing. + ; + (set! aux (help-RefOff-NextCompat Ref Off)) + (set! Ref (car aux)) + (set! Off (cadr aux)) (if Pflg (prn " Making Task == <<Ref Off SRc Blk>> ==> " Ref Off SRc Blk)) ! (set! tsk (make-task Ref Off Workfile ctxt Mode SRc Blk)) ! ; (if Pflg (prn " Synthesizing = <<Duration Factor>> ==> "Dur Sclr)) |