Limiting polyphony in an electro mechanical instrument
Mar 30 2015 | 4:20 am
This particular problem is quite difficult to explain so I will give you my scenario and hopefully it will make sense.
I am currently building a bespoke electromechanical chromatic instrument that will be controlled by max in conjunction with maxuino and an arduino. Each 'note' features a solenoid (physical electronic actuator) that generates a sound. The external power supply and circuitry that I am using for my instrument will only be sufficient to power 8 solenoids at the same time, so effectively my instrument will be limited to playing chords comprising of a maximum of 8 notes.
The instrument has 24 notes in total so obviously if more than the 8 notes are triggered at the same time then there is a danger of damaging my power supply/circuitry. I intend to enable the instrument to be controlled by a pre-programmed score but also separately with real time midi keyboard input. In order to prevent damage to my circuitry I need to engineer in a way of limiting the maximum number of solenoids that can be triggered from Max at the same time.
Imagine this instrument is setup in an installation and someone who is not aware of the 8 note rule uses the keyboard and plays a 10 note chord. In the solution I am envisioning the first 8 notes (lets say left to right as an example) would trigger the solenoids as normal but then the x number of notes triggered after the 8th would be filtered out and would not be able to trigger any further solenoids. It may also be useful to mention that the solenoids are only powered for 35 ms each time a note is triggered.
I have been tearing my hair out researching and trying out different ways of achieving this but with no success, I did see this https://cycling74.com/forums/limit-kslider-polyphony/ thread on the forums which seemed similar however I don't think the suggestions made there quite address my specific problem.
I would be most grateful for any help you can provide.
Thank you for your time,