I've been playing with the "Nyquist Prompt", but it seems generating a bit-crusher effect is more difficult than I thought. (I'm using Audacity 2.0.5 in LinuxMint)
I've been looking at two approaches, but both give me dead ends. Note that I want the effect to be "tunable" i.e: you can choose how many bits you want, not just 8-bit (which I know can be generated via exporting).
Approach #1 - Bitwise AND to obtain the required most significant bits using the logand function
CODE: (logand s "number")
=> "number" has required number of most significant bits set, eg: #xFF000000 for 8-bit
=>returns "Nyquist did not return audio"
Approach #2 - Divide by a power of two, then multiply by a power of two
CODE: (mult (mult s (power 2 -24)) (power 2 24))
=> should bit crush down to 8-bit (32-24=8)
=> unfortunately just returns the same audio that was input. Attempts to round down before remultiplying (using truncate) have not worked so far either.
Bit-crushing is just some simple math, yet I'm stuck on how to make it work in Nyquist (and surprised a Nyquist plugin doesnt exist - at least as far as my searches have gone)
Help please? (Cheers!)
PS: Very new at this, so am probably making a really simple error. Please forgive.
Bit crusher
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
-
Robert J. H.
- Posts: 3633
- Joined: Thu May 31, 2012 8:33 am
- Operating System: Windows 10
Re: Bit crusher
Why not simply quantize?
gives 8-bit.
Logand, truncate and so on won't work with sounds--the former only with integer in fact.
Code: Select all
(quantize s 256)Logand, truncate and so on won't work with sounds--the former only with integer in fact.
Re: Bit crusher
Description of Quantize in the manual: http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index541
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)