2023-03-04 (Sa) EWC_Box Mode1 random generation

I looked for an Arduino library to generate random numbers by measuring clock jitter. I used this in a previous version of Electronic Wind Chimes but left it out of other builds because it seemed unnecessary to generate such good numbers. Operating the drum machine, some of the starting beats were too similar, so I imported the ENTROPY library to seed my pseudo-random number generator. Before implementing the code, I programmed the sketch to output the generated notes, which were identical each time. Next, I activated the new code, and the values were unique each time.

I created a second mode that worked like the first, except it used ENTROPY's randomly generated numbers. The library cannot create values quickly, so I capped the tempo at 100 notes per minute. I had trouble when I let the upper and lower pitch limits get too close, but I found an error in the core EWC code I have used for years. Once fixed, the music did not stop.
Unseeded PRNG
Seeded by the entropy library

The rest of the posts for this project have been arranged by date.
First time here?

Completed projects from year 1
Completed projects from year 2
Completed projects from year 3
Completed projects from year 4
Completed projects from year 5
Completed projects from year 6
Completed projects from year 7
Completed projects from year 8

Disclaimer for http://24hourengineer.blogspot.com and 24HourEngineer.com

This disclaimer must be intact and whole. This disclaimer must be included if a project is distributed.

All information on this blog, or linked by this blog, is not to be taken as advice or solicitation. Anyone attempting to replicate, in whole or in part, is responsible for the outcome and procedure. Any loss of functionality, money, property, or similar, is the responsibility of those involved in the replication.

All digital communication regarding the email address 24hourengineer@gmail.com becomes the intellectual property of Brian McEvoy. Any information contained within these messages may be distributed or retained at the discretion of Brian McEvoy. Any email sent to this address, or any email account owned by  Brian McEvoy, cannot be used to claim property or assets.

Comments to the blog may be utilized or erased at the discretion of the owner. No one posting may claim property or assets based on their post.

This blog, including pictures and text, is copyright to Brian McEvoy.
2022-03-02

Comments