78rpm EQ Curve Generator

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.
steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Thu Feb 02, 2012 12:22 am

I don't think that it is a big problem as the effect of this part of the filter does tend to have a "shelf-like" response.

I think that the term "low cut" would be technically more accurate, but somewhat misleading for most users because although it is reducing the gain of low frequencies, the "Bass Turnover" part of the filter is causing the absolute gain level to continue rising as the frequency gets lower. Similarly with "rumble filter" one would probably expect a marked attenuation of low frequencies, which does not happen.

I think it's probably as well to leave it as it is.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Thu Feb 02, 2012 3:31 am

Just looking at this bit:

Code: Select all

;; Test the file path (which may be the home directory or a user-defined path).
;; If there is no / (or ) at the end of the path, we need to add one so that the screen display looks right.
;; To do this, we add one anyway, then search for // (or \).
;; Depending on the result, we use the original path or the modified one.

(setq fwdslash (string-search "/" path))
(if (not fwdslash)
(setq pathplus (strcat path "\"))
(setq pathplus (strcat path "/"))
)
(if (not fwdslash)
(setq dblslash (string-search "\\" pathplus))
(setq dblslash (string-search "//" pathplus))
)
(when (not dblslash)
(setq path pathplus)
)
Could we just use this (does it work on Windows)?

Code: Select all

;; Ensure one file separator at end of path
(setq path (strcat 
  (string-right-trim "\/" path)
  (format nil "~a" *file-separator*)))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Thu Feb 02, 2012 5:13 am

Function to test if Windows OS:

Code: Select all

;;; Check if Windows
(defun windowsp ()
  (char= #\ *file-separator*))
Suggestion for additional validation of the file name:

Code: Select all

;;; Check file name. Return T if valid
(defun valid-file-name (fname)
  (if (windowsp)    ;if Windows OS
    (if 
      ;; invalid Windows names and characters
      (or (string-equal (string-trim ". " fname) "") ;not all spaces, all dots or empty
          (string-equal fname "CON")  (string-equal fname "PRN")
          (string-equal fname "AUX")  (string-equal fname "NUL")
          (string-equal fname "COM1") (string-equal fname "COM2")
          (string-equal fname "COM3") (string-equal fname "COM4")
          (string-equal fname "COM5") (string-equal fname "COM6")
          (string-equal fname "COM7") (string-equal fname "COM8")
          (string-equal fname "COM9") (string-equal fname "LPT1")
          (string-equal fname "LPT2") (string-equal fname "LPT3")
          (string-equal fname "LPT4") (string-equal fname "LPT5")
          (string-equal fname "LPT6") (string-equal fname "LPT7")
          (string-equal fname "LPT8") (string-equal fname "LPT9")
          (string-search "/" fname)   (string-search "\" fname)
          (string-search "?" fname)   (string-search "<" fname)
          (string-search ">" fname)   (string-search ":" fname)
          (string-search """ fname)  (string-search "|" fname)
          (string-search "*" fname)   (string-search ">" fname))
      nil T)
    ;; else linux / Mac
    (if (string-search "/" fname) nil t)))
We don't need to test Linux / Mac for nul string as we will be adding a file extension.
".txt" is a valid nix file name.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Irish
Forum Crew
Posts: 550
Joined: Sat Sep 05, 2009 9:25 pm
Operating System: Please select

Re: 78rpm EQ Curve Generator

Post by Irish » Sat Feb 04, 2012 12:05 am

steve wrote:Could we just use this (does it work on Windows)?

Code: Select all

;; Ensure one file separator at end of path
(setq path (strcat 
  (string-right-trim "\/" path)
  (format nil "~a" *file-separator*)))
Yes it does. Much neater, I agree.
I also like the function to check if Windows is the OS.

Just looking at the filename validation code, does that cover all cases? Are there no reserved names on Mac or Linux?
I seem to remember we discussed this some time back, and the consensus was that making the check comprehensive might be too big a job, but if we can cover everything, I'd say include it.

POL
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * Tips * * * * Tutorials * * * * 1.3 Quick Start Guide * * * * Audacity 1.3 Manual * * * * Audacity wiki * * * *

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Sat Feb 04, 2012 3:59 pm

Irish wrote:Just looking at the filename validation code, does that cover all cases?
I think so (unless I've missed any)
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Irish wrote:Are there no reserved names on Mac or Linux?
On Linux the restrictions are: http://forum.audacityteam.org/viewtopic ... 6&p=168473

I thought that, being based on UNIX it was the same on Mac, but apparently there are a couple of other restrictions on Mac.
":" should not be used as it is sometimes used to denote a file separator.
It is advisable to not start a file or folder name with a dot. Files / folders beginning with a dot are hidden on both Linux and Mac, but Mac makes more of a fuss about it.

I'll look into this.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Sat Feb 04, 2012 5:10 pm

We probably don't want the file to be hidden on Mac or Linux, so I've disallowed names starting with a dot.
We probably don't want an empty, or "all spaces" file name either, even though these are legal before a file extension.
For Mac I've disallowed colons (:)

I've only tested this on Linux.
I don't have a Mac to test this on.

Code: Select all

;;; Check if Windows
(defun windowsp ()
  (char= #\ *file-separator*))

;;; Check if Mac
(defun Macp ()
  (string-equal (subseq (get-env "HOME") 0 7) "/Users/"))

;;; Check file name. Return T if valid
(defun valid-file-name (fname)
  (if (windowsp)    ;if Windows OS
    (if 
      ;; invalid Windows names and characters
      (or (string-equal (string-trim ". " fname) "") ;not all spaces, all dots or empty
          (string-equal fname "CON")  (string-equal fname "PRN")
          (string-equal fname "AUX")  (string-equal fname "NUL")
          (string-equal fname "COM1") (string-equal fname "COM2")
          (string-equal fname "COM3") (string-equal fname "COM4")
          (string-equal fname "COM5") (string-equal fname "COM6")
          (string-equal fname "COM7") (string-equal fname "COM8")
          (string-equal fname "COM9") (string-equal fname "LPT1")
          (string-equal fname "LPT2") (string-equal fname "LPT3")
          (string-equal fname "LPT4") (string-equal fname "LPT5")
          (string-equal fname "LPT6") (string-equal fname "LPT7")
          (string-equal fname "LPT8") (string-equal fname "LPT9")
          (string-search "/" fname)   (string-search "\" fname)
          (string-search "?" fname)   (string-search "<" fname)
          (string-search ">" fname)   (string-search ":" fname)
          (string-search """ fname)  (string-search "|" fname)
          (string-search "*" fname)   (string-search ">" fname))
      nil T)
    ;; else linux / Mac
    (if 
      (or (string-search "/" fname)
          (string-equal (string-trim " " fname) "")  ;not all spaces or empty
          (string-equal (subseq fname 0 1) ".")     ;not a hidden file
          (and (macp)(string-search ":" fname)))    ;dot contain ':' on Mac        
      nil t)))
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Sat Feb 04, 2012 5:33 pm

I've made the validator into an Analyze plug-in for easier testing.

OBSOLETE VERSION:
file-name-validator.ny
OBSOLETE
(2.13 KiB) Downloaded 144 times
NEW VERSION:
file-name-validator.ny
Extra ">" check removed
(2.1 KiB) Downloaded 144 times
(Extra ">" check removed)
Last edited by steve on Fri Apr 24, 2015 3:26 pm, edited 2 times in total.
Reason: Updated file-name-validator.ny
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Sat Feb 04, 2012 9:25 pm

Looks like we're good to go with the validator. http://forum.audacityteam.org/viewtopic ... 40&t=63512
Just need to fit it into the "Save File" function now.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: 78rpm EQ Curve Generator

Post by Gale Andrews » Sun Feb 05, 2012 1:49 am

steve wrote:I don't have a Mac to test this on.
Neither do I, but although "/" is the file separator on Mac it is translated internally by the OS so should be accepted. You can save a filename including forward slash in Save or Export in Audacity (not export multiple).

Why do you have (string-search ">" fname) twice in the Windows exceptions?




Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Sun Feb 05, 2012 3:40 am

Gale Andrews wrote:Neither do I, but although "/" is the file separator on Mac it is translated internally by the OS so should be accepted. You can save a filename including forward slash in Save or Export in Audacity (not export multiple).
Thanks Gale, I didn't know that.
Has the current 78rpm EQ Curve Generator been tested with a "/" in the file name?
If it's confirmed that Nyquist can save files that contain a "/" in the name then I'll change the validator function.

Gale Andrews wrote:Why do you have (string-search ">" fname) twice in the Windows exceptions?
That's an error (though a harmless one). I'll fix that now. [Update: fixed]
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply