Skip to content

Commit

Permalink
Update jupyter_GUI_minimal.ipynb
Browse files Browse the repository at this point in the history
- typos
- some text enhancements
  • Loading branch information
fs446 committed May 9, 2023
1 parent c1bd686 commit 264713d
Showing 1 changed file with 39 additions and 34 deletions.
73 changes: 39 additions & 34 deletions jupyter_GUI_minimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"\n",
"Authors: [Johannes Otto](https://github.com/jo123-hro), [Frank Schultz](https://github.com/fs446)\n",
"\n",
"This Jupyter notebook handles a multiple stimuli listening test. Jupyter widgets library is used to create a GUI that is then connected to the Reaper DAW by the means of the Reaper API as well as the Open Sound Control (OSC) protocol."
"This Jupyter notebook handles a multiple stimuli rating listening test. The Jupyter widgets library is used to create a GUI that is then connected to the Reaper DAW by the means of the Reaper API as well as the Open Sound Control (OSC) protocol."
]
},
{
Expand All @@ -22,22 +22,23 @@
"A similar notebook was originally created for a listening test conducted in January 2023.\n",
"It can be found at: \n",
"\n",
"- ### TODO: link to aachen test git repo\n",
"- TBA: link to repo Aachen/Rostock listening test on personalised binaural audio with HOA2BIN rendering\n",
"\n",
"It is important to note that the Reaper projects will get saved before closing them in this minimal version of the notebook. This means that all changes done throughout the test might affect the next testsubject if the projects are shared among them.\n",
"In the original notebook version this was prevented by making a working copy of the template project on each load and deleting it afterwards.\n",
"It is important to note that the Reaper projects will get saved before closing them in this minimal example. This means that all changes done throughout the test might affect the next test subject if the projects are shared among them.\n",
"In the actual listening test, this GUI handling was originally created for, this was prevented by making a working copy of a template project on each scene load and deleting it after usage.\n",
"\n",
"The original notebook also includes randomizing of scene and option order."
"The original notebook also includes randomizing of scenes and option's order."
]
},
{
"cell_type": "markdown",
"id": "cda2061f",
"metadata": {},
"source": [
"It is also important to know that this notebook relies heavily on the stability of Reaper.\n",
"Although some of the Reapy function will wait for an answer from Reaper, the notebook itself generally doesn't check or wait for a confirmation from the functions. This is especially important in case of the OSC functionality as multiple servers with the same port will lead to collisions and thus messages not being received.\n",
"To prevent this it is advisable to always double check the OSC configurations before starting a test."
"It is also important to notice that this notebook heavily relies on the stability of Reaper.\n",
"Although some of the Reapy functions will wait for an answer from Reaper, the notebook itself generally doesn't check or wait for a confirmation from the functions. This is especially important in case of the OSC functionality as multiple servers with the same port will lead to collisions and thus messages not being received.\n",
"To prevent this, it is advisable to always double check the OSC configurations before starting a test.\n",
"However, once a listening test is set up properly, we never ever experienced problems with Reaper. It is very robust in this scheme, doing its job savely in the background."
]
},
{
Expand Down Expand Up @@ -73,7 +74,9 @@
"- ipywidgets 7.6.5\n",
"- [ABComparison](https://github.com/DanielRudrich/ABComparisonPlugin) Plugin v1.4.0\n",
"\n",
"A corresponding yml file called `msrg_env.yml` is included with the repository. "
"A corresponding conda environment file `msrg_env.yml` is included with the repository.\n",
"\n",
"We tested and successfully used this scheme on the latest macOSs, but have no experience for the Windows OS."
]
},
{
Expand Down Expand Up @@ -113,7 +116,7 @@
"\n",
"`$ pip install python-reapy`\n",
"\n",
"After that we need to have Reaper open and then run in a terminal:\n",
"After that we need to open Reaper and then run in a terminal:\n",
"\n",
"`$ python -c \"import reapy; reapy.configure_reaper()\"`\n",
"\n",
Expand Down Expand Up @@ -182,7 +185,7 @@
"Now we have `reaper_project` as our Reaper Project.\n",
"We can use its methods and parameters to interact with Reaper.\n",
"\n",
"Some Examples:"
"Some examples:"
]
},
{
Expand Down Expand Up @@ -251,7 +254,7 @@
"and with `.params[i]`its parameters.\n",
"`i`doesnt have to be an integer it could also be a string.\n",
"\n",
"To set the Bypass Option of the first FX of the first track we can use:"
"To toggle the Bypass option of the first FX of the first track we can use:"
]
},
{
Expand Down Expand Up @@ -288,9 +291,9 @@
"An OSC message usually consists of a string containing a command or a parameter that is to be changed and the values of the changes can be int or float.\n",
"\n",
"## 3.1 Configuring Reaper\n",
"To use OSC to control Reaper functionality directly we need to configure Reaper first.\n",
"To use OSC to control Reaper functionality directly, we need to configure Reaper first.\n",
"Under Reaper `Preferences > CONTROL/OSC/web` a new control surface needs to be added.\n",
"For our purposes the simple configurations shown be below does suffice."
"For our purposes the simple configurations shown below does suffice."
]
},
{
Expand All @@ -314,7 +317,7 @@
"## 3.2 Setting up UDP-clients\n",
"First we need to import the `udp_client` from `pythonosc` and set up a simple client to send messages.\n",
"We need to set the IP and a matching OSC Port.\n",
"To send messages to both Reaper and the ABComparison Plugin, two seperate clients are needed."
"To send messages to both Reaper and the ABComparison Plugin, two separate clients are needed."
]
},
{
Expand All @@ -332,7 +335,7 @@
"# OSC port of Reaper:\n",
"reaper_port = 8000 \n",
"\n",
"# OSC port of the AbComparison plugin:\n",
"# OSC port of the ABComparison plugin:\n",
"abc_switch_port = 9222 \n",
"\n",
"# client for sending osc messages to reaper\n",
Expand Down Expand Up @@ -403,7 +406,7 @@
"id": "747ddfee",
"metadata": {},
"source": [
"- Set the Output-Volume of a single Track:"
"- Set the Output-Volume of a single track:"
]
},
{
Expand Down Expand Up @@ -457,7 +460,8 @@
"id": "a8ddf0fe",
"metadata": {},
"source": [
"The image below shows the Reaper configuration for track 1 which the ABComparison plug-in is used on."
"The image below shows the Reaper configuration for track 1 which the ABComparison plug-in is used on.\n",
"This track then sends to master track, which is assumed to be connected with the sound card output."
]
},
{
Expand Down Expand Up @@ -494,13 +498,13 @@
"source": [
"# 4 Jupyter Widgets\n",
"\n",
"A simple way to create interactive widgets in a notebook is the jupyter widgets or ipywidgets library. \n",
"A convenient way to create interactive widgets in a notebook is the jupyter widgets or ipywidgets library. \n",
"It can be installed via pip: \n",
"\n",
"`pip install ipywidgets`\n",
"\n",
"\n",
"The full documentationis availible at: https://ipywidgets.readthedocs.io/en/stable/"
"The full documentation is available at: https://ipywidgets.readthedocs.io/en/stable/"
]
},
{
Expand All @@ -521,11 +525,11 @@
"id": "a6504f45",
"metadata": {},
"source": [
"## 4.1 Some simple Examples\n",
"## 4.1 Some Simple Examples\n",
"\n",
"A simple button can be created with `widgets.Button`.\n",
"We can control its appearance with the attributes `layout`and `style`.\n",
"The `layout` attribute expects a `Layout` Object with things like `width` and `height` as parameters.\n",
"The `layout` attribute expects a `Layout` object with things like `width` and `height` as parameters.\n",
"The `style` attribute supports different styles for each widget class.\n",
"In the case of the `Button` its the `ButtonStyle`.\n",
"With it you can change the appearance of the button, e.g. the color.\n",
Expand Down Expand Up @@ -709,7 +713,7 @@
"id": "2cca5c27",
"metadata": {},
"source": [
"Sliders work in a similar way. There current value can be obtained and set by the `value` attribute.\n",
"Sliders work in a similar way. Their current value can be obtained and set by the `value` attribute.\n",
"Changes can be observed and acted upon with the `observe` method."
]
},
Expand All @@ -719,7 +723,7 @@
"metadata": {},
"source": [
"## 4.2 Layout\n",
"To layout and display widgets together the `VBox` and `HBox`elements can be used."
"To layout and display widgets together, the `VBox` and `HBox`elements can be used."
]
},
{
Expand Down Expand Up @@ -762,11 +766,12 @@
"id": "87f3767e",
"metadata": {},
"source": [
"# 5 Building a complete GUI\n",
"# 5 Building a Complete GUI\n",
"\n",
"The next steps give an overview of the functions and widgets needed to create a complete graphical user interface (GUI) including loading new scenes / Reaper projects.\n",
"We should have an eye on Reaper while testing the GUI.\n",
"\n",
"## 5.1 Functions to create GUI elements\n",
"## 5.1 Functions to Create GUI Elements\n",
"\n",
"First some functions need to be defined, that create the GUI elements we need."
]
Expand Down Expand Up @@ -873,9 +878,9 @@
"id": "f331c29e",
"metadata": {},
"source": [
"## 5.2 Functions to be called from widget interaction\n",
"## 5.2 Functions to be Called from Widget Interaction\n",
"\n",
"We need a function to send OSC messages to the ABC-Plugin."
"We need a function to send OSC messages to the ABComparison plugin."
]
},
{
Expand All @@ -894,8 +899,8 @@
"id": "a86c471b",
"metadata": {},
"source": [
"Another function refreshes the GUI state on a scene switch or when first loading the GUI. This is necessary because the Plugin can be set to an undesired state, where nothing is active if the same option is switched to twice in a row. To prevent this, the function switches through all options.\n",
"It also resets all slider values and sets the stops playback."
"Another function refreshes the GUI state on a scene switch or when initially loading the GUI. This is necessary because the plugin can be set to an (for our purpose) undesired state, where nothing is active if the same option is switched to twice in a row. To prevent this, the function switches through all options.\n",
"It also resets all slider values and stops playback."
]
},
{
Expand Down Expand Up @@ -980,7 +985,7 @@
"id": "be1e96c6",
"metadata": {},
"source": [
"- The last function works like the write_to_file function above but adds the right brace at the end to close the JSON object."
"- The last function works like the write_to_file function above but adds the right brace at the end, which correctly closes the JSON object."
]
},
{
Expand Down Expand Up @@ -1010,7 +1015,7 @@
"metadata": {},
"source": [
"Now, all we need is a function to switch scenes.\n",
"It disables the GUI, gathers the slider ratings, saves and closes the current project and then opens the next one. In the end the `refresh` function is used and the GUI elements are enabled again."
"It disables the GUI, gathers the slider ratings, saves and closes the current project and then opens the next one. Then the `refresh` function is used and the GUI elements are enabled again."
]
},
{
Expand Down Expand Up @@ -1103,7 +1108,7 @@
"metadata": {},
"source": [
"## 5.3 Set Variables \n",
"Now some variables for the number of options and scenes, the path to the Reaper projects and other options."
"Now some variables for the number of options and scenes, the path to the Reaper projects and other options need to be set up."
]
},
{
Expand Down Expand Up @@ -1424,7 +1429,7 @@
"id": "9df48ecc",
"metadata": {},
"source": [
"Finally we can display the full GUI."
"Finally we can display the full GUI, which is then ready for service."
]
},
{
Expand Down

0 comments on commit 264713d

Please sign in to comment.