{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Csound engine started at slot#: 1.\n"
     ]
    }
   ],
   "source": [
    "%matplotlib qt5\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "%load_ext csoundmagics\n",
    "cs = ICsound()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%csound\n",
    "i0 ftgen 1, 0, 8192, 20, 1, 1\n",
    "i0 ftgen 2, 0, 8192, 20, 2, 1\n",
    "i0 ftgen 3, 0, 8192, 20, 3, 1\n",
    "i0 ftgen 4, 0, 8192, 20, 4, 1\n",
    "i0 ftgen 5, 0, 8192, 20, 5, 1\n",
    "i0 ftgen 6, 0, 8192, 20, 6, 1\n",
    "i0 ftgen 61, 0, 8192, 20, 6, 1, 2\n",
    "i0 ftgen 7, 0, 8192, 20, 7, 1\n",
    "i0 ftgen 71, 0, 8192, 20, 7, 1, 5\n",
    "i0 ftgen 72, 0, 8192, 20, 7, 1, 10\n",
    "i0 ftgen 8, 0, 8192, -20, 8, .3\n",
    "i0 ftgen 9, 0, 8192, -20, 9, .8\n",
    "i0 ftgen 91, 0, 8192, 20, 9, 1, 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "fig, ax = plt.subplots(figsize=(6,3))\n",
    "table = 8\n",
    "xmax = cs.tableLength(table)\n",
    "x = range(xmax)\n",
    "ax.set_xlim(0,xmax)\n",
    "ax.set_ylim(0,1.05)\n",
    "#ax.set_yticks([-0.5,0,0.5])\n",
    "ax.set_xticks([0,xmax/4,xmax/2,xmax*3/4,xmax])\n",
    "#ax.axhline(c='k',lw=0.5)\n",
    "#ax.spines['top'].set_visible(False)\n",
    "#ax.spines['right'].set_visible(False)\n",
    "#ax.spines['bottom'].set_visible(False)\n",
    "ax.plot(x,cs.table(table),c='k')\n",
    "fig.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cs.printLog()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
