Package: playplot
PlayplotThis repository contains a Python package calledplayplot,
which provides aninteractive audio playback for matplotlib plots including the creation, navigation, and synchronization of such plots.Each plot is handled in its own process, allowing smooth animations without a blocking main thread/process.
Plots can be started from a Pythonscriptor aninteractive notebook, with plots being shown in separate windows on the machine
where the kernel is running.ReferencesDaniel Keitel, Meinard Müller, Christof Weiß, and Sebastian Rosenzweig.Playplot: A Python Package to Sync Matplotlib Plots to Audio.To be submitted to the Journal of Open Source Software (JOSS).InstallingTo use the library just install it via pip.pip install playplotTo run the examples locally and for development this repository is necessary.git clone https://github.com/groupmm/playplot.gitFor a development installation runpython -m pip install -e .All additional dependencies can be installed viapython -m pip -r requirements.txtUsageExamplesFor examples see theexamplesfolder of this repository.
These examples need some local data to work properly (exceptminimal)Those files are provided for all examples except foradvanced.
Seeexamples/example_data/__init__.pyfor which files are additionally required.
Members of GroupMM can find the missing files on lin2 under/GroupMM/Students/Work_DK/example_data/Theminimalandbasicexamples don't have additional dependencies.intermediaterequireslibfmp(can be installed viapython -m pip install libfmp)advancedhas the most dependencies. We recommend installing from the requirements.txt files. (python -m pip install -r requirements.txt)Minimal Exampleimportmatplotlib.pyplotaspltfromplayplotimportSession# create a Session from the audio data (url not final)session=Session.from_file("https://github.com/groupmm/playplot/blob/main/examples/example_data/bach_bwv245_no22_vokalensemble_ilmenau.wav?raw=true")# decorate the plot function with the session@sessiondefplot(duration):fig,ax=plt.subplots()ax.plot([0,duration])ax.set_xlabel("number of files played")ax.set_ylabel("time in seconds")returnfig,ax# call the plot function, it will create the plot in another processplot(session.duration)# start the session to enable audio playbacksession.start()# Wait until all plots are closed (not necessary when running interactive)session.join()# Check for potential exceptions in the other processes (not necessary when running interactive, an error msg will be displayed)session.check()TestsThere are some test script in thetestsfolder, mostly focussing on process management and error handling.DocsThe documentation is built with sphinx and hosted onGitHub Pages.ContributingWe welcome any suggestions and contributions.
For contributing, please create an issue within this GitHub repository.
Please do not submit a pull request without prior consultation to us.LicenceThe code for this package is published under anMIT licence.
This does not apply to the data files inexamples/example_data.
Example filebach_bwv245_no22_vokalensemble_ilmenau.wavis a recording of Choral No. 22 "Durch Dein Gefängnis" from J.S. BachsJohannespassion, performed by Vokalensemble Ilmenau (conductor: Hans-Jürgen Freitag) at Jakobuskirche Ilmenau, 24.3.2013. Permission granted by the conductor to be used for demo and research purposes only.AcknowledgementsThe initial version of this library was created during a research internship of Daniel Keitel within a computer science master's program, under the supervision of Prof. Dr. Meinard Müller, Dr. Christof Weiß and Dr. des. Sebastian Rosenzweig at
the International Audio Laboratories Erlangen, which are a joint institution of the Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) and Fraunhofer Institute for Integrated Circuits IIS.
This Python library is closely inspired by the MATLAB toolMakePlotPlayable, implemented by Harald Grohganz and colleagues and part of the MATLAB SM Toolbox [1].
We also thank the German Research Foundation (DFG) for various research grants that allowed us for conducting fundamental research in music processing.[1] Meinard Müller, Nanzhu Jiang, and Harald G. GrohganzSM Toolbox: MATLAB Implementations for Computing and Enhancing Similarity MatricesProceedings of 53rd Audio Engineering Society (AES) Conference on Semantic AudioLondon, UK, 2014.https://www.audiolabs-erlangen.de/resources/MIR/SMtoolbox