{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\"FMP\"\n", "\"AudioLabs\"\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\"B\"\n", "

Get Started

\n", "
\n", "\n", "
\n", "\n", "

\n", "This notebook gives a short introduction on how to start interacting with the FMP notebooks. \n", "

" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## HTML and IPYNB Links\n", "\n", "If a static view of the FMP notebooks is enough for you, the exported HTML versions can be used right away without any installation. All material including the explanations, the figures, and the audio examples can be accessed by just following the **HTML links**. If you want to **execute** the Python code cells, you have to download the notebooks (along with the data), create an environment, and start a Jupyter server. You then need to follow the **IPYNB links** within the Jupyter session. In the following, we explain the following four steps in detail:\n", "\n", "* Downloading the FMP notebooks as well as the data\n", "* Installing Miniconda\n", "* Creating a conda environment\n", "* Starting the Jupyter server\n", "\n", "Further information can also be found in the FMP notebook on installing Python packages and using environment files." ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Downloading the FMP Notebooks\n", "\n", "The FMP notebooks along with all data are contained in a single zip-compressed archive. You can find this archive at \n", "\n", "
\n", " https://www.audiolabs-erlangen.de/resources/MIR/FMP/FMP_1.2.6.zip\n", "
\n", "\n", "Decompress the archive and store it on your local computer." ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Installing Miniconda\n", "\n", "[Conda](https://conda.io/docs/) is an open source package manager that helps finding and installing packages. It runs on Windows, macOS and Linux. The Conda package and environment manager is included in **Anaconda** and its slim version **Miniconda**, which are free and open-source distributions of Python. Miniconda can make installing Python quick and easy even for new users. Download and install Miniconda for your platform from the following website:\n", "\n", "
\n", " https://docs.conda.io/en/latest/miniconda.html\n", "
\n", "\n" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Creating the Conda Environment\n", "\n", "We provide an environment file with all packages needed for interacting with the FMP notebooks. Open the Anaconda Prompt on Windows or your default shell on Linux/macOS. Then change to the directory that contains the file `environment.yml`. Create the environment with the following command: \n", "\n", "
\n", " conda env create -f environment.yml\n", "
\n" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Starting a Jupyter Server\n", "\n", "After creating the FMP environment, you need to activate the environment using the following command:\n", "\n", "
\n", " conda activate FMP\n", "
\n", "\n", "Finally, one needs to change to the directory containing the FMP notebooks and to start the Jupyter server by using the following command:\n", "\n", "
\n", " jupyter notebook\n", "
\n", "\n", "This should open a browser, displaying the folder structure of the FMP notebooks. You then can open the overview notebook by selecting the file `C0/C0.ipynb`. You can also directly open any FMP notebook by selecting a file in any subdirectory with the file extension `.ipynb`. Within the Jupyter session you need to follow the **IPYNB links** to keep the code cells executable. Furthermore note that, within the Jupyter session, you can only access files that are contained in the directory you used for launching the Jupyter server or in any **subdirectory**." ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Further Useful Commands\n", "\n", "Here is a list of useful commands, which may be helpful when updating and starting the environment. The command will be explained in more detail in subsequent notebooks. \n", "\n", "
\n", "\n", "Updating, removing, and creating Python environments:
\n", " \n", "\n", "conda update conda
\n", "conda env update -f environment.yml
\n", "conda env remove -n FMP
\n", "conda env create -f environment.yml
\n", "
\n", "
\n", " \n", "Install package to strip output from IPython notebooks:
\n", "\n", "\n", "conda activate FMP
\n", "nbstripout --install
\n", "
\n", "
\n", " \n", "Install spell checker:
\n", " \n", "\n", "jupyter notebook
\n", "jupyter contrib nbextension install --user
\n", "jupyter nbextension enable spellchecker/main
\n", "
\n", "
\n", "\n", "Export Notebooks as HTML using classical style:
\n", "\n", "\n", "jupyter nbconvert --to html --template classic B_GetStarted.ipynb
\n", "
\n", "
\n", " \n", "Configure notebook to disable cross-site-request-forgery protection:
\n", " \n", "\n", "jupyter notebook --NotebookApp.disable_check_xsrf=True \n", "\n", " \n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "Acknowledgment: This notebook was created by Frank Zalkow and Meinard Müller.\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "
\"C0\"\"C1\"\"C2\"\"C3\"\"C4\"\"C5\"\"C6\"\"C7\"\"C8\"
" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.16" } }, "nbformat": 4, "nbformat_minor": 2 }