


Rather, we would have had to send the images we were creating to BTT in base64. Electron is not natively compatible with Better Touch Tool.Īs far as I know, we wouldn’t be able to make a native integration with Better Touch Tool. It would do this 30 times a second! The cpu usage would sit around 100% and sometimes get up to 120%. The process had to be done by having the app read the audio buffer, process the audio with calculations, draw the rectangular bars on a canvas, then take a picture of the canvas, transform the picture from a png to base64, then display the image on the touch bar. Using Javascript and Electron to produce an audio visualizer is pretty inefficient.

There is open source code to force an app’s touch bar configuration open, but it was not compatible with Electron. I was successfully able to put the window in front, only to be disappointed that you still had to click the window to see the visualizer. I tried to fix this by forcing the window to always be in front. There was no way to keep the visualizer open when you clicked off the app’s window. This could be solved by using the system audio, similarly to what we accomplished, but there were other issues. In order to use the audio visualizer, you needed to have the mp3 file downloaded to load into the app. Mainly: The audio was only accessible by playing the song through the app. However, Electron left us with some problems that needed to be sorted out. Electron is a great tool for devs that know Javascript – you can actually build full fledged apps using just Javascript! And I have enough working knowledge of Javascript to understand what was going on inside the app, win-win.

Our prototype was designed and created using Electron.
