Adding wip on signal source manager example

parent 5aeff7ed
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# VA core controller\n",
"This is a simple example how to manage signal source.\n",
"> This script is intended to be used during a VA session with a scene already set up."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Prerequisites"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\users\\jonas\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\ipykernel_launcher.py:5: RuntimeWarning: Was still connected, forced disconnect.\n",
" \"\"\"\n"
]
}
],
"source": [
"import sys\n",
"sys.path.append( '../../Lib/site-packages' )\n",
"import ipywidgets as widgets\n",
"import va\n",
"if not va.connect() :\n",
" raise Exception( 'Could not connect to local VA server' )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Signal sources\n",
"In VA, signal sources represent the emitted sound that is released from a virtual sound source. There are a few different types available, and most of them can be created and controlled dynamically."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### List available signal sources"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d433a63f9d0b482cb84ff48dd0045d6e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"A Jupyter Widget"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"signal_sources = va.get_signal_source_infos()\n",
"if not signal_sources :\n",
" raise Exception( 'There are no signal sources available, stopping here.' )\n",
" \n",
"signal_sources_type = list()\n",
"for signal_source in signal_sources :\n",
" signal_sources_type.append( signal_source['type'] )\n",
"\n",
"children = [ widgets.Text( description = name ) for name in signal_sources_type ]\n",
"tab = widgets.Tab()\n",
"tab.children = children\n",
"for i in range( len( children ) ):\n",
" tab.set_title( i, signal_sources_type[ i ] )\n",
"\n",
"display( tab )"
]
}
],
"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.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment