"You are looking at an **IPython Notebook**, an interactive Python shell inside of a web browser. With it, you can run individual Python commands and immediately view their output. It's basically the Matlab Desktop or Mathematica Notebook for Python.\n",
"\n",
"First, we recommend that you take the *User Interface Tour* in the Help Menu above."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Cells"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"An IPython Notebook is comprised of **cells**. Cells are just small units of code or text. For example, the text that you are reading is inside a *Markdown* cell. (More on that later.)\n",
"\n",
"*Code* cells allow you to edit, execute, and analyze small portions of Python code at a time. Here is a code cell:"
"In addition, if you press `Shift-Tab` in a code cell, a help dialog will also appear. For example, in the cell above, place your cursor after `int`, and press `Shift-Tab`."
"Automatic detection of musical events in an audio signal is one of the most fundamental tasks in music information retrieval. Here, we will show how to detect an *onset*, the start of a musical event.\n",
"\n",
"For more reading, see [this tutorial on onset detection by Juan Bello](https://files.nyu.edu/jb2843/public/Publications_files/2005_BelloEtAl_IEEE_TSALP.pdf)."
"For more control over the onset detection algorithm, see [`OnsetDetection`](http://essentia.upf.edu/documentation/reference/std_OnsetDetection.html), [`OnsetDetectionGlobal`](http://essentia.upf.edu/documentation/reference/std_OnsetDetectionGlobal.html), and [`Onsets`](http://essentia.upf.edu/documentation/reference/std_Onsets.html)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"onset_samples = [int(t*44100) for t in onset_times]\n",
"#print onset_samples"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"y = concatenate([x[n0:n0+4410] for n0 in onset_samples])\n",