"For headings, we recommend that you use IPython's keyboard shortcuts. To change the text in a cell to a level-3 header, simply press `3`. For similar commands, press `h` to view the Help menu."
"For headings, we recommend that you use IPython's keyboard shortcuts. To change the text in a cell to a level-3 header, simply press `3`. For similar commands, press `h` to view the Help menu."
]
]
},
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Default Imports"
]
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"Default Imports\n",
"If you run IPython inside the [`stanford-mir` Vagrant box](https://vagrantcloud.com/stevetjoa/stanford-mir) used for this workshop, every IPython notebook will automatically have the following packages imported: `numpy`, `scipy`, `matplotlib`."
"-----\n",
]
"\n",
},
"If you run IPython inside the [`stanford-mir` Vagrant box](https://vagrantcloud.com/stevetjoa/stanford-mir) used for this workshop, every IPython notebook will automatically have the following packages imported: `numpy`, `scipy`, `matplotlib`.\n",
{
"\n",
"cell_type": "markdown",
"To view the IPython configuration file, visit `~/.ipython/profile_default/ipython_config.py`."
"metadata": {},
"source": [
"In addition, several NumPy and matplotlib functions already exist in the IPython workspace:"
"To learn more about automatic imports, view the IPython configuration file at `~/.ipython/profile_default/ipython_config.py`."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Tab Autocompletion"
]
]
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"Tab Autocompletion\n",
"-----\n",
"\n",
"Tab autocompletion works in Command Window and the Editor. After you type a few letters, press the `Tab` key and a popup will appear and show you all of the possible completions, including variable names and functions. This prevents you from mistyping the names of variables -- a big time saver! \n",
"Tab autocompletion works in Command Window and the Editor. After you type a few letters, press the `Tab` key and a popup will appear and show you all of the possible completions, including variable names and functions. This prevents you from mistyping the names of variables -- a big time saver! \n",
" \n",
" \n",
"For example, type `librosa.` and then press `Tab`. You should see a list of members in the Python package `librosa`."
"For example, type `librosa.` and then press `Tab`. You should see a list of members in the Python package `librosa`."
]
]
},
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Inline Documentation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To get help on a certain Python object, type `?` after the object name, and run the cell:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Run this cell.\n",
"int?"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"More Documentation: NumPy, SciPy, Matplotlib"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the top menu bar, click on Help, and you'll find a prepared set of documentation links for IPython, NumPy, SciPy, Matplotlib!"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Saving"
]
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"Saving\n",
"------\n",
"\n",
"Your code goes directly into an IPython notebook. To save your changes, click on the \"Save\" icon in the menu bar, or type `s` in command mode.\n",
"Your code goes directly into an IPython notebook. To save your changes, click on the \"Save\" icon in the menu bar, or type `s` in command mode.\n",
"\n",
"\n",
"If you want to undo a saved edit, use `git checkout -- <file>` to revert the change."
"If you want to undo a saved edit, use `git checkout -- <file>` to revert the change."
"We will mainly use three libraries for audio acquisition and playback: `IPython.display.Audio`, `essentia.standard.MonoLoader`, and `librosa.load`."
]
]
},
},
{
{
...
@@ -23,7 +21,21 @@
...
@@ -23,7 +21,21 @@
"level": 2,
"level": 2,
"metadata": {},
"metadata": {},
"source": [
"source": [
"Reading Audio"
"Audio Libraries"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will mainly use three libraries for audio acquisition and playback: `IPython.display.Audio`, `essentia.standard.MonoLoader`, and `librosa.load`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Introduced in IPython 2.0, [`IPython.display.Audio`](http://ipython.org/ipython-doc/2/api/generated/IPython.lib.display.html#IPython.lib.display.Audio) lets you play audio directly in an IPython notebook."
]
]
},
},
{
{
...
@@ -39,6 +51,25 @@
...
@@ -39,6 +51,25 @@
"- [Essentia on GitHub](https://github.com/MTG/essentia)"
"- [Essentia on GitHub](https://github.com/MTG/essentia)"
]
]
},
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`librosa` is a Python package for music and audio processing by [Brian McFee](http://cosmal.ucsd.edu/~bmcfee/). A large portion was ported from [Dan Ellis's Matlab audio processing examples](http://www.ee.columbia.edu/%7Edpwe/resources/matlab/).\n",
"Introduced in IPython 2.0, [`IPython.display.Audio`](http://ipython.org/ipython-doc/2/api/generated/IPython.lib.display.html#IPython.lib.display.Audio) lets you play audio directly in an IPython notebook.\n",
"Using [`IPython.display.Audio`](http://ipython.org/ipython-doc/2/api/generated/IPython.lib.display.html#IPython.lib.display.Audio), you can play a local audio file or a remote audio file:"
"\n",
"You can play a local audio file, or you can play remote audio file:"
"We will use Essentia's `MonoWriter` to write a NumPy array to a WAV file. Note: the array must have type `int` or `complex64`."
"-------\n",
"\n",
"`librosa` is a Python package for music and audio processing by [Brian McFee](http://cosmal.ucsd.edu/~bmcfee/). A large portion was ported from [Dan Ellis's Matlab audio processing examples](http://www.ee.columbia.edu/%7Edpwe/resources/matlab/).\n",