Audacity: Soinu Edizio eta Grabaketa Software Askea

Iragarpen Araudia

Nyquist Plug-inak Sortzea

  1. Sarrera Nyquist edo Lisp Programaketara
  2. Nyquist Programazioa
  3. Nyquist Plug-inak Sortzea

Creating a plug-in for Audacity using Nyquist is as simple as creating a text file with the extension ".ny" with some Nyquist code, adding a few comments to indicate the type of plug-in, and placing the file in Audacity's plug-ins directory. Here's a very simple plug-in as an example:

  ;nyquist plug-in
  ;version 1
  ;type process
  ;name "Fade In"
  ;action "Fading In..."
  (mult (ramp) s)

The first line of a Nyquist plug-in must be exactly as in the example above, and the second line must indicate a version number. Version 2 and 3 plug-ins support more widgets, but version 3 plug-ins are not supported in Audacity 1.3.3 or earlier. The next line is the type of plug-in, which is discussed below. Then comes the name of the plug-in, which is what is displayed in the menu bar, and then the "action", which is what Audacity displays while it is busy processing the plug-in. There are other optional lines that may follow. Any line that does not begin with a semicolon (;) is assumed to contain Nyquist code and will be executed.

Audacity-k hiru plug-in mota sostengatzen ditu Nyquist bidez idatzi daitezkenak:

  ;type generate
  ;type process
  ;type analyze

These correspond to the three menus that can contain plug-ins: Generate, Effect, and Analyze. Generate plug-ins are expected to generate new audio from scratch, Effect plug-ins ("process") modify existing audio in-place, and Analyze plug-ins process audio but do not modify it (though they are allowed to add labels).

For Effect and Analyze plug-ins, Audacity sets up the Nyquist environment so that the audio the user has selected is in the variable s. All of the expressions in the plug-in file are executed in order, and the return value of the last expression is substituted for the selection in Audacity. If the last expression does not return audio, Audacity returns an error.

Parametro elkarrizketak

Audacity-k sostengu mugatua du plug-inentzat elkarrizketa bat erakutsiz erabiltzailearengandik parametroak lortzeko. Hau elkarrizketa bat irekitzen duen plug-in adibide bat da:

  ;nyquist plug-in
  ;version 1
  ;type process
  ;name "Delay..."
  ;action "Performing Delay Effect..."
  ;info "Demo effect for Nyquist by Roger Dannenberg.\nThis effect 
     creates a fixed number of echos."  ; (should be all on one line)
  ;control decay "Decay amount" int "dB" 6 0 24
  ;control delay "Delay time" real "seconds" 0.5 0.0 5.0
  ;control count "Number of echos" int "times" 5 1 30

  (defun delays (s decay delay count)
    (if (= count 0) (cue s)
	   (sim (cue s)
        (loud decay (at delay (delays s decay delay (- count 1)))))))
  (stretch-abs 1 (delays s (- 0 decay) delay count))

If Audacity finds at least one "control" line, it will open a dialog to prompt the user for certain parameters to the plug-in. Each parameter consists of a text box and a slider, and after the user has entered each one, the final value will be stored in a Nyquist variable with a name that you specify on the "control" line. Here's what the dialog for the Delay effect shown above looks like in Audacity for Linux:

Nyquist plugin ikusleiho-argazkia

Note that the "info" line is displayed at the top of the dialog, and that the "\n" becomes a newline. The parameters to the "control" line affect the appearance and limitations of the parameter. Each "control" line must consist of exactly the following 8 elements, in order:

  1. "kontrol" hitza
  2. Kontrolaren izena- hau erabiltzaileak elkarrizketa manipulatzen duenean ezarriko den Nyquisten aldaeraren izena da.
  3. Kontrolaren ezkerreko etiketa
  4. Balio mota: bai int (osoa) edo real.
  5. Balioaren eskuineko etiketa (arrunt "Hz" edo "dB" bezalako batekoak).
  6. Berezko/hasierako parametro balioa
  7. Parametroaren gutxienezko balioa
  8. Parametroaren gehienezko balioa

Etiketen itzulpena

Instead of returning audio, a Nyquist plug-in can instead return a list of labels. A list of labels is simply a list of time/label pairs, for example:

  ((0.0 "start") (30.0 "middle") (60.0 "end"))

When a plug-in returns a list of exactly this form, Audacity will create a new label track and add the labels at those positions. This style of plug-in is usually of type "analyze".

New! Beginning with Audacity version 1.3.1, you can now optionally return both a start and an end time, like this:

  ((0.0 25.0 "start") (30.0 45.0 "middle") (60.0 75.0 "end"))

Note that labels are allowed to overlap in Audacity 1.3; the end time of one can be after the start time of the next.

Bide estereo prozesapena

Nyquist represents stereo tracks as an array of sounds (not a list). Many Nyquist functions automatically work with these arrays, but not all, so sometimes you may find it necessary to split up a stereo array, or reassemble one. Here are some useful functions:

(arrayp s)returns true if s is an array
(aref s 0)the first element in array s - the left channel
(aref s 1)the second element in array s - the right channel
(setf s (make-array 2))makes s into a new array of length 2
(setf (aref s 0) left)makes left the first element of array s
(setf (aref s 1) right)makes right the second element of array s

Erosotasun bezala, zure Nyquist plug-inaren sarrera estereoa bada, baina soinu bakar bat (monoa) nahi baduzu irteeran, Audacity-k berezgaitasunez kopiatzen du bietara ezkerreko eta eskuineko bideetara.

Nora joan hemendik

Audacity comes with some sample plug-ins that you can examine or modify as a starting point. The best way to learn Nyquist is to try it. If you're having trouble debugging, consider downloading the standalone version of Nyquist (see the link in Part 1).

If you're having trouble getting Nyquist to work at all, please contact us.

If you are working on Nyquist plug-in effects and would like to share them with others, or if you would like to discuss how to achieve certain effects in Nyquist, please post on the Nyquist board of the Audacity Forum or join the audacity-nyquist mailing list.

Ez ahaztu ikustea Nyquist 2.37 Xehetasun Eskuliburua osoa Lisp eta Nyquist xehetasun gehiagorako.