- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Created on 12-22-2016 07:26 PM - edited 08-17-2019 07:04 AM
Business Need: Build Tool Notifications + Fun
SonicPi is an open source, multiple platform live music synthesizer tool for building music via coding. It's a pretty neat environment and runs on a Mac, RPi, Windows machine or Linux machine. I found a command-line tool that can trigger SonicPi to play your code. I have wired up a dataflow from NiFi to SonicPi, so I can trigger music on demand. My thought is I will tie this into Jenkins and play different songs depending on what's going on. Such as Test Failures, Build Complete, Build Broken, New Deployment, based on various steps in the SDLC.
Note: The machine this running on will need Ruby, Gem, Apache NiFi, Sonic Pi and a sound card.
Step 1:
To trigger Sonic Pi, you must install Sonic Pi Cli, via gem install sonic-pi-cli.
Step 2:
Run the SonicPI software and have it up and running. As you can see it's a pretty awesome environment, somewhere between a nice IDE and a music tracker.
Step 3: ExecuteStreamCommand This calls the command line tool to trigger Sonic Pi.
NiFi 1.1 Tool
Shell Script
cat /Volumes/Transcend/Apps/nifi-1.1.0.2.1.1.0-2/nifi.rb | /usr/local/bin/sonic_pi
Example SonicPi Code
sample :bass_trance_c sleep 1 sample :bass_thick_c sleep 1 use_synth :prophet play 30, release: 2 sleep 0.25 play 30 sleep 0.25 play 30 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :prophet play 30 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :prophet play 30 sleep 0.25 use_synth :prophet play 30 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 play 30 sleep 0.25 play 30 sleep 0.25 sample :bass_trance_c sleep 1 sample :bass_thick_c sleep 1 use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :dsaw play 30 sleep 0.25 sample :ambi_drone use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :dark_ambience play 30, release: 2 sleep 0.25 use_synth :dark_ambience play 30, release: 2 sleep 0.25 use_synth :dark_ambience play 30, release: 2 sleep 0.25 use_synth :dark_ambience play 30, release: 2 sleep 0.25 use_synth :dark_ambience play 30, release: 2 sleep 0.25 use_synth :dark_ambience play 30, release: 2 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 use_synth :prophet play 30, release: 2 sleep 0.25 sample :bass_trance_c sleep 1 sample :bass_thick_c sleep 1
Reference:
- http://widdersh.in/controlling-sonic-pi-from-vim-or-anywhere-else/
- https://gist.github.com/jwinder/e59be201082cca694df9
- http://sonic-pi.net/
Apache NiFi Template:
Created on 03-03-2017 08:37 PM
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
We could have NiFi rewrite, update and add to the sonicPI code so the music is constantly changing