| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Lookout analyzer that generates sound from PRs.
The analyzer part uses bblfsh to extract the UAST nodes from old and new code separating the nodes in deleted and added. It gets the type of node, token (name), size (characters) and hash (used for comparing).
Sound generation is compatible with any midi synthesizer which exposes midi device. Currently the data sent is:
Two note sequences are generated per file, one for deleted and another one for added:
Note generation is done using Markov chains. The idea was taken from a hackernoon post and even two of its midi files borrowed to generate the two chains used in the project:
The midi files are not used as is but converted first to JSON so they are easier to read in the project. This web application was used to convert them.
Even if it's not really noticeable delete sequences use song1.midi Markov chain and added use song2.midi. To pick one of the weighted notes we use the FNV hash of the token (name).
Duration is a direct conversion from the node size with a maximum of 250 milliseconds.
Here's the information on how to configure midi synthesizer and the development environment. The project as is cannot be used to send data to github as the sound is played where synthesizer is running.
docker run -d --name bblfshd --privileged -p 9432:9432 -v /var/lib/bblfshd:/var/lib/bblfshd bblfsh/bblfshd:latest
apt-get install libportmidi-dev # or brew install portmidi
Midi synthesizer
There's a sound test with hardcoded data that can be run with:
go run cmd/test/main.go
Start analyzer:
go run cmd/sonic/main.go
Analyze a change (last commit of a repo)
$PATH_TO_LOOKOUT_SDK_BINARY/lookout-sdk review ipv4://localhost:2001
This project is licensed under the MIT License - see the LICENSE.md file for details
| Back | FazBrowse Home | New Git URL |