Kalvgv's Plight Mac OS

broken image


Previous Section | Next Section | Table of Contents | Index | Title Page

Introduction and Overview

Nyquist is a language for sound synthesis and music composition. Unlike scorelanguages that tend to deal only with events, or signal processing languagesthat tend to deal only with signals and synthesis, Nyquist handles both in asingle integrated system. Nyquist is also flexible and easy to use because itis based on an interactive Lisp interpreter.

With Nyquist, you can design instruments by combining functions (much as youwould using the orchestra languages of Music V, cmusic, or Csound). You cancall upon these instruments and generate a sound just by typing a simpleexpression. You can combine simple expressions into complex ones to createa whole composition.

Kalvgv's Plight Mac Os X

The Mac OS X Mavericks 10.9 release proved to be the most significant of all the releases made by apple in the Mac operating system X series. Mavericks proved to have a lot of in-built features that made it stand apart from all other operating systems released under the tag of the Mac OS X line up. 4- I can't seem to get the GUID partition scheme to work, so I may install OS X on it. That is the only way you can install OS X on the drive. It must use the GUID Partition Table for it to be bootable on a Mac. I don't believe there is a way to change the partition table without erasing the entire disk. Jan 19, 2017 Mac Reqs MinimumSupported Will It Run? Mac OS X: 10.7: Download the MacGameStore App to compare your Mac's information in real-time. Get the Mac App: 64bit Support: No: CPU Type: Intel Mac Only: CPU Cores: Any: CPU Speed: 1 GHz: System RAM: 1 GB: Drive Space: 1.1 GB: Video RAM: 256 MB: Video Card: Any.

Nyquist runs under Linux, Apple Mac OS X, Microsoft Windows NT,2000, XP, and Vista, and it produces sound files or directly generates audio. Recent versions have also run on AIX, NeXT, SGI, DEC pmax, and Sun Sparcmachines. (Makefiles for many of these are included, but out-of-date).Let me know if you have problems with any of these machines.

The core language of Nyquist is Lisp. Nyquist extends Lisp forsound synthesis and processing.Starting with Version 3, Nyquist supports a variant ofSAL syntax. SAL is a language distinct from Lisp, but it can betranslated to Lisp and SAL and Lisp programs can be combined.SAL was introduced in RickTaube's Common Music system. Since there are some differences betweenNyquist and Common Music, one should generally call thisimplementation 'Nyquist SAL;' however, in this manual, I will justcall it 'SAL.' SAL offers most of the capabilities of Lisp, but ituses an Algol-like syntax that may be more familiar to programmerswith experience in Java, C, Basic, etc. An introduction to SAL is inMary Simoni and Roger B. Dannenberg, Algorithmic Composition: AGuide to Composing Music with Nyquist(Simoni and Dannenberg 2013).To learn about Lisp, anexcellent text by Touretzky is recommended (Touretzky 1984). AppendixAppendix 3: XLISP: An Object-oriented Lisp is the reference manual for XLISP, of which Nyquist isa superset.

Installation

Nyquist is a C++ program intended to run under various operating systems including Unix, Mac OS X, and Windows. Nyquist is based on Lisp, but it includes its own Lisp interpreter (a modified version of XLISP), so you do not need to install some other Lisp to run Nyquist. Other Lisp systems are not compatible with Nyquist.

Most Nyquist users run Nyquist under the Nyquist IDE, which is written in Java and depends on the Java runtime system. Most systems already have Java, but ifyou do not, you will need to install it. When you install the Nyquist IDE,you will automatically get Nyquist and a set of runtime libraries.

There are generally two ways to install Nyquist:

  • Get a pre-compiled version of the Nyquist IDE for Windows or Mac OS X. The Windows version comes packaged in an installer that installs and configures the Nyquist IDE. The Mac OS X version unpacks to a complete OS X application.
  • Compile from sources. There is one set of sources for Mac, Windows, and Unix.Instructions for building applications from the sources are provided inthe files sys/win/README.txt, sys/mac/README.txt, and sys/unix/README.txt.

You can download source code and precompiled versions from the Nyquist projecton SourceForge (http://sourceforge.net/projects/nyquist). The latest source code can be obtained via Subversion (svn) using the following:

or by checking out nyquist using a graphical interface svn client such as TortoiseSVN for Windows.

Troubleshooting

All versions of Nyquist includes a Readme.txt file with additionalinformation. Additional information and instructions on installationcan be found in:

  • sys/win/README.txt
  • sys/mac/README.txt
  • sys/unix/README.txt

Using NyquistIDE

The program named NyquistIDE is an 'integrated developmentenvironment' for Nyquist. When you run NyquistIDE, it starts theNyquist program and displays all Nyquist output in awindow. NyquistIDE helps you by providing a Lisp and SAL editor, hintsfor command completion and function parameters, some graphicalinterfaces for editing envelopes and graphical equalizers, and a panelof buttons for common operations. A more complete description ofNyquistIDE is in Chapter The NyquistIDE Program.

For now, all you really need to know is that you can enter Nyquistcommands by typing into the upper left window. When you type return,the expression you typed is sent to Nyquist, and the results appear inthe window below. You can edit files by clicking on the New File orOpen File buttons. After editing some text, you can load the text intoNyquist by clicking the Load button. NyquistIDE always saves the filefirst; then it tells Nyquist to load the file. You will be promptedfor a file name the first time you load a new file.

Using SAL

SAL mode means that Nyquist reads and evaluates SAL commands ratherthan Lisp. The SAL mode prompt is 'SAL> ' while the Lisp modeprompt is '> '. When Nyquist starts it normally enters SALmode automatically, but certain errors may exit SAL mode. You canreenter SAL mode by typing the Lisp expression (sal).

Kalvgv's Plight Mac Os Update

In SAL mode, you type commands in the SAL programminglanguage. Nyquist reads the commands, compiles them into Lisp, andevaluates the commands. Commands can be entered manually by typinginto the upper left text box in NyquistIDE.

Command Line

When run from the command line, Nyquist (usually the command is ny) looks for some options and some files to load. There are several options.

The -Rpathsoption gives Nyquist a list of paths (separated by semicolons) todirectories where Nyquist is allowed to read files. Files in anysubdirectories of the listed directories can also be read, along withthe directories themselves. This option can be used to restrict accessto files.

The -Wpaths option gives Nyquist a list of paths (separated bysemicolons) to directories where Nyquist is allowed to write files(including sound files). If -W is used, Nyquist will not openaudio output to play sounds and will not allow access to Open SoundControl. This option can be used to protect files from accidentallymalicious code. (If you are truly worried about Nyquist code, youshould run Nyquist in a virtual machine or other isolated machine. Itis unlikely that Nyquist is secure from all attacks.)

The-Lrun-time-limit option gives Nyquist a run time limit. If thelimit is exceeded, Nyquist prints an error message and exits. The timeis based on Lisp expression evaluations rather than CPU seconds or wall time or even execution time involved in printing or signal processing.One unitof run time is on the order of 10ms of CPU time (for a medium speedcomputer in 2019), but depending on what you are computing, a unitof run time can vary from 60ms to 1.5ms.You can use the GET-RUN-TIME function toread the internal run-time counter to see how much computation youhave done in the same units.The-Mmemory-limit option gives Nyquist a memory limit. If thelimit (in megabytes) is exceeded, Nyquist prints an error message andexits. The limit includes all XLISP data (cons cells, strings, etc.)plus sample blocks and tables allocated for signal processing.

The -Ttranscript-file-name option copies console output to a transcriptfile.

The -V option sets verbose mode. If set, any files specified onthe command line to be loaded are loaded with the verbose option.

Additionally, the command line can name files to be loaded. Nyquist begins by loading init.lsp, which by default is in the nyquist/runtime directory.This file loads all the standard Nyquist functions. After that, Nyquist willload any other files named on the command line.

Finally, Nyquist expects to find search paths in the XLISPPATH environmentvariable (or for Windows, see installation instructions; the path is savedin the Windows Registry). Normally, you must set XLISPPATH for Nyquist tofind init.lsp and the definitions of most Nyquist functions.Be sure you have system.lsp in nyquist/runtime. Part of the installationprocess copies the appropriate system.lsp from nyquist/sys/* to nyquist/runtime where it can be found and loaded by init.lsp.

Helpful Hints

Under Win95 and Win98, the console sometimes locks up. Activatinganother window and then reactivating the Nyquist window should unlockthe output. (We suggest you use NyquistIDE, the interactivedevelopment environment rather than a console window.)

You can cut and paste text into Nyquist, but for serious work, youwill want to use the Lisp load command. To save even more time,write a function to load your working file, e.g. (defun l ()(load 'myfile.lsp')). Then you can type (l) to (re)load yourfile.

Using SAL, you can type

and then

to (re)load the file.

The Emacs editor is free GNU software and will help you balanceparentheses if you use Lisp mode. In fact, you can run nyquist(without the IDE) as a subprocess to Emacs. A helful discussion isat //http://www.audacity-forum.de/download/edgar/nyquist/nyquist-doc/examples/emacs/main.html. Ifyou use Emacs, there is also a SAL mode (the file issal-mode.el) included with the Common Music distribution, whichyou can find on the Web at sourceforge.net.

The NyquistIDE also runs Nyquist as a subprocess and has built-in Lispand SAL editors. If your editor does not help you balance parentheses,you may find yourself counting parens and searching for unbalancedexpressions. If you are confused or desperate and using Lisp syntax,try the :print t option of the load function. By lookingat the expressions printed, you should be able to tell where the lastunbalanced expression starts. Alternatively, type(file-sexprs) and type the lisp file name at the prompt. Thisfunction will read and print expressions from the file, reporting anerror when an extra paren or end-of-file is reached unexpectedly.

Using Lisp

Lisp mode means that Nyquist reads and evaluates Nyquist expressions in Lisp syntax. Since Nyquist is build on a Lisp interpreter, this is the'native' or machine language of Nyquist, and certain errors and functions may break out of the SAL interpreter, leaving you with a prompt for a Lispexpression. Alternatively, you can exit SAL simply by typing exit toget a Lisp prompt (> ). Commands can be entered manually by typing into the upper left text box in NyquistIDE.

Mac Os Catalina

Examples

We will begin with some simple Nyquist programs. Throughout the manual,we will assume SAL mode and give examples in SAL, but it should beemphasized that all of these examples can be performed using Lispsyntax. See Section Interoperability of SAL and XLISP on the relationship betweenSAL and Lisp.

Kalvgv's Plight Mac Os Download

Detailed explanations of the functions used in these examples will bepresented in later chapters, so at this point, you should just read theseexamples to get a sense of how Nyquist is used and what it can do. Thedetails will come later. Most of these examples can be found in thefile nyquist/demos/examples.sal. Corresponding Lisp syntaxexamples are in the file nyquist/demos/examples.lsp.

Our first example makes and plays a sound:

This example is about the simplest way to create a sound with Nyquist.The osc function generates a sound using a table-lookuposcillator. There are a number of optional parameters, but thedefault is to compute a sinusoid with an amplitude of 1.0. Theparameter 60 designates a pitch of middle C. (Pitchspecification will be described in greater detail later.) The resultof the osc function is a sound. To hear a sound, you must usethe play command, which plays the file through the machine'sD/A converters. It also writes a soundfile in case the computationcannot keep up with real time. You can then (re)play the file bytyping:

This (r) function is a general way to 'replay' the last thing written by play.

Note: when Nyquist plays a sound, it scales the signal by 215-1 and (by default)converts to a 16-bit integer format. A signal like (osc 60),which ranges from +1 to -1, will play as a full-scale 16-bit audiosignal.

Waveforms

Media company simulator mac os. Our next example will be presented in several steps. The goal is to create asound using awavetable consisting of several harmonics as opposed to a simple sinusoid.In order to build a table, we will use a function that computes a single harmonic and add harmonics to form a wavetable. An oscillatorwill be used to compute the harmonics.

The functionmkwave calls uponbuild-harmonic to generate a total of fourharmonics with amplitudes 0.5, 0.25, 0.125, and 0.0625. These are scaled and added (using +) tocreate a waveform which is bound temporarily to *table*.

Mac os catalina

A complete Nyquist waveform is a list consisting of a sound, a pitch, and T, indicating a periodic waveform. The pitch gives thenominal pitch of the sound. (This is implicit in a single cycle wavetable, but a sampled sound may have many periods of the fundamental.)Pitch is expressed in half-steps, where middle C is 60 steps, as in MIDIpitch numbers.The list of sound, pitch, and T is formed in the last line ofmkwave: since build-harmonic computes signals with a durationof one second, the fundamental is 1 Hz, and the hz-to-step functionconverts to pitch (in units of steps) as required.

Now that we have defined a function, the last step of this example isto build the wave. The following code calls mkwave the firsttime the code is executed (loaded from a file). The second time, thevariable *mkwave* will be true, so mkwave will not beinvoked:

Wavetables

When Nyquist starts, several waveforms are created and stored inglobal variables for convenience. They are: *sine-table*,*saw-table*, and *tri-table*, implementing sinusoid,sawtooth, and triangle waves, respectively. The variable*table* is initialized to *sine-table*, and it is*table* that forms the default wave table for many Nyquistoscillator behaviors. If you want a proper, band-limited waveform, youshould construct it yourself, but if you do not understand thissentence and/or you do not mind a bit of aliasing, give*saw-table* and *tri-table* a try.

Note that in Lisp and SAL, global variables often start and end with asterisks (*). These are not special syntax, they just happen to be legal characters for names, and their use is purely a convention.

Sequences

Finally, we define my-note to use the waveform,and play several notes in a simple score. Note that the functionmy-note has only one command (a return command), so itis not necessary to use begin and end. These are onlynecessary when the function body consists of a sequence of statements:

Kalvgv's Plight Mac Os Catalina

Here, my-note is defined to take pitch and duration as parameters;it calls osc to do the work of generating a waveform, using*table* as a wave table.

The seq function is used to invoke a sequence of behaviors. Eachnote is started at the time the previous note finishes. The parameters tomy-note are predefined in Nyquist: c4 is middle C, i (foreIghth note) is 0.5, and q (for Quarter note) is 1.0. See SectionPredefined Constants for a complete description. The result is the sum ofall the computed sounds.

Sequences can also be constructed using the at transformation to specify time offsets. See demos/sequence_example.htmdemos, sequence for more examples and explanation.

Envelopes

The next example will illustrate the use of envelopes. In Nyquist,envelopes are just ordinary sounds (although they normally have a low samplerate). An envelope is applied to another sound bymultiplication using the mult function. The code showsthe definition of env-note, defined in terms of thenote function in the previous example. In env-note, a 4-phaseenvelope is generated using the env function, which isillustrated in Figure 1.


Figure 1: An envelope generated by the env function.

While this example shows a smooth envelope multiplied by an audio signal,you can also multiply audio signals to achievewhat is often called ring modulation.

In the next example, The stretch operator (~) is used to modify durations:

In addition to stretch, there are a number of transformations supported by Nyquist,and transformations of abstract behaviors is perhaps the fundamentalidea behind Nyquist. Chapter Behavioral Abstraction is devoted toexplaining this concept, and further elaboration can be found elsewhere (Dannenberg and Frayley 1989).

Piece-wise Linear Functions

It is often convenient to construct signals in Nyquist using a list of(time, value) breakpoints which are linearly interpolated to form a smoothsignal. Envelopes created by env are a special case of the moregeneral piece-wise linear functions created by pwl. Since pwlis used in some examples later on, we will take a look at pwlnow. The pwl function takes a list of parameters which denote (time,value) pairs. There is an implicit initial (time, value) pair of (0, 0),and an implicit final value of 0. There should always be an odd number ofparameters, since the final value (but not the final time) is implicit. Here are some examples:

Predefined Constants

For convenience and readability, Nyquist pre-defines some constants, mostlybased on the notation of the Adagio score language, as follows:

  • DynamicsNote: these dynamics values are subject to change.
    lppp = -12.0 (dB)
    lpp = -9.0
    lp = -6.0
    lmp = -3.0
    lmf = 3.0
    lf = 6.0
    lff = 9.0
    lfff = 12.0
    dB0 = 1.00
    dB1 = 1.122
    dB10 = 3.1623
  • Durations
    s = Sixteenth = 0.25
    i = eIghth = 0.5
    q = Quarter = 1.0
    h = Half = 2.0
    w = Whole = 4.0
    sd, id, qd, hd, wd = dotted durations.
    st, it, qt, ht, wt = triplet durations.
  • PitchesPitches are based on an A4 of 440Hz. To achieve a different tuning,set *A4-Hertz* to the desired frequency for A4, and call(set-pitch-names). This will recompute the names listed below with adifferent tuning. In all cases, the pitch value 69.0 corresponds exactly to440Hz, but fractional values are allowed, so for example, if you set*A4-Hertz* to 444 (Hz), then the symbol A4 will be bound to69.1567, and C4 (middle C), which is normally 60.0, will be 60.1567.
    c0 = 12.0
    cs0, df0 = 13.0
    d0 = 14.0
    ds0, ef0 = 15.0
    e0 = 16.0
    f0 = 17.0
    fs0, gf0 = 18.0
    g0 = 19.0
    gs0, af0 = 20.0
    a0 = 21.0
    as0, bf0 = 22.0
    b0 = 23.0
    c1 .. b1 = 24.0 .. 35.0
    c2 .. b2 = 36.0 .. 47.0
    c3 .. b3 = 48.0 .. 59.0
    c4 .. b4 = 60.0 .. 71.0
    c5 .. b5 = 72.0 .. 83.0
    c6 .. b6 = 84.0 .. 95.0
    c7 .. b7 = 96.0 .. 107.0
    c8 .. b8 = 108.0 .. 119.0
  • Miscellaneous
    ny:all = 'all the samples' (i.e. a big number) = 1000000000

More Examples

More examples can be found in the directory demos, part of the standardNyquist release. In the Apple OS X version of Nyquist, thedemos and doc directories are inside the NyquistIDEapplication bundle. To make it easier to access these hidden files,the NyquistIDE installs links to these directories the first time yourun it. The links will be in the same directory as the NyquistIDE itself.

The file demos/index.htm is an index to all the demodescriptions. In this directory, you will find the following and more:

  • Code to create atonal melodies(demos/src/atonal-melodies.sal).
  • How to make arpeggios (demos/arpeggiator.htm anddemos/src/arp.sal)
  • Gong sounds by additive synthesis(demos/pmorales/b1.lsp anddemos/mateos/gong.lsp)
  • Risset's spectral analysis of a chord(demos/pmorales/b2.lsp)
  • Bell sounds (demos/pmorales/b3.lsp,demos/pmorales/e2.lsp, demos/pmorales/partial.lsp, anddemos/mateos/bell.lsp)
  • Drum sounds by Risset (demos/pmorales/b8.lsp
  • Shepard tones (demos/src/shepard.lsp anddemos/pmorales/b9.lsp)
  • Random signals (demos/pmorales/c1.lsp)
  • Buzz with formant filters (demos/pmorales/buzz.lsp)
  • Computing samples directly in Lisp (using Karplus-Strong and physicalmodelling as examples) (demos/pmorales/d1.lsp)
  • FM Synthesis examples, including FM voices(demos/src/fm-voices-chowning.sal) designed by JohnChowning, bell, wood drum, brass sounds, tuba sound (demos/mateos/tuba.lsp) andclarinet sounds(demos/pmorales/e2.lsp)
  • Rhythmic patterns(demos/rhythm_tutorial.htm)
  • Drum Samples and Drum Machine(demos/plight/drum.lsp). (See Section Drum Machine).
Previous Section | Next Section | Table of Contents | Index | Title Page



broken image