Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The text-based commands may also be generated by external tools and scripts rather than by AWE Designer. An example scriptExample scripts, written in Python and MATLAB, is are shown below. This script connects These scripts connect to the AWE Server at TCP port 15007 (to bypass port 15001, which AWE Designer GUI uses) and reads and writes the ScalerDBControl module’s currentGain variable in an active layout in real-time. The remainder of this document describes the full set of tuning commands and arguments.

The AWD which works with this script these scripts is attached below. Load this AWD into Audio Weaver, then build and run the layout. The script has been tested with Python versions 2.7 and 3.11Finally, run the script.

View file
nameTuning-API-Test.awd

Python 2.7 and 3.11

Code Block
languagepy
import socket
import time

TCP_IP = 'localhost'
TCP_PORT = 15007
BUFFER_SIZE = 1024

# Open a TCP socket to AWE Server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))

# Read the value of the scaler's gain
s.send(b'get_value,Scaler1.currentGain\n')
data = s.recv(BUFFER_SIZE)
print (data)

# Attenuate channel 1 to 0.5
s.send(b'set_value,Scaler1.currentGain,0.5\n')
data = s.recv(BUFFER_SIZE)
print (data)

The expected output is shown below.

...

MATLAB (tested with r2023b)

Code Block
% Open a TCP socket to AWE Server
client = tcpclient('127.0.0.1', 15007, "Timeout", 1000);
% Read the value of the scaler's gain
writeline(client, 'get_value,Scaler1.currentGain');
readline(client)
% Attenuate channel 1 to 0.5
writeline(client, 'set_value,Scaler1.currentGain,0.5');
readline(client)

The expected output in the MATLAB console is shown below.

...

INI file settings

Colors may be customized in the INI file as follows:

...

offset – must be an integer >= 0,

each moduleI module must be the name of a module created by create_module

...

If file_name is given, creates a WAV/MP3 file reader at the rate of the file, otherwise creates a sound card reader. It then creates an output device , and calls the framework pump at a rate suitable to pump samples.

...

If the second argument starts with 'record=' then a file is specified to capture output. This file will be a WAV file with as many channels as the output and at the same rate. Warning: this file will grow without bound , and should be used only for limited test purposes.

...

Causes wireName to be bound to the pinName. It is an error for an output I/O pin to be bound more than once. Input or Output are the default I/O pins. All wire binding is released by destroy.

The reply is:

success,heap1,heap2,heap3

...

Brings Audio Weaver Server window to the foreground (top most topmost in Z-order). Makes the window visible if it was behind other windows.

...

Only those proxies enabled in the INI file can be specified. Linux supports only the Ethernet proxy. The default proxy is Native , and is always available.

Replies:

...

Reopens a device previously closed by close_input. The same parameters are used as when the device was originally opened when audio started. It is an error to reopen an already open device , or use an index that does not exist.

...

Reopens a device previously closed by close_output. The same parameters are used as when the device was originally opened when audio started. It is an error to reopen an already open device , or use an index that does not exist.

This command is intended for rare cases where a device has to be reconfigured , but can't be while AWE has an open handle on it.

...

The attribute value may be any 7-bit value constructed by orring OR-ing the following together expressed as decimal:

...

boundID – zero if the pin is not bound, othereise otherwise the ID of the bound wire.

info1 – a packed bitfield of 10-bit channels | 17 bits blockSize | 4-bit sample size bytes | 1 bit complex

...

info3 – a packed bitfield of 10 bits rows | 10 bits cols | 1-bit isIPC | 1-bit isPrivate | 1 bit clock master | 1 bit special

...

The layout of all classes is given in the schema file, where each member is named, and its type given: className will be found in the schema file. The value is displayed appropriately for the type: float values are displayed using %g, all other values are displayed as decimal unsigned integers.

...

nParams – the number of public and private parameters an instance of the module may take. The values are packed as separate 16-bit numbers into a 32-bit value. The high 16 bits represent the number of private words; the lower 16 bits represent the number of public words.

...

baseBlockSize - the base block size for audio. Layouts must use an integer multiple of this nThreads - the number of concurrent threads per core. Typically, 2 for embedded targets and 4 for SMP targets.

...

packedInfo – 7 bits CPU type | 8 bits output channels | 8 bits input channels | 1-bit floating point | 1 bit file system | 4 bits sizeof(int)

version - 32-bit version number usually expressed as w.x.y.z where each field is a byte of the word most significant first

targetName - an up to 8-character name for the target

...

The meaning is the same as the public derivation in C++. In the example above, B inherits all the members of A.

...

For more about binary packets, including a detailed list of available commands, see AWE Core Tuning Command Syntax and Protocol.