From The MPEG-4 Structured Audio Book by John Lazzaro and John Wawrzynek.

Part II/3: SAOL Simple Core Opcodes

Sections

Core Opcodes:

abs acos aexprand agaussrand alinrand ampdb apoissonrand arand asin atan ceil cos cpsmidi cpsoct cpspch dbamp exp floor frac gettempo gettune iexprand igaussrand ilinrand int irand kexprand kgaussrand klinrand kpoissonrand krand log log10 max midicps midioct midipch min octcps octmidi octpch pchcps pchmidi pchoct pow settempo settune sgn sin sqrt

Introduction

Core opcodes provide access to commonly-used algorithms through a function call syntax. Core opcodes serve the same role in SAOL that library functions serve in C.

We introduced SAOL core opcodes in the second example in the tutorial in Part I. The right panel shows an assignment statement from this example that includes calls to the core opcodes sin and cpsmidi.

In this chapter, we take a second look at core opcodes. We describe how to use core opcodes in SAOL expressions and statements, and introduce five rate rules that apply to core opcodes.

Like our rate rules in Part II/2, our core opcode rate rules are more conservative than the SAOL language standard, but easier to understand and remember.

We also describe 50 of the core opcodes that compute simple operations. These opcodes are a mix of general-purpose functions and utilities specialized for music and audio.

From the tutorial:


a = 2*sin(3.141597*
          cpsmidi(num)/s_rate);

Core Opcode Semantics

Opcode calls act as atomic elements in expressions. The value of the opcode call is computed as a function of its parameters. This computation occurs as the expression is being evaluated.

Core opcode semantics are defined in the MP4-SA standard. SAOL also has user-defined opcodes, whose semantics are specified by an opcode definition written in SAOL itself.

Since opcode calls act as atomic elements in expressions, they have a rate and a width. In the general case, determining the rate and width of a SAOL opcode may be quite subtle.

In Part IV/4 of the book we describe the rate and width semantics for user-defined opcodes. In this section, we introduce several simple rules that apply to the core opcodes we introduce in Parts II and III of the book.

Core opcode definitions include (1) a header syntax for the opcode that defines the structure of the opcode call and (2) the semantics for computing the return value. All core opcodes return a scalar value.

 

Rate and Width Rules

The rate of fixed-rate opcodes is indicated in its header syntax. The keywords iopcode, kopcode, or aopcode indicate that an opcode is i-rate, k-rate, or a-rate respectively. The header syntax also indicates the rate of each opcode parameters.

For example, the panel on the right shows the header syntax for the fixed-rate core opcode krand, which returns random numbers with a uniform distribution at the k-rate.

The header for krand also defines the signal parameter p. This parameter sets the range of ex.html">mp4-sa-> the mp4-sa book-> SAOL->expressions and statements

Copyright 1999 John Lazzaro and John Wawrzynek. ./usr/share/doc/sfront/html/book/saol/index.html0000644000000000000000000001526610410244121020534 0ustar rootroot The MP4-SA Book: Part II: The SAOL Language

From The MPEG-4 Structured Audio Book by John Lazzaro and John Wawrzynek.

Part II: The SAOL Language

Introduction

MPEG-4 Structured Audio (MP4-SA) is an ISO/IEC standard (edited by Eric Scheirer) that specifies sound not as audio data, but as a computer program that generates audio when run. For an introduction to MP4-SA see this short example or read the introductory tutorial presented in Part I of the book.

In Part II of the book, we focus on the SAOL language.

In the first chapter we describe the atomic units of SAOL expressions. We cover the lexical rules for numbers and names, and the declaration of signal variables and instr parameters. We describe the standard names and the global parameters.

In the second chapter we descibe SAOL arithmetic and logical expressions and the statements for assignment, conditionals, and looping.

In the third chapter we descibe the core opcodes for general-purpose computation, and introduce rate and width rules for core opcodes.

In the fourth chapter we introduce the SAOL wavetable type, that is specialized for holding sample data. We introduce the set of core opcodes that directly manipulate wavetables, as well as the set of wavetable generators for initializing wavetables.

In the fifth chapter we cover language features that relate to audio buses in SAOL. We describe the send, route, and sequence commands that create buses and effects instrs, and explain the rules of determining execution order of instr instances. We also describe the SAOL statements for writing to buses, and bus-specific standard names and global parameters.

Next:Part II/1: Numbers and Variables

Part II: Table of Contents

1. Numbers and Variables

2. Expressions and Statements

3. Simple Core Opcodes

4. Wavetables

5. Buses and Execution Order

Copyright 1999 John Lazzaro and John Wawrzynek. ./usr/share/doc/sfront/html/book/saol/simple/0000755000000000000000000000000010410244121020016 5ustar rootroot./usr/share/doc/sfront/html/book/saol/simple/index.html0000644000000000000000000010066110410244121022017 0ustar rootroot The MP4-SA Book: Part II/3: SAOL Simple Core Opcodes

From The MPEG-4 Structured Audio Book by John Lazzaro and John Wawrzynek.

Part II/3: SAOL Simple Core Opcodes

Sections

Core Opcodes:

abs acos aexprand agaussrand alinrand ampdb apoissonrand arand asin atan ceil cos cpsmidi cpsoct cpspch dbamp exp floor frac gettempo gettune iexprand igaussrand ilinrand int irand kexprand kgaussrand klinrand kpoissonrand krand log log10 max midicps midioct midipch min octcps octmidi octpch pchcps pchmidi pchoct pow settempo settune sgn sin sqrt

Introduction

Core opcodes provide access to commonly-used algorithms through a function call syntax. Core opcodes serve the same role in SAOL that library functions serve in C.

We introduced SAOL core opcodes in the second example in the tutorial in Part I. The right panel shows an assignment statement from this example that includes calls to the core opcodes sin and cpsmidi.

In this chapter, we take a second look at core opcodes. We describe how to use core opcodes in SAOL expressions and statements, and introduce five rate rules that apply to core opcodes.

Like our rate rules in Part II/2, our core opcode rate rules are more conservative than the SAOL language standard, but easier to understand and remember.

We also describe 50 of the core opcodes that compute simple operations. These opcodes are a mix of general-purpose functions and utilities specialized for music and audio.

From the tutorial:


a = 2*sin(3.141597*
          cpsmidi(num)/s_rate);

Core Opcode Semantics

Opcode calls act as atomic elements in expressions. The value of the opcode call is computed as a function of its parameters. This computation occurs as the expression is being evaluated.

Core opcode semantics are defined in the MP4-SA standard. SAOL also has user-defined opcodes, whose semantics are specified by an opcode definition written in SAOL itself.

Since opcode calls act as atomic elements in expressions, they have a rate and a width. In the general case, determining the rate and width of a SAOL opcode may be quite subtle.

In Part IV/4 of the book we describe the rate and width semantics for user-defined opcodes. In this section, we introduce several simple rules that apply to the core opcodes we introduce in Parts II and III of the book.

Core opcode definitions include (1) a header syntax for the opcode that defines the structure of the opcode call and (2) the semantics for computing the return value. All core opcodes return a scalar value.

 

Rate and Width Rules

The rate of fixed-rate opcodes is indicated in its header syntax. The keywords iopcode, kopcode, or aopcode indicate that an opcode is i-rate, k-rate, or a-rate respectively. The header syntax also indicates the rate of each opcode parameters.

For example, the panel on the right shows the header syntax for the fixed-rate core opcode krand, which returns random numbers with a uniform distribution at the k-rate.

The header for krand also defines the signal parameter p. This parameter sets the range of ex.html">mp4-sa-> the mp4-sa book-> SAOL->expressions and statements

Copyright 1999 John Lazzaro and John Wawrzynek. ./usr/share/doc/sfront/html/book/saol/index.html0000644000000000000000000001526610410244121020534 0ustar rootroot The MP4-SA Book: Part II: The SAOL Language

From The MPEG-4 Structured Audio Book by John Lazzaro and John Wawrzynek.

Part II: The SAOL Language

Introduction

MPEG-4 Structured Audio (MP4-SA) is an ISO/IEC standard (edited by Eric Scheirer) that specifies sound not as audio data, but as a computer program that generates audio when run. For an introduction to MP4-SA see this short example or read the introductory tutorial presented in Part I of the book.

In Part II of the book, we focus on the SAOL language.

In the first chapter we describe the atomic units of SAOL expressions. We cover the lexical rules for numbers and names, and the declaration of signal variables and instr parameters. We describe the standard names and the global parameters.

In the second chapter we descibe SAOL arithmetic and logical expressions and the statements for assignment, conditionals, and looping.

In the third chapter we descibe the core opcodes for general-purpose computation, and introduce rate and width rules for core opcodes.

In the fourth chapter we introduce the SAOL wavetable type, that is specialized for holding sample data. We introduce the set of core opcodes that directly manipulate wavetables, as well as the set of wavetable generators for initializing wavetables.

In the fifth chapter we cover language features that relate to audio buses in SAOL. We describe the send, route, and sequence commands that create buses and effects instrs, and explain the rules of determining execution order of instr instances. We also describe the SAOL statements for writing to buses, and bus-specific standard names and global parameters.

Next:Part II/1: Numbers and Variables

Part II: Table of Contents

1. Numbers and Variables

2. Expressions and Statements

3. Simple Core Opcodes

4. Wavetables

5. Buses and Execution Order

Copyright 1999 John Lazzaro and John Wawrzynek. ./usr/share/doc/sfront/html/book/saol/simple/0000755000000000000000000000000010410244121020016 5ustar rootroot./usr/share/doc/sfront/html/book/saol/simple/index.html0000644000000000000000000010066110410244121022017 0ustar rootroot The MP4-SA Book: Part II/3: SAOL Simple Core Opcodes