"Macros can be defined to make your life easier. Don't mess around with file pathes too much, use macros. Don't rename output file names for recording and other exported information, use macros. You can test your macros using th method `substitute_macro` (see below), but you don't have to do it yourself. VA will always substitute macros where possible."
"Macros can be defined to make your life easier. Don't mess around with file pathes too much, use macros. Don't rename output file names for recording and other exported information, use macros. You can test your macros using th method `substitute_macro` (see below), but you don't have to do it yourself. VA will always substitute macros where possible."
"You can interact with modules using a magic struct. In Python, this struct is represented by a (nested) dictionary, that is translated to a VAStruct. This struct can be used to call modules and receiver information on return. It is used to change any setting in a given module. This way, interfaces sta untouched but developers have all the possibilities required to try out new prototype functions."
" print( 'Module returned an exception, could not get help' )\n",
" \n",
"mod_call_button.on_click( on_mod_call )\n",
"\n",
"display( mod_widget_box )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Rendering modules\n",
"Rendering modules are special modules and can also be called using the getter and setter methods `get_renderer_parameters` and `set_renderer_parameters`. They usually work like this: use the getter with an empty struct and receive every possible setting with its current value. Change the value or the returned struct and use the setter to modify the corresponding values in the renderinig module:"
This is a simple example how to create a simple acoustic scene in VA using Python.
This is a simple example how to create a simple acoustic scene in VA using Python.
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
### Prerequisites
### Prerequisites
You can ignore this part, it is for preparation purposes only.
You can ignore this part, it is for preparation purposes only.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
importsys
importsys
sys.path.append('../../Lib/site-packages')
sys.path.append('../../Lib/site-packages')
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
importipywidgetsaswidgets
importipywidgetsaswidgets
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
importva
importva
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
### Connect
### Connect
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
va.connect();
va.connect();
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Control
## Control
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
You can mute and unmute the entire audio output by using `set_output_muted` and receive the current setting by `is_output_muted`. The setter uses the optional argument `True` or `False` and will mute the output if no argument is passed.
You can mute and unmute the entire audio output by using `set_output_muted` and receive the current setting by `is_output_muted`. The setter uses the optional argument `True` or `False` and will mute the output if no argument is passed.
The output gain or output volume of VA can be controlled by `set_output_gain` and received by `get_output_gain`. Gains or volumes are defined as a factore between 0 and 1. The same functions also exist for the audio inputs of the sound device.
The output gain or output volume of VA can be controlled by `set_output_gain` and received by `get_output_gain`. Gains or volumes are defined as a factore between 0 and 1. The same functions also exist for the audio inputs of the sound device.
Macros can be defined to make your life easier. Don't mess around with file pathes too much, use macros. Don't rename output file names for recording and other exported information, use macros. You can test your macros using th method `substitute_macro` (see below), but you don't have to do it yourself. VA will always substitute macros where possible.
Macros can be defined to make your life easier. Don't mess around with file pathes too much, use macros. Don't rename output file names for recording and other exported information, use macros. You can test your macros using th method `substitute_macro` (see below), but you don't have to do it yourself. VA will always substitute macros where possible.
reset_button=widgets.Button(description='Reset VA server')
reset_button=widgets.Button(description='Reset VA server')
defon_reset_button_clicked(b):
defon_reset_button_clicked(b):
va.reset()
va.reset()
reset_button.on_click(on_reset_button_clicked)
reset_button.on_click(on_reset_button_clicked)
display(reset_button)
display(reset_button)
```
```
%% Output
%% Output
%% Cell type:markdown id: tags:
## Modules
You can interact with modules using a magic struct. In Python, this struct is represented by a (nested) dictionary, that is translated to a VAStruct. This struct can be used to call modules and receiver information on return. It is used to change any setting in a given module. This way, interfaces sta untouched but developers have all the possibilities required to try out new prototype functions.
print('Module returned an exception, could not get help')
mod_call_button.on_click(on_mod_call)
display(mod_widget_box)
```
%% Output
Calling VACore
Calling BinauralFreeField:MyBinauralFreeField
Module returned an exception, could not get help
%% Cell type:markdown id: tags:
### Rendering modules
Rendering modules are special modules and can also be called using the getter and setter methods `get_renderer_parameters` and `set_renderer_parameters`. They usually work like this: use the getter with an empty struct and receive every possible setting with its current value. Change the value or the returned struct and use the setter to modify the corresponding values in the renderinig module: