What is nowadays called ``brainwave music'' started in the late 60s and 70s with the translation of the electrical brain activity detected through the electroencephalogram into sound. Brainwave music developed with the pioneering experimentations by Alvin Lucier, Richard Teitelbaum and David Rosenboom. The aesthetics and technical approach used during their initial performances does not seem to have evolved since, despite the advent of digitalization and the possibility to easily implement statistical and analytical methods of signal processing, and the availability of faster computers with larger memory storage. In this book I expose a personal approach that I adopted for my last work ``Fragmentation'' to overcome some of the intrinsic technical and artistic limitations of present brainwave music performances. Machine Learning and Pattern Recognition methods allow to extract and detect patterns from the brain signal connected to specific mind states of the performer. These techniques allow conscious and rather reliable control of three variables of a system in a non synchronous way. The possibilities of such a system are discussed in the framework of artistic performances.