[audacity4blind] Re: Manuals and tutorials (Re: nyquist little manual)

  • From: Robert Hänggi <aarjay.robert@xxxxxxxxx>
  • To: audacity4blind@xxxxxxxxxxxxx
  • Date: Mon, 14 Aug 2017 11:54:24 +0200

Hi Damien

Yes, samples lie in fact between -1 and 1, at least this is what
Audacity will show.
However, let's say that we have 5 bits to represent a sample.
This gives 32 possible values a sample can take.

Example for the Nyquist prompt (copy and paste there and press
"Debug", but you must have a track and a time range being defined):

(snd-display
   (mult 16
      (quantize
         ; 50 samples with start at 0 and at a rate of 1 sample per second
         (snd-pwl 0 1 (list 0 -1.0 50  1.0 50))
      ; this is the quantization, i.e. 1/16 which gives 32 values from -1 to 1
      16); quantize
   ); mult
); snd-display


(I've unfolded the parens but normally you wouldn't write Lisp code like this)

That's exactly the way a signed 5-bit sound would be stored on disk.
You will notice that negative values can have an amplitude of max 1.0
whereas positive ones can only go up to 15/16 = 0.9375.

This is because one value is needed for 0.

Since we have 50 samples over the whole range, some will be doubled
due to rounding.

If this sound was imported, all samples would be normalized (divide by
16) and changed to 32-bit float.
This doesn't give a higher quality though...

To change the volume, we would have to multiply by a factor (e.g. 0.5).
Summation means simply two sounds playing at the same time.
This is essentially what "Mix and Render" does if you have multiple
tracks in your project.

Changing the speed is a totally other thing, we can't do it with
sample by sample manipulation.

The example sound above is defined with a sample rate of 1 Hz and it
would play 50 seconds (and you wouldn't hear a bit apart from two
clicks because the signal frequency is 0.02 Hz).

However, if the sound would be returned to Audacity, instead of being
displayed, it would assume that it has the same sample rate as the
track. Therefore, the signal would have a frequency of 882 Hz (at 44.1
kHz).
However, you would still hear nothing because it is only one cycle.

To test:
Copy the innermost code of above at the end of the Nyquist Prompt content:

(snd-pwl 0 1 (list 0 -1.0 50  1.0 50))

-> OK
Turn the volume down and start loop-play (Shift+Space)
That's our signal at 882 Hz and with the maximum amplitude. It's form
is that of a sawtooth.

Cheers
Robert

On 14/08/2017, Damien Sykes-Lindley <damien@xxxxxxxxxxxxxxxxxxxx> wrote:

Hi,
I don't know why, but Nyquist kind of reminds me of the GoldWave expression

evaluator. Not sure if it's because the common upshot was I couldn't
understand either one of them, despite having a programming background.
Lol.
Seriously though, I may be mistaken but they both may have this weird caveat

that you need a working knowledge of both programming, and digital audio
structure. The latter I have no experience with whatsoever, so when people
talk about adding signals to increase volume or multiplying signals to mix
or multiplying/dividing individual samples to manipulate speed...I haven't a

clue how that works in practice. I was always taught that 2*2=4, not
chipmunk. *Grin*.
At least making an attempt to be serious again, I think it's more a theory
behind digital audio processing is more what's needed. Everything I have
seen so far has either been very technical, or doesn't make sense. For
instance, I read somewhere, or at least understood it as, that an audio
sample is a number between -1 and 1. If that were the case, that could
easily be stored in 2 bits, yet audio is generally saved as 16, mixed at 32

bit, which I calculate as providing ranges of -32768 to 32767
and -2147483648 to 2147483647 respectively.
Additionally, I can't seem to find anything regarding a logical explanation

as to what the numbers mean. The simplest explanation used most often, which

I understand to a degree, is that each number represents either an
amplitude, or a speaker position. I've seen both explanations, not sure how

they link together but I guess they do. But nothing explains why doing
something to one number and something else to another can change the output

in a way that makes me think that adding would logically change the volume,

multiplying would logically change the speed, using a square root of the
inverse sign might apply a filter, or raising to the power of 16, dividing
by Pi and adding the number of miles between NASA's latest rocket and the
sun would cause a flange. In case those weird formulas start a form of
interesting debate, let me clarify for those that didn't pick up on it that

those last ones are completely made up garbage...I've no idea what would
cause those effects and I've no idea what using those formulas might do -
knowing my luck probably cause a lot of distortion and unwanted hiss.
But as you can see. I personally think that's the kind of tutorial that is
needed.
I've always wanted to make a convolution plugin since neither GoldWave or
Audacity seems to have one - Wondering if Nyquist is up to such a task once

I can get all this theory learned first.
Cheers.
Damien.
-----Original Message-----
From: Steve the Fiddle
Sent: Monday, August 14, 2017 8:48 AM
To: audacity4blind@xxxxxxxxxxxxx
Subject: [audacity4blind] Re: nyquist little manual

There is this page in the Audacity wiki that covers much of the
Audacity specific Nyquist information:
http://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference

The complete reference for Nyquist functions is in the full Nyquist
manual: http://www.cs.cmu.edu/~rbd/doc/nyquist/indx.html
and detailed information about LISP in Nyquist (with examples) can be
found here:
http://www.audacity-forum.de/download/edgar/nyquist/nyquist-doc/xlisp/xlisp-index.htm

Steve

On 14 August 2017 at 08:39, Paolo Giacomoni <paolgiac@xxxxxxxxxx> wrote:
Hi listers.
I.m looking for a little nyquist manual, specially for audacity
applications.
Thanks you
Paolo
The audacity4blind web site is at
//www.freelists.org/webpage/audacity4blind

Subscribe and unsubscribe information, message archives,
Audacity keyboard commands, and more...

To unsubscribe from audacity4blind, send an email to
audacity4blind-request@xxxxxxxxxxxxx
with subject line
unsubscribe


The audacity4blind web site is at
//www.freelists.org/webpage/audacity4blind

Subscribe and unsubscribe information, message archives,
Audacity keyboard commands, and more...

To unsubscribe from audacity4blind, send an email to
audacity4blind-request@xxxxxxxxxxxxx
with subject line
unsubscribe


The audacity4blind web site is at
//www.freelists.org/webpage/audacity4blind

Subscribe and unsubscribe information, message archives,
Audacity keyboard commands, and more...

To unsubscribe from audacity4blind, send an email to
audacity4blind-request@xxxxxxxxxxxxx
with subject line
unsubscribe



The audacity4blind web site is at
//www.freelists.org/webpage/audacity4blind

Subscribe and unsubscribe information, message archives,
Audacity keyboard commands, and more...

To unsubscribe from audacity4blind, send an email to
audacity4blind-request@xxxxxxxxxxxxx
with subject line
unsubscribe

Other related posts: