Company
Date Published
Author
Sam Agnew
Word count
2100
Language
English
Hacker News points
None

Summary

A developer created a Twilio phone number that plays computer-generated NES music using Magenta and Flask. They installed dependencies, including Magenta, Twilio, Flask, RQ, and Redis, and set up a Flask app to handle incoming calls. The app uses Redis as a task queue to generate music asynchronously without slowing down the web requests. When a call is received, the app queues an asynchronous task to create new Nintendo music using Magenta's polyphony recurrent neural network model, converts the MIDI file to audio using Fluidsynth, and updates the Twilio REST API with the URL of the new audio file to play it over the phone. The project uses ngrok to make the Flask app visible from the internet and sets environment variables for Twilio account credentials.