TFG: Design and Implementation of a Music Assistant on a Microcontroller-Based Platform

Main View

Throughout the years, music has been and continues to be one of the main forms of artistic and cultural expression of people. It could be defined as the art of combining rhythm, melody and harmony in a pleasant and enjoyable way to the listener. Rhythm is the element that relates music to time. The interpreter and/or composer can manage it at will, to transmit different emotions depending on the chosen pulse rate, the duration of the notes used, and the accents that some notes receive along the measure. To ensure a good melody and harmony we need to use a tuner. Taking into account the notes that belong to the key, the tuner ensures that this set of sounds are appropriate to form the melody. That is to say, that the sound produced when playing a key or a string corresponds to the one established in that position. The same thing happens with harmony. Harmony is in charge of combining two musical notes and making them sound in consonance, as in a chord.

The aim of a performer and/or composer is to convey emotions and feelings. To do this he employs different rhythmic techniques, chord progressions and scales. To convey a happy feeling he will use major chords and to convey a sad one he will use minor chords. Augmented chords are used to give suspense and diminished chords to predict an outcome.

Until the invention of the tape recorder and the player, people’s musical reach was very limited. They could only listen to music produced on the spot, and its quality depended on the skill of the closest performers. The most skilled musicians left written musical scores to preserve their music so that subsequent musicians could perform it. With the invention of the tape recorder and the player, a revolution of such magnitude took place that, little by little, it was possible to bring music to any place in the world to be reproduced at any time.

The facts described above and my interest as a musician, have led me to to develop this project. The intention was to provide a device that brings together the 3 main functions that a musician needs to practice and improve their skills. The functions I wanted to include in the device are: a metronome, a tuner and a recorder. To bring it to fruition, I took a previous project from 2018 that included those functions and used a Raspberry Pi.

Raspberry Pi + PiTFT touchscreen

A Raspberry Pi is a microcontroller-based platform capable of providing the basic functions of a computer, but at a much smaller price and size. For this project, the Raspberry Pi can be controlled, besides a mouse and a screen, in a tactile way with a PiTFT screen connected by the GPIO pins. Also, the choosen Raspberry Pi 4 Model B incorporates inputs to connect a microphone (USB) and headphones to carry out all the required functionalities. The programming language used has been Python, as it contains an endless number of libraries to carry out the project. The different menu screens and buttons were created with the PyGame library.

The initial view corresponds to the following image:

Initially, the metronome displayed an inverted pendulum and a flashing circle. Later on, I incorporated functions to mark the different types of time signature and the different ways of dividing a beat.

Before I made any changes, the tuner had two main functions, the first one was to emit the note with the desired frequency. The second one incorporated a listening mode in which the program detected the note emitted, as well as its accidentals and frequency.

I added a third functionality to it that serves as an ear training tool for the musician, as well as, facilitating the composition of chords. It shows the notes that make up the four types of triads.

Major Triad: 1, 3, 5

Minor Triad: 1, minor3, (perfect) 5

Diminished Triad: 1, minor3, diminished5

Augmented Triad: 1, 3, augmented5

The recorder incorporates a microphone to record the musician’s performances and displays a screen with a list of recordings and/or imported songs. It contains buttons for playback and scrolling between screens.

The results have shown that the Music Assistant has great potential. It is an open source device in constant development, which differentiates it from other devices at the moment.With it, musicians can have fun practicing at a reduced price. If you are interested in continuing the project you can download the code from this site .

TFG: Desarrollo de servicios interactivos para un tablón expositor con iluminación LED.

El tablón expositor del laboratorio Electronic Systems Lab B105, ubicado en el pasillo de la primera planta del edificio B en la ETSIT, cuenta con un sistema de iluminación LED controlado por una Raspberry Pi.

Los LEDs del tablón están controlados por un modelo de drivers de Texas Instruments: TLC5940. Dichos drivers, mediante las señales de entrada pertinente, envían por sus salidas las respectivas señales que hayamos configurado. Para ello contamos con la librería TLC5940 de código abierto, que permite enviar estas señales en un nivel de abstracción más alto, es decir, pudiendo elegir directamente los colores y segmentos de LED y encargándose de enviar las señales pertinentes. Dicha librería ha sido modificada con el objetivo de poder realizar estas acciones de forma aún más sencilla.

El objetivo de este trabajo de Fin de Grado es desarrollar una serie de funcionalidades interactivas que, mediante el uso de una interfaz en un teléfono Android, permita la interacción del usuario con el tablón, pudiendo configurar los diferentes efectos de luces que queremos personalizar.

Se han realizado las siguientes fases del proyecto:

  • Diseño e implementación del código a ejecutar en un sistema Raspberry Pi en C++, con el objeto de crear diferentes efectos de los diodos LED y funcionalidades para el tablón:
    • Codificación de los diversos efectos de luces.
    • Diseño del código e interrupciones para la conexión Bluetooth,utilizando las librerías disponibles para Raspberry Pi.
  • Diseño e implementación de la aplicación para teléfonos Android:
    • Diseño e implementación de la interfaz de usuario, incluyendo la posibilidad de personalización para los diferentes efectos.
    • Implementación de la conectividad Bluetooth desde la aplicación utilizando las librerías proporcionadas por Android.
    • Desarrollo del código Java que gestiona la lógica de la aplicación.
  • Pruebas y validación del proyecto.

Las diferentes fases se han enfocado con vistas a la posibilidad de ampliar el proyecto en el futuro añadiendo nuevas alternativas de control y uso tanto a la Raspberry Pi como a la aplicación móvil.

Ejemplos de la interfaz de usuario:

Imagen 21Imagen 1

Vídeo demostrativo:

Futbolín 2.0

Esta semana hemos comenzado con el desarrollo de un sistema completamente nuevo para el Futbolín. El sistema anterior, implementado en C++ y en un ordenador de escritorio, se trasladará a una Raspberry Pi y será desarrollado en Python. El nuevo sistema tendrá como prioridad tener alta mantenibilidad y ser fácilmente expansible.

El nuevo Futbolín utilizará Python 2.7, GTK+ 3 y Glade. Estos dos últimos nos permiten crear una interfaz gráfica de manera rápida, por medio de ficheros XML. La nueva base de datos del sistema se implementará en SQLite por su mejor desempeño con sistemas de bajos recursos.

A continuación se muestran capturas de pantallas de la nueva interfaz gráfica.

Screenshot - Characters


Screenshot - Match

La interfaz gráfica y la funcionalidad básica del sistema ya han sido desarrolladas. Las próximas tareas son integrar la aplicación a la nueva base de datos y a los sensores del futbolín.