# Jupylet
*Jupylet* is a Python library for programming 2D and 3D games, graphics, music
and sound synthesizers, interactively in a Jupyter notebook. It is intended
for three types of audiences:
* Computer scientists, researchers, and students of deep reinforcement learning.
* Musicians interested in sound synthesis and live music coding.
* Kids and their parents interested in learning to program.
<p float="left">
<img src="https://github.com/nir/jupylet/raw/master/docs/images/spaceship.gif" width="256" />
<img src="https://github.com/nir/jupylet/raw/master/docs/images/spaceship_3d.gif" width="384" />
</p>
## Jupylet for Kids
A Jupyter notebook is in essence a laboratory for programming. It is the ideal
environment for playing around with code, experimenting, and exploring ideas.
It is used by professional machine learning scientists who come every day to
play at work, so why not by kids?
*Jupylet* is wonderfully easy to use for creating simple 2D and 3D games and
music interactively and experimentally. Change a variable or a function and
see how the game is affected immediately while running.
## Jupylet for Deep Reinforcement Learning
*Jupylet* makes it is super easy to create and modify environments in which to
experiment with deep reinforcement learning algorithms and it includes the API
to programmatically control multiple simultaneous games and render thousands
of frames per second.
Consider for example the pong game included in this code base. With a few
lines of code you can modify the colors of the game to experiment with transfer
learning, or turn the game into 4-way pong with agents on all four sides of the
game court to experiment with cooperation between multiple agents. And since you
can modify the game interactively in Jupyter this process is not only easy but
also fun.
Check out the [*Programming Graphics*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/graphics.html)
and the [*Reinforcement Learning*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/rl.html)
chapters in the Jupylet Programmer's Reference Guide.
## Jupylet for Musicians
*Jupylet* imports ideas and methods from machine learning into the domain
of sound synthesis to easily let you create sound synthesizers as wild as you
can dream up - it includes impulse response reverb effects, colored noise
generators, resonant filters with cutoff frequency sweeping, oscillators with
LFO modulation, multi sampled instruments, and much more... And all of it in
pure Python for you to modify and experiment with.
In addition *Jupylet* draws inspiration from the wonderful [*Sonic Pi*](https://sonic-pi.net/)
and brings live loops and live music coding to Jupyter and Python. Hook up
your MIDI keyboard and take off.
Check out the [*Programming Sound and Music*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/sound.html)
and the [*Programming Synthesizers*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/synthesis.html)
chapters in the Jupylet Programmer's Reference Guide.
## Requirements
*Jupylet* should run on Python 3.9 and up on Windows, Mac, and Linux.
## How to Install and Run Jupylet
If you are new to Python, I recommend that you install and use the
[Miniconda Python](https://docs.conda.io/en/latest/miniconda.html)
distribution.
**On Windows** – download and run the 64-bit installer for Python 3.11. Once
Miniconda is installed press the `⊞ Winkey` and then type *Miniconda* and
press the `Enter` key. This should open a small window that programmers call
*console* or *shell* in which you can enter commands and run programs.
**On macOS with M1 processor** – download and run "Miniconda3 macOS Apple M1 64-bit pkg"
for Python 3.11. Once installed click the Spotlight icon `🔍` and in the search
field type *terminal* and press the `Enter` key to open the console. Then you need
to run the following command:
pip install --extra-index https://github.com/nir/jupylet/releases/download/v0.9.2/ moderngl glcontext
**On macOS with Intel processor** – download and run "Miniconda3 macOS Intel x86 64-bit pkg"
for Python 3.11. Once installed click the Spotlight icon `🔍` and in the search
field type *terminal* and press the `Enter` key to open the console.
**On Linux** – download "Miniconda3 Linux 64-bit". This should download the file
Miniconda3-latest-Linux-x86_64.sh. Install it by running the following command
in a bash shell (once installed start a new bash shell):
bash Miniconda3-latest-Linux-x86_64.sh
---
Once Miniconda is installed it is time to install *jupylet* by typing the
following command in the console:
pip install jupylet
Next, to run the example notebooks, download the *jupylet* source code.
If you have [Git](https://git-scm.com/) installed type the following command:
git clone https://github.com/nir/jupylet.git
Alternatively, you can download the source code with the following command:
python -m jupylet download
Next, enter the *jupylet/examples/* directory with the change directory
command:
cd jupylet/examples/
And start a jupyter notebook with:
jupyter notebook 11-spaceship.ipynb
Run the notebook by following the instructions in the notebook and a game
canvas should appear with the spaceship example:
<img src="https://github.com/nir/jupylet/raw/master/docs/images/spaceship.gif" width="256" height="256" />
Alternatively, you can run the same game as a Python script from the console
with:
python spaceship.py
## Documentation
To get started with Jupylet head over to the *Jupylet Programmer's Reference
Guide* which you can find at
[jupylet.readthedocs.io](https://jupylet.readthedocs.io/).
To complement the online guide check out the growing collection of
[*example notebooks*](examples/) that you can download and run on your
computer as explained above.
## Contact
For questions and feedback send an email to [Nir Aides](mailto:nir.8bit@gmail.com) or [join the discussion](https://github.com/nir/jupylet/discussions).
## Spread the Word
Jupylet is a new library and you can help it grow with a few clicks -
if you like it let your friends know about it!
## Acknowledgements
* [Einar Forselv](https://github.com/einarf) - The programmer behind ModernGL
for his endless help in the trenches of OpenGL programming.
* [Alban Fichet](https://afichet.github.io/) - For kindly licensing his
sound visualizer Shadertoy as CC BY 4.0 license.
## What's New in Version 0.9.1
* Support for Python 3.10 and Python 3.11 with MIDI functionality.
* Seamlessly track changes to audio devices on macOS.
* Workaround PIL api change - thanks to [@misolietavec](https://github.com/misolietavec).
* Bug fixes.
## What's New in Version 0.8.9
* Support for Python 3.10 and Python 3.11 - except for MIDI functionality.
* Support for macOS M1.
* Spectrum analyzer.
* Bug fixes.
<img src="https://user-images.githubusercontent.com/124126/208634912-6cf956ec-b1e3-43c2-87a1-3c437953b739.png" width=50% height=50%>
## What's New in Version 0.8.8
* Support for Python 3.9.
## What's New in Version 0.8.7
* Workaround auto-completion bug in Jupyter notebooks.
## What's New in Version 0.8.6
* Support for rendering Shadertoy OpenGL shaders.
[Shadertoy](https://www.shadertoy.com/) is an awesome online platform for
programming and sharing OpenGL shaders online, and now you can
[use and render shadertoy shaders in Jupylet!](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/graphics-3d.html#shadertoys)
Raw data
{
"_id": null,
"home_page": "https://github.com/nir/jupylet",
"name": "jupylet",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<3.13",
"maintainer_email": "",
"keywords": "reinforcement learning,deep learning,synthesizers,moderngl,children,jupyter,python,games,midi,kids,RL",
"author": "Nir Aides",
"author_email": "nir.8bit@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b6/be/5e2f84f5ffea32613d0234613541189740cadc8d53ce851dcd49612ae2af/jupylet-0.9.2.tar.gz",
"platform": null,
"description": "# Jupylet\n\n*Jupylet* is a Python library for programming 2D and 3D games, graphics, music \nand sound synthesizers, interactively in a Jupyter notebook. It is intended \nfor three types of audiences:\n\n* Computer scientists, researchers, and students of deep reinforcement learning.\n* Musicians interested in sound synthesis and live music coding.\n* Kids and their parents interested in learning to program.\n\n \n\n<p float=\"left\">\n <img src=\"https://github.com/nir/jupylet/raw/master/docs/images/spaceship.gif\" width=\"256\" />\n <img src=\"https://github.com/nir/jupylet/raw/master/docs/images/spaceship_3d.gif\" width=\"384\" />\n</p>\n\n## Jupylet for Kids\n\nA Jupyter notebook is in essence a laboratory for programming. It is the ideal\nenvironment for playing around with code, experimenting, and exploring ideas.\nIt is used by professional machine learning scientists who come every day to\nplay at work, so why not by kids?\n\n*Jupylet* is wonderfully easy to use for creating simple 2D and 3D games and \nmusic interactively and experimentally. Change a variable or a function and \nsee how the game is affected immediately while running.\n\n## Jupylet for Deep Reinforcement Learning\n\n*Jupylet* makes it is super easy to create and modify environments in which to\nexperiment with deep reinforcement learning algorithms and it includes the API\nto programmatically control multiple simultaneous games and render thousands \nof frames per second.\n\nConsider for example the pong game included in this code base. With a few\nlines of code you can modify the colors of the game to experiment with transfer \nlearning, or turn the game into 4-way pong with agents on all four sides of the \ngame court to experiment with cooperation between multiple agents. And since you \ncan modify the game interactively in Jupyter this process is not only easy but \nalso fun. \n\nCheck out the [*Programming Graphics*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/graphics.html) \nand the [*Reinforcement Learning*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/rl.html) \nchapters in the Jupylet Programmer's Reference Guide.\n\n## Jupylet for Musicians\n\n*Jupylet* imports ideas and methods from machine learning into the domain\nof sound synthesis to easily let you create sound synthesizers as wild as you\ncan dream up - it includes impulse response reverb effects, colored noise \ngenerators, resonant filters with cutoff frequency sweeping, oscillators with \nLFO modulation, multi sampled instruments, and much more... And all of it in \npure Python for you to modify and experiment with.\n\nIn addition *Jupylet* draws inspiration from the wonderful [*Sonic Pi*](https://sonic-pi.net/)\nand brings live loops and live music coding to Jupyter and Python. Hook up \nyour MIDI keyboard and take off.\n\nCheck out the [*Programming Sound and Music*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/sound.html) \nand the [*Programming Synthesizers*](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/synthesis.html)\nchapters in the Jupylet Programmer's Reference Guide.\n\n## Requirements\n\n*Jupylet* should run on Python 3.9 and up on Windows, Mac, and Linux.\n\n## How to Install and Run Jupylet\n\nIf you are new to Python, I recommend that you install and use the\n[Miniconda Python](https://docs.conda.io/en/latest/miniconda.html)\ndistribution. \n\n**On Windows** – download and run the 64-bit installer for Python 3.11. Once \nMiniconda is installed press the `\u229e Winkey` and then type *Miniconda* and \npress the `Enter` key. This should open a small window that programmers call \n*console* or *shell* in which you can enter commands and run programs.\n\n**On macOS with M1 processor** – download and run \"Miniconda3 macOS Apple M1 64-bit pkg\" \nfor Python 3.11. Once installed click the Spotlight icon `\ud83d\udd0d` and in the search \nfield type *terminal* and press the `Enter` key to open the console. Then you need \nto run the following command:\n\n pip install --extra-index https://github.com/nir/jupylet/releases/download/v0.9.2/ moderngl glcontext\n\n**On macOS with Intel processor** – download and run \"Miniconda3 macOS Intel x86 64-bit pkg\" \nfor Python 3.11. Once installed click the Spotlight icon `\ud83d\udd0d` and in the search \nfield type *terminal* and press the `Enter` key to open the console.\n\n**On Linux** – download \"Miniconda3 Linux 64-bit\". This should download the file\nMiniconda3-latest-Linux-x86_64.sh. Install it by running the following command \nin a bash shell (once installed start a new bash shell):\n\n bash Miniconda3-latest-Linux-x86_64.sh\n\n---\n\nOnce Miniconda is installed it is time to install *jupylet* by typing the \nfollowing command in the console:\n\n pip install jupylet\n\nNext, to run the example notebooks, download the *jupylet* source code. \nIf you have [Git](https://git-scm.com/) installed type the following command:\n\n git clone https://github.com/nir/jupylet.git\n\nAlternatively, you can download the source code with the following command:\n\n python -m jupylet download\n\nNext, enter the *jupylet/examples/* directory with the change directory\ncommand:\n\n cd jupylet/examples/\n\nAnd start a jupyter notebook with:\n\n jupyter notebook 11-spaceship.ipynb\n\nRun the notebook by following the instructions in the notebook and a game\ncanvas should appear with the spaceship example:\n\n<img src=\"https://github.com/nir/jupylet/raw/master/docs/images/spaceship.gif\" width=\"256\" height=\"256\" />\n\nAlternatively, you can run the same game as a Python script from the console \nwith:\n\n python spaceship.py\n\n## Documentation\n\nTo get started with Jupylet head over to the *Jupylet Programmer's Reference \nGuide* which you can find at \n[jupylet.readthedocs.io](https://jupylet.readthedocs.io/). \n\nTo complement the online guide check out the growing collection of \n[*example notebooks*](examples/) that you can download and run on your \ncomputer as explained above.\n\n## Contact\n\nFor questions and feedback send an email to [Nir Aides](mailto:nir.8bit@gmail.com) or [join the discussion](https://github.com/nir/jupylet/discussions).\n\n## Spread the Word\n\nJupylet is a new library and you can help it grow with a few clicks - \nif you like it let your friends know about it!\n\n## Acknowledgements\n\n* [Einar Forselv](https://github.com/einarf) - The programmer behind ModernGL \nfor his endless help in the trenches of OpenGL programming.\n* [Alban Fichet](https://afichet.github.io/) - For kindly licensing his \nsound visualizer Shadertoy as CC BY 4.0 license.\n\n## What's New in Version 0.9.1\n\n* Support for Python 3.10 and Python 3.11 with MIDI functionality.\n* Seamlessly track changes to audio devices on macOS.\n* Workaround PIL api change - thanks to [@misolietavec](https://github.com/misolietavec).\n* Bug fixes. \n\n## What's New in Version 0.8.9\n\n* Support for Python 3.10 and Python 3.11 - except for MIDI functionality.\n* Support for macOS M1.\n* Spectrum analyzer.\n* Bug fixes. \n\n<img src=\"https://user-images.githubusercontent.com/124126/208634912-6cf956ec-b1e3-43c2-87a1-3c437953b739.png\" width=50% height=50%>\n\n## What's New in Version 0.8.8\n\n* Support for Python 3.9. \n\n## What's New in Version 0.8.7\n\n* Workaround auto-completion bug in Jupyter notebooks. \n\n## What's New in Version 0.8.6\n\n* Support for rendering Shadertoy OpenGL shaders. \n[Shadertoy](https://www.shadertoy.com/) is an awesome online platform for \nprogramming and sharing OpenGL shaders online, and now you can \n[use and render shadertoy shaders in Jupylet!](https://jupylet.readthedocs.io/en/latest/programmers_reference_guide/graphics-3d.html#shadertoys)\n\n",
"bugtrack_url": null,
"license": "bsd-2-clause",
"summary": "Python game programming in Jupyter notebooks.",
"version": "0.9.2",
"project_urls": {
"Download": "https://github.com/nir/jupylet/archive/v0.9.2.tar.gz",
"Homepage": "https://github.com/nir/jupylet"
},
"split_keywords": [
"reinforcement learning",
"deep learning",
"synthesizers",
"moderngl",
"children",
"jupyter",
"python",
"games",
"midi",
"kids",
"rl"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b6be5e2f84f5ffea32613d0234613541189740cadc8d53ce851dcd49612ae2af",
"md5": "8152199dc8e6ef6aeaae614258b696ac",
"sha256": "2f0cae1054d774778a5ae895968c78ecbf654bc16d418e35f58ee90f3ab71bd6"
},
"downloads": -1,
"filename": "jupylet-0.9.2.tar.gz",
"has_sig": false,
"md5_digest": "8152199dc8e6ef6aeaae614258b696ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<3.13",
"size": 347240,
"upload_time": "2024-01-22T16:51:22",
"upload_time_iso_8601": "2024-01-22T16:51:22.968667Z",
"url": "https://files.pythonhosted.org/packages/b6/be/5e2f84f5ffea32613d0234613541189740cadc8d53ce851dcd49612ae2af/jupylet-0.9.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-22 16:51:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nir",
"github_project": "jupylet",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "jupylet"
}