Package: guitarsounds
guitarsoundsA python package to analyse guitar sounds. Developed as a lutherie research analysis tool with theBruand Lutherie School.
The guitarsound python package documentation is available atdocumentationand a Jupyter Notebook tutorial for the API is availablehere.MotivationThe main goal of this project is to provide a tool to efficiently analyse sound data from research projects in musical instrument design. While sound analysis packages already exist, they are more directed to feature extraction for machine learning purposes. Additionally, some features of interest, like time dependent decay, onset shape and fourier transform peaks distribution are not computable trivially or accurately with existing tools. The current release of the guitarsounds package contains usual and advanced digital signal processing tools applied to the analysis of transient harmonic sounds with easy figure generation throughmatplotlib. To allow the package functionalities to be used rapidly without learning the API, a graphic user interface is available based on jupyter lab widgets.InstallationThe following steps can be followed to use guitarsound interactively with Jupyter Notebook. A French version of the installation guide is availablehere.Download the Anaconda package management systemlink.Install the Anaconda package management system (Tutorial).Once Anaconda is installed, the guitarsound package needs to be installed. Without going into heavy details, the guitarsound package is not available from the Anaconda channels and needs to be installed using PIP, thePackage Installer for Python. To install a package from PIP in Anaconda, you need to use the AnacondaPrompt:To install guitarsound, type the following command into the Anaconda Prompt :pip install guitarsoundsOnce the installation of guitarsounds is finished, the package can be used in the Anaconda Jupyter Notebook environment. The Jupyter Notebook environment can be launched fromAnaconda Navigatorwhich is included in the Anaconda package management system.Then, navigate to the sub-directory where you want your work to be and create a Jupyter Notebook :The graphic user interface can be launched by typing the following code in a cell of the notebook :importguitarsoundsinterface=guitarsounds.Interface()Pressing shift+enter runs the code in the cell and launches the graphic user interface of guitarsounds :To go further, you may learn the guitarsounds API, see the API Tutorial notebook and the APIdocumentationExample usageWhile extracting quantitative features from sounds allows for a meaningful analysis, listening to them remains an important part of the analysis. Soundfiles can be loaded by creating aSoundclass instance with the soundfile path as an argumentfromguitarsoundsimportSoundmysound=Sound('example_sounds/Wood_Guitar/Wood_E1.wav')The amplitude-time data of theSoundinstance is stored in aSignalclass and can be listened in a Jupyter Notebook:mysound.signal.listen()Relevant time signal properties can then be rapidly extracted and visualized in the interactive Jupyter Notebook environment. For example, the time damping curve and the associated damping factor is a useful measure when measuring the effects of changes in the guitar design on the decay rate of different notes :mysound.plot.time_damping()Two different sounds can also be compared using theSoundPackclass, such as a tangible effect of a design change can be measured. Here we compare the fourier transform peaks of two guitars built using different materials :importguitarsoundsfile1='example_sounds/Wood_Guitar/Wood_A5.wav'file2='example_sounds/Carbon_Guitar/Carbon_A5.wav'mysounds=guitarsounds.SoundPack(file1,file2,names=['wood','carbon'])mysounds.compare_peaks()The base API of the guitarsounds classes can also be leveraged to create custom signal analysis features. More info and advanced examples are available in theAPI Tutorial Notebook.CommunityFeel free to fork the guitarsound repository and submit pull requests implementing useful changes. If you implement a new feature, please submit associated unit tests in your pull request. Pull requests that pass all the tests and propose changes aligned with the goal of this package should be accepted.This project is maintained by theBruand Lutherie School, if you have problems with the package, or you need support in using it, please write an issue in this repository.