Youtuber Charis Cat has made a superb 8 step sequencer forging together the use of an Arduino, Max/MSP, some electrical components and an apt 'After Eight' tin. In this video she expertly describes the project in detail - covering each stage, the function it performs and some of the obstacles which came up along the way. In her words:
The After Eight Step is an Arduino and Max powered 8 step sequencer with modern machine learning functionality. Using Markov Chains, it can generate musical accompaniment based on any sequence of notes! This seriously took a lot of work, and I'm really proud of this whole endeavour.
There's more information about the development of the project on her blog and in previous videos on her channel. She cites Look Mum No Computer and Hannah Fry as inspirations for the project. Not only is she clearly multi-talented she explains the process in a very clear and fun way for others to follow.
She's made the Max/MSP patch available on her GitHub page.