Quoted from Chalkey:DickHamill would it be a good idea to send him one of the Arduinos I have to see if it's an Arduino version issue, or do you think it's MPU related?
Can one of you post a youtube video of the quick chimes? Do your games do the melody in the beginning correctly? I'm barking up the Arduino tree based on the results I had with the Uno vs. The Nano 340
I may be way off base here (and please correct me if I'm wrong), but I believe that the chimes that cfh is hearing are operating the same as in my video above. In his opinion they occur too fast because of the spacing of the repetitive hits, not because of an error with his board.
I suspect that the issue is actually a little more subtle than that. In the original code, the M6800 was completely occupied triggering the chimes. If one switch was hit during a chime sequence, it would be remembered and handled after the chimes were finished playing. A second switch hit was lost. For example, when a star is hit, you hear the 1k chime ring fives time in just under a second. If the star is hit again during that period, you hear two series of 5 rings in a row, taking nearly 2 seconds. Because of this limitation (a busy processor could only remember one additional switch hit), fast ball play events were sometimes lost. No big deal in a single-ball game. I'm not sure many people even noticed.
In my implementation, I keep a buffer of switch hits that's deep enough to capture everything. Additionally, I push my solenoid hits to a time-release array so playing a series of chimes doesn't preclude any other event. Because of this, multiple switch hits happening in a short period of time will trigger overlapping callouts.
I can implement a configurable multiplier on the gap between hits as you're requesting, cfh . I will add that to my list of things to do for Stars2020 (version number at boot is already on that list). However, having given it some thought, I don't think that's going to change the behavior in the way you expect. A ball going up and down an inlane is still going to trigger two nearly simultaneous events and the melodies will overlap. A change to that behavior will require somewhat of a re-architecture to make sure that melodies don't collide.
Four approaches occur to me (all have their downsides).
1) when playing a sound effect, the program could store a variable indicating the "finish" time fo the melody and that would be used as an offset for subsequent melodies. A burst of action would be trailed by the system catching up to all the callouts, but they would eventually all be played. Sound is important for pinball--players often use sound queues to make split-second decisions, so this doesn't seem ideal.
2) each new sound effect could clear the buffer of pending sounds and take it's place. This would likely require a "priority" variable so things like tilt-warnings would always take precedence over something like a 10-point switch.
3) new chime hits could only be pushed to the queue if there were no pending sound hits already there. Again, this would benefit from a priority.
4) the solenoid queue could be scanned in the loop to look for chime events that are too closely spaced and "declutter" the queue (only for chimes).