"Will the next set of Clarabox kits be the Sesquicentennial Plus 1 Year Edition? 🤪" - ContraDude
Let's Design and Build a (mostly) Digital Theremin!
D-Lev Bulk Update
Literally all files have been updated, including the software, manual, presets, librarian, etc. : https://d-lev.com/support.html
Software
- MIDI:bend[0] range +/-50 => +/-200 cents (good suggestion from Mr_Dham).
- Negative MIDI channels give 2ms dead time between data clumps (another good suggestion from Mr_Dham).
- More tinkering with the type system, doubled the signed singles areas.
- New signed full scale squared types: [0xa8:0xab].
- Pcal & Vcal 4x gain-up; type change: 0xa7=>0xab (fs=>fs_sq).
- damp type 0x73 2x range: [0:31]=>[0:63].
- Post knob is now [0:3]: 0=V&P pre; 1=P post; 2=V post; 3=P&V post.
- Pcal & Vcal knobs now [-127:127](fs) (type 0x23 => 0xa7).
- damp knob is now multiplicative: controls fall, filters, resonator.
- Removed damp dloc[0] disable.
- Preview oscillator phase now zeroed @ preset load.
A biggie here is the complete automation of the ACAL auto-muting process for those who use traditional volume sense. ACAL auto-mute is disabled when the volume hand plays < -48dB.
Greensleeves
Trying my hand (literally!) at an oldie but goodie: https://d-lev.com/audio/2021-12-05_greensleeves.mp3
It can't quit Patsy!
The Bourns Identity
And by their works ye shall know them:
The above is a Bourns rotary encoder, part number PEC11L-4120K-S0020, failing spectacularly at its one job. Of the bad ones, some work OK in one direction but don't register some detent regions in the other direction. Some miss many detents in both directions. And this is turning them very slowly, the defective ones are much worse when turned more quickly, sometimes even reversing direction. The contact noise is horrific! There are aggressive countermeasures in the FPGA they are connected to (digital filtering, hysteresis, gray code error rejection, acceleration error rejection, etc.) but almost nothing can withstand this level of input noise and correctly decode detent events.
I was told by the datasheet that I was buying long-wearing encoders, but they are proving to be way worse than the cheap generic encoders from eBay used during development. I've seen the cheap ones sometimes wear out after a ton of use, but I've never seen any malfunction right out of the tray, nor none wear out almost instantly after very little use, like these Bourns encoders have.
What we've got here is a failure to communicate.
Thanks dewster for links at the first page of this thread. Quick access is very handy. Truly, this topics is a kind of encyclopedia.
I'd like to share some observation, this concerns the noise generator (it was discussed [here] and [here]).
Maybe it will be useful for someone.
A brief reminder.
If we generate an unipolar pseudo random sequence and normalize it correctly (to obtain a bipolar signal), we get a spectrum like this (fs=48000 Hz):
The "whitening" filter compensates some high frequencies reduction (the difference is almost inaudible):
dewster's "whitening" algorithm is s[n] = s[n] - s[n-1] / 2, and Dattorro's one is s[n] = s[n] - s[n-1] * 2 (due of right shifted register).
Well.
Experimenting with different polynomials, I have discovered the following thing.
Some polynomials, C0FEBABE for example , produces the flat spectrum curve even without the "whitening" filter. Unfortunately, "C0FEBABE" does not generate a maximum-length sequence (the length is 13FFFFFB versus FFFFFFFF) but it is not so critical because the period is long enough (about 2 hours at fs=48000 Hz). Another polynomial, E0000200, produces the true white noise and has a maximum length:
It should be noted that I'm using the modular ("Galois") form of generator, not the simple ("Fibonacci") form which dewster or Dattorro exploits.
Algorithm looks like this:
It is interesting that these polynomials (C0FEBABE, E0000200, as well as their reciprocals), being used in simple form generator, do not produces the flat spectrum, inexplicably. The question requires researching.
It is also interesting to have a look into waveforms before and after whitening filter.
The PRN generator based on LF shift register sometimes produces characteristic exponential sections (left) which are slightly smoothes by filter (right):
Below is the waveform from generator with "magic" polynomial E0000200 (modular form, left shifted):
The exponential sections are generated too, but the spectrum producrd is originally flat.
(All waveforms are generated by "C" and transfered to CollEdit (Adobe Audition) application for analysis)
Life-hack for some MCUs
Some MCUs have the CRC calculation unit. Basically it is used to verify data transmission or storage integrity.
Putting a constant instead of verifying data, we get a pseudorandom sequence.
No special code is required, only pair of write/read instructions:
 next=CRC->DR; // read the next pseudo random value (unsigned 32 bit)
 CRC->DR=0;  // write a constant to data register
(true for STM32 family of STMicroelectronic)
You must be logged in to post a reply. Please log in or register for a new account.