what have i done

This commit is contained in:
2025-10-15 15:05:23 +02:00
parent c5733897ea
commit 1015e9e18f
123 changed files with 28542 additions and 1030 deletions

View File

@ -40,6 +40,7 @@
"@hlolli/codemirror-lang-csound": "1.0.0-alpha10",
"@replit/codemirror-vim": "^6.3.0",
"codemirror": "^6.0.2",
"fuse.js": "^7.1.0",
"lucide-svelte": "^0.545.0",
"pako": "^2.1.0"
}

9
pnpm-lock.yaml generated
View File

@ -56,6 +56,9 @@ importers:
codemirror:
specifier: ^6.0.2
version: 6.0.2
fuse.js:
specifier: ^7.1.0
version: 7.1.0
lucide-svelte:
specifier: ^0.545.0
version: 0.545.0(svelte@5.39.13)
@ -447,6 +450,10 @@ packages:
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
fuse.js@7.1.0:
resolution: {integrity: sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==}
engines: {node: '>=10'}
glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
deprecated: Glob versions prior to v9 are no longer supported
@ -1161,6 +1168,8 @@ snapshots:
fsevents@2.3.3:
optional: true
fuse.js@7.1.0: {}
glob@7.2.3:
dependencies:
fs.realpath: 1.0.0

5
scripts/csound-parser/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
node_modules/
dist/
downloaded-opcodes/
*.log
.DS_Store

View File

@ -0,0 +1,277 @@
# Csound Manual Parser
A robust parser that converts the Csound reference manual into TypeScript reference files for use in code editors with hover tooltips and searchable documentation.
## Features
- Downloads markdown files directly from GitHub
- Parses 1000+ Csound opcodes
- Extracts structured data (syntax, parameters, examples)
- Generates organized TypeScript files by category
- Creates a main aggregator file with lookup functions
- Handles edge cases and provides detailed error reporting
## Installation
```bash
cd scripts/csound-parser
pnpm install
```
## Usage
### Option 1: Download and Parse (Recommended)
Download fresh markdown files from GitHub and parse them:
```bash
pnpm run download
```
This will:
1. Download all opcode markdown files from the Csound manual repository
2. Parse them into structured data
3. Generate TypeScript reference files in `src/lib/csound-reference/`
### Option 2: Parse Local Files
If you already have the Csound manual cloned locally:
```bash
pnpm run parse -- --input=/path/to/csound-manual/docs/opcodes
```
### Custom Output Directory
```bash
pnpm run parse -- --output=/custom/output/path
```
## Output Structure
The parser generates:
```
src/lib/csound-reference/
├── types.ts # Type definitions
├── csoundReference.ts # Main aggregator
├── signal-generators-basic-oscillators.ts
├── signal-modifiers-standard-filters.ts
├── mathematical-operations-trigonometric-functions.ts
└── ... (100+ category files)
```
Each category file contains an array of `CsoundReference` objects:
```typescript
export const signalGeneratorsBasicOscillators: CsoundReference[] = [
{
name: 'oscil',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A simple oscillator without any interpolation.',
syntax: 'ares = oscil(xamp, xcps [, ifn, iphs])\nkres = oscil(kamp, kcps [, ifn, iphs])',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: 'function table number. Requires a wrap-around guard point.',
type: 'initialization'
},
// ...
],
seeAlso: ['oscili', 'poscil']
},
// ...
]
```
## Integration
Import in your application:
```typescript
import {
allCsoundReferences,
getCsoundReference,
getCsoundReferencesByCategory
} from './lib/csound-reference/csoundReference'
// Get a specific opcode
const oscil = getCsoundReference('oscil')
// Get all oscillators
const oscillators = getCsoundReferencesByCategory('Signal Generators:Basic Oscillators')
// Search all references
const filtered = allCsoundReferences.filter(ref =>
ref.description.includes('filter')
)
```
## Use Cases
### 1. Hover Tooltips in CodeMirror
Create a tooltip extension similar to the GLSL tooltips:
```typescript
import { hoverTooltip } from '@codemirror/view'
import { getCsoundReference } from './lib/csound-reference/csoundReference'
export const csoundTooltip = hoverTooltip((view, pos) => {
const word = getWordAt(view, pos)
if (!word) return null
const reference = getCsoundReference(word.text)
if (!reference) return null
return {
pos: word.from,
end: word.to,
above: true,
create() {
const dom = document.createElement('div')
dom.innerHTML = `
<div class="tooltip-header">
<strong>${reference.name}</strong>
<span>${reference.type}</span>
</div>
<div class="tooltip-description">${reference.description}</div>
${reference.syntax ? `<pre>${reference.syntax}</pre>` : ''}
`
return { dom }
}
}
})
```
### 2. Searchable Help Panel
Create a reference panel with fuzzy search:
```typescript
import { allCsoundReferences } from './lib/csound-reference/csoundReference'
import Fuse from 'fuse.js'
const fuse = new Fuse(allCsoundReferences, {
keys: ['name', 'description', 'category'],
threshold: 0.4
})
const results = fuse.search('oscillator')
```
### 3. Autocomplete
Use the reference data for intelligent autocomplete:
```typescript
import { allCsoundReferences } from './lib/csound-reference/csoundReference'
const completions = allCsoundReferences.map(ref => ({
label: ref.name,
type: ref.type,
info: ref.description,
detail: ref.syntax
}))
```
## Data Structure
### CsoundReference Interface
```typescript
interface CsoundReference {
name: string // Opcode name (e.g., "oscil")
type: 'opcode' | 'keyword' | 'header' | 'constant'
category: string // Full category path
description: string // Brief description
syntax?: string // Syntax examples
example?: string // Code example
rates?: string[] // ['a-rate', 'k-rate', 'i-rate']
parameters?: {
name: string
description: string
type: 'initialization' | 'performance'
}[]
seeAlso?: string[] // Related opcodes
}
```
## Parser Architecture
### 1. Downloader (`downloader.ts`)
- Fetches markdown files from GitHub API
- Handles rate limiting and retries
- Downloads to `downloaded-opcodes/` directory
### 2. Parser (`parser.ts`)
- Parses markdown frontmatter (id, category)
- Extracts sections using regex
- Extracts parameters from initialization/performance sections
- Handles modern and classic syntax variants
- Detects rate types (a-rate, k-rate, i-rate)
### 3. Generator (`generator.ts`)
- Groups opcodes by category
- Sanitizes category names for file names
- Generates TypeScript files with proper escaping
- Creates main aggregator with imports
- Provides lookup functions
## Troubleshooting
### Download Fails
If the GitHub download fails, manually clone the repository:
```bash
git clone https://github.com/csound/manual.git
cd manual
git checkout develop
```
Then run the parser with the local path:
```bash
pnpm run parse -- --input=../manual/docs/opcodes
```
### Missing Categories
Some opcodes may not have categories defined. The parser will skip these and log warnings.
### Parse Errors
The parser is robust and will continue parsing even if individual files fail. Check the console output for warnings about skipped files.
## Extending the Parser
### Adding New Extraction
To extract additional information from the markdown files, modify `parser.ts`:
```typescript
extractNewField(content: string): string {
const section = this.extractSection(content, 'NewSection')
// Parse the section content
return parsed
}
```
Then add the field to the `CsoundReference` interface in `types.ts`.
### Custom Categories
To reorganize categories, modify the `category` field in the parser or create a mapping function in the generator.
## Performance
- Parsing 1000+ opcodes: ~2-5 seconds
- Generating TypeScript files: ~1-2 seconds
- Download from GitHub: ~30-60 seconds (network dependent)
## License
MIT

View File

@ -0,0 +1,45 @@
import * as fs from 'fs';
import { CsoundManualParser } from './parser';
const parser = new CsoundManualParser();
const content = fs.readFileSync('downloaded-opcodes/moogladder.md', 'utf-8');
console.log('=== Testing moogladder.md ===\n');
// Test extractSection
const syntaxSection = parser.extractSection(content, 'Syntax');
console.log('Syntax section length:', syntaxSection.length);
console.log('First 200 chars:', syntaxSection.substring(0, 200));
console.log('\n---\n');
// Look for ### Initialization
const initMatch = syntaxSection.match(/###\s+Initialization\s*\n([\s\S]*?)(?=\n###|\n##|$)/i);
console.log('Initialization match:', initMatch ? 'FOUND' : 'NOT FOUND');
if (initMatch) {
console.log('Init section content (first 300 chars):');
console.log(initMatch[1].substring(0, 300));
console.log('\n---\n');
// Test the parameter regex
const paramRegex = /_([a-zA-Z0-9_,\s/]+)_\s*[-–—]+\s*([^\n]+(?:\n(?!_)[^\n]+)*)/g;
const params = Array.from(initMatch[1].matchAll(paramRegex));
console.log(`Found ${params.length} parameters`);
params.forEach((p, i) => {
console.log(` Param ${i + 1}: name="${p[1]}", desc="${p[2].substring(0, 60)}..."`);
});
}
// Test extractParameters directly
const initParams = parser.extractParameters(content, 'Initialization');
const perfParams = parser.extractParameters(content, 'Performance');
console.log('\n=== extractParameters results ===');
console.log(`Initialization params: ${initParams.length}`);
initParams.forEach(p => {
console.log(` - ${p.name}: ${p.description.substring(0, 60)}...`);
});
console.log(`\nPerformance params: ${perfParams.length}`);
perfParams.forEach(p => {
console.log(` - ${p.name}: ${p.description.substring(0, 60)}...`);
});

View File

@ -0,0 +1,30 @@
import * as fs from 'fs';
const content = fs.readFileSync('downloaded-opcodes/moogladder.md', 'utf-8');
console.log('Full content length:', content.length);
console.log('\n=== Testing extractSection regex ===\n');
const regex = /##\s+Syntax\s*\n([\s\S]*?)(?=\n##|$)/i;
const match = content.match(regex);
if (match) {
console.log('Match found!');
console.log('Captured content length:', match[1].length);
console.log('\nFull captured content:');
console.log('---START---');
console.log(match[1]);
console.log('---END---');
} else {
console.log('No match found');
}
// Also check what comes after
const syntaxIndex = content.indexOf('## Syntax');
const examplesIndex = content.indexOf('## Examples');
console.log('\n=== Indices ===');
console.log('## Syntax at:', syntaxIndex);
console.log('## Examples at:', examplesIndex);
console.log('Distance:', examplesIndex - syntaxIndex);
console.log('\nContent between (first 500 chars):');
console.log(content.substring(syntaxIndex, syntaxIndex + 500));

View File

@ -0,0 +1,123 @@
import * as fs from 'fs';
import * as path from 'path';
import * as https from 'https';
interface GitHubFile {
name: string;
download_url: string;
type: string;
}
export class GitHubDownloader {
private apiBase = 'https://api.github.com/repos/csound/manual/contents';
private branch = 'develop';
private downloadDir: string;
constructor(downloadDir: string) {
this.downloadDir = downloadDir;
}
private async fetchJson<T>(url: string): Promise<T> {
return new Promise((resolve, reject) => {
https.get(
url,
{
headers: {
'User-Agent': 'Csound-Parser',
},
},
(res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
if (res.statusCode === 200) {
try {
resolve(JSON.parse(data));
} catch (err) {
reject(new Error(`Failed to parse JSON: ${err}`));
}
} else {
reject(new Error(`HTTP ${res.statusCode}: ${data}`));
}
});
}
).on('error', reject);
});
}
private async downloadFile(url: string, destPath: string): Promise<void> {
return new Promise((resolve, reject) => {
https.get(url, (res) => {
if (res.statusCode === 302 || res.statusCode === 301) {
if (res.headers.location) {
this.downloadFile(res.headers.location, destPath).then(resolve).catch(reject);
return;
}
}
const fileStream = fs.createWriteStream(destPath);
res.pipe(fileStream);
fileStream.on('finish', () => {
fileStream.close();
resolve();
});
fileStream.on('error', (err) => {
fs.unlink(destPath, () => {});
reject(err);
});
}).on('error', reject);
});
}
async downloadOpcodes(): Promise<number> {
console.log('Fetching opcode list from GitHub...');
const url = `${this.apiBase}/docs/opcodes?ref=${this.branch}`;
const files = await this.fetchJson<GitHubFile[]>(url);
const markdownFiles = files.filter(f => f.type === 'file' && f.name.endsWith('.md'));
console.log(`Found ${markdownFiles.length} markdown files`);
if (!fs.existsSync(this.downloadDir)) {
fs.mkdirSync(this.downloadDir, { recursive: true });
}
let downloaded = 0;
let failed = 0;
for (const file of markdownFiles) {
const destPath = path.join(this.downloadDir, file.name);
try {
await this.downloadFile(file.download_url, destPath);
downloaded++;
if (downloaded % 50 === 0) {
console.log(`Downloaded ${downloaded}/${markdownFiles.length}...`);
}
} catch (err) {
console.error(`Failed to download ${file.name}:`, err);
failed++;
}
}
console.log(`\nDownloaded ${downloaded} files, ${failed} failed`);
return downloaded;
}
async downloadCategories(): Promise<void> {
console.log('Downloading categories.py...');
const url = 'https://raw.githubusercontent.com/csound/manual/develop/categories.py';
const destPath = path.join(this.downloadDir, 'categories.py');
await this.downloadFile(url, destPath);
console.log('Categories file downloaded');
}
}

View File

@ -0,0 +1,207 @@
import * as fs from 'fs';
import * as path from 'path';
import type { CsoundReference } from './types';
export class TypeScriptGenerator {
private outputDir: string;
constructor(outputDir: string) {
this.outputDir = outputDir;
}
sanitizeCategoryName(category: string): string {
return category
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '');
}
sanitizeVariableName(category: string): string {
return category
.replace(/[^a-zA-Z0-9]+/g, ' ')
.split(' ')
.map((word, index) =>
index === 0
? word.toLowerCase()
: word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
)
.join('')
.replace(/^[0-9]/, '_$&');
}
escapeString(str: string): string {
return str
.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\t/g, '\\t');
}
generateReferenceObject(ref: CsoundReference, indent: string = ' '): string {
const lines: string[] = [];
lines.push(`{`);
lines.push(`${indent}name: '${this.escapeString(ref.name)}',`);
lines.push(`${indent}type: '${ref.type}',`);
lines.push(`${indent}category: '${this.escapeString(ref.category)}',`);
lines.push(`${indent}description: '${this.escapeString(ref.description)}',`);
if (ref.syntax) {
lines.push(`${indent}syntax: '${this.escapeString(ref.syntax)}',`);
}
if (ref.example) {
const escapedExample = this.escapeString(ref.example);
lines.push(`${indent}example: '${escapedExample}',`);
}
if (ref.rates && ref.rates.length > 0) {
lines.push(`${indent}rates: [${ref.rates.map(r => `'${r}'`).join(', ')}],`);
}
if (ref.parameters && ref.parameters.length > 0) {
lines.push(`${indent}parameters: [`);
for (const param of ref.parameters) {
lines.push(`${indent} {`);
lines.push(`${indent} name: '${this.escapeString(param.name)}',`);
lines.push(`${indent} description: '${this.escapeString(param.description)}',`);
lines.push(`${indent} type: '${param.type}'`);
lines.push(`${indent} },`);
}
lines.push(`${indent}],`);
}
if (ref.seeAlso && ref.seeAlso.length > 0) {
lines.push(`${indent}seeAlso: [${ref.seeAlso.map(s => `'${this.escapeString(s)}'`).join(', ')}]`);
}
lines.push(`}`);
return lines.join('\n');
}
generateCategoryFile(
category: string,
references: CsoundReference[],
fileName: string
): string {
const varName = this.sanitizeVariableName(category);
const lines: string[] = [];
lines.push(`import type { CsoundReference } from './types'`);
lines.push(``);
lines.push(`// ${category}`);
lines.push(`export const ${varName}: CsoundReference[] = [`);
for (const ref of references) {
const refLines = this.generateReferenceObject(ref, ' ');
lines.push(refLines + ',');
}
lines.push(`]`);
lines.push(``);
return lines.join('\n');
}
generateMainFile(categories: Map<string, CsoundReference[]>): string {
const lines: string[] = [];
lines.push(`import type { CsoundReference } from './types'`);
const imports: string[] = [];
const varNames: string[] = [];
for (const [category] of categories) {
const fileName = this.sanitizeCategoryName(category);
const varName = this.sanitizeVariableName(category);
imports.push(`import { ${varName} } from './${fileName}'`);
varNames.push(varName);
}
lines.push(...imports);
lines.push(``);
lines.push(`export type { CsoundReference }`);
lines.push(``);
lines.push(`export const allCsoundReferences: CsoundReference[] = [`);
for (const varName of varNames) {
lines.push(` ...${varName},`);
}
lines.push(`]`);
lines.push(``);
lines.push(`export const csoundReferenceMap = new Map<string, CsoundReference>()`);
lines.push(`allCsoundReferences.forEach(ref => {`);
lines.push(` csoundReferenceMap.set(ref.name, ref)`);
lines.push(`})`);
lines.push(``);
lines.push(`export function getCsoundReference(name: string): CsoundReference | undefined {`);
lines.push(` return csoundReferenceMap.get(name)`);
lines.push(`}`);
lines.push(``);
lines.push(`export function getCsoundReferencesByCategory(category: string): CsoundReference[] {`);
lines.push(` return allCsoundReferences.filter(ref => ref.category === category)`);
lines.push(`}`);
lines.push(``);
lines.push(`export {`);
for (const varName of varNames) {
lines.push(` ${varName},`);
}
lines.push(`}`);
lines.push(``);
return lines.join('\n');
}
writeCategoryFiles(categories: Map<string, CsoundReference[]>): void {
if (!fs.existsSync(this.outputDir)) {
fs.mkdirSync(this.outputDir, { recursive: true });
}
let fileCount = 0;
for (const [category, references] of categories) {
const fileName = this.sanitizeCategoryName(category);
const filePath = path.join(this.outputDir, `${fileName}.ts`);
const content = this.generateCategoryFile(category, references, fileName);
fs.writeFileSync(filePath, content, 'utf-8');
fileCount++;
console.log(`Generated: ${fileName}.ts (${references.length} opcodes)`);
}
console.log(`\nGenerated ${fileCount} category files`);
}
writeMainFile(categories: Map<string, CsoundReference[]>): void {
const filePath = path.join(this.outputDir, 'csoundReference.ts');
const content = this.generateMainFile(categories);
fs.writeFileSync(filePath, content, 'utf-8');
console.log(`Generated: csoundReference.ts`);
}
copyTypes(): void {
if (!fs.existsSync(this.outputDir)) {
fs.mkdirSync(this.outputDir, { recursive: true });
}
const sourceTypes = path.join(__dirname, 'types.ts');
const destTypes = path.join(this.outputDir, 'types.ts');
if (fs.existsSync(sourceTypes)) {
fs.copyFileSync(sourceTypes, destTypes);
console.log(`Copied: types.ts`);
}
}
generateAll(categories: Map<string, CsoundReference[]>): void {
console.log(`\nGenerating TypeScript files...`);
this.copyTypes();
this.writeCategoryFiles(categories);
this.writeMainFile(categories);
console.log(`\nDone!`);
}
}

View File

@ -0,0 +1,92 @@
#!/usr/bin/env node
import * as path from 'path';
import { CsoundManualParser } from './parser';
import { TypeScriptGenerator } from './generator';
import { GitHubDownloader } from './downloader';
const DOWNLOAD_DIR = path.join(__dirname, 'downloaded-opcodes');
const OUTPUT_DIR = path.join(__dirname, '../../src/lib/csound-reference');
async function main() {
const args = process.argv.slice(2);
const shouldDownload = args.includes('--download') || args.includes('-d');
const inputDir = args.find(arg => arg.startsWith('--input='))?.split('=')[1] || DOWNLOAD_DIR;
const outputDir = args.find(arg => arg.startsWith('--output='))?.split('=')[1] || OUTPUT_DIR;
console.log('='.repeat(60));
console.log('Csound Manual Parser');
console.log('='.repeat(60));
if (shouldDownload) {
console.log('\nStep 1: Downloading markdown files from GitHub...');
const downloader = new GitHubDownloader(DOWNLOAD_DIR);
try {
await downloader.downloadOpcodes();
await downloader.downloadCategories();
} catch (err) {
console.error('Download failed:', err);
console.log('\nYou can also manually clone the repository:');
console.log(' git clone https://github.com/csound/manual.git');
console.log(' Then run: npm run parse -- --input=manual/docs/opcodes');
process.exit(1);
}
} else {
console.log(`\nUsing existing files from: ${inputDir}`);
console.log('(Use --download or -d to download fresh files from GitHub)');
}
console.log('\nStep 2: Parsing markdown files...');
const parser = new CsoundManualParser();
try {
parser.parseDirectory(inputDir);
} catch (err) {
console.error('Parsing failed:', err);
console.log('\nMake sure the input directory exists and contains .md files');
console.log(`Input directory: ${inputDir}`);
process.exit(1);
}
const opcodeCount = parser.getOpcodes().length;
console.log(`\nParsed ${opcodeCount} opcodes`);
if (opcodeCount === 0) {
console.error('No opcodes found. Check the input directory.');
process.exit(1);
}
console.log('\nStep 3: Grouping by category...');
const categoriesMap = parser.getReferencesByCategory();
console.log(`Found ${categoriesMap.size} categories`);
const topCategories = Array.from(categoriesMap.entries())
.sort((a, b) => b[1].length - a[1].length)
.slice(0, 10);
console.log('\nTop 10 categories by opcode count:');
for (const [category, refs] of topCategories) {
console.log(` - ${category}: ${refs.length} opcodes`);
}
console.log('\nStep 4: Generating TypeScript files...');
const generator = new TypeScriptGenerator(outputDir);
generator.generateAll(categoriesMap);
console.log('\n' + '='.repeat(60));
console.log('Success!');
console.log('='.repeat(60));
console.log(`\nGenerated files in: ${outputDir}`);
console.log(`Total opcodes: ${opcodeCount}`);
console.log(`Total categories: ${categoriesMap.size}`);
console.log('\nYou can now import the reference in your application:');
console.log(` import { allCsoundReferences, getCsoundReference } from './lib/csound-reference/csoundReference'`);
}
if (require.main === module) {
main().catch(err => {
console.error('Fatal error:', err);
process.exit(1);
});
}

View File

@ -0,0 +1,26 @@
{
"name": "csound-manual-parser",
"version": "1.0.0",
"description": "Parser for Csound manual to generate TypeScript reference files",
"main": "index.ts",
"scripts": {
"parse": "tsx index.ts",
"download": "tsx index.ts --download",
"build": "tsc"
},
"keywords": [
"csound",
"parser",
"documentation"
],
"author": "",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.0.0",
"tsx": "^4.0.0",
"typescript": "^5.0.0"
},
"dependencies": {
"fuse.js": "^7.1.0"
}
}

View File

@ -0,0 +1,245 @@
import * as fs from 'fs';
import * as path from 'path';
import type { ParsedOpcode, CsoundReference } from './types';
interface FrontMatter {
id?: string;
category?: string;
}
export class CsoundManualParser {
private opcodes: Map<string, ParsedOpcode> = new Map();
parseFrontMatter(content: string): FrontMatter {
const frontMatterMatch = content.match(/^<!--\s*\n([\s\S]*?)\n-->/);
if (!frontMatterMatch) return {};
const frontMatter: FrontMatter = {};
const lines = frontMatterMatch[1].split('\n');
for (const line of lines) {
const [key, ...valueParts] = line.split(':');
if (key && valueParts.length > 0) {
const trimmedKey = key.trim();
const value = valueParts.join(':').trim();
if (trimmedKey === 'id') frontMatter.id = value;
if (trimmedKey === 'category') frontMatter.category = value;
}
}
return frontMatter;
}
extractFirstParagraph(content: string): string {
const withoutFrontMatter = content.replace(/^<!--[\s\S]*?-->\n/, '');
const withoutTitle = withoutFrontMatter.replace(/^#\s+.*\n/, '');
const lines = withoutTitle.split('\n');
const paragraphLines: string[] = [];
for (const line of lines) {
const trimmed = line.trim();
if (trimmed === '') {
if (paragraphLines.length > 0) break;
continue;
}
if (trimmed.startsWith('#')) break;
paragraphLines.push(trimmed);
}
return paragraphLines.join(' ').trim();
}
extractSection(content: string, sectionTitle: string): string {
const regex = new RegExp(`##\\s+${sectionTitle}\\s*\\n([\\s\\S]*?)(?=\\n##(?!#)|$)`, 'i');
const match = content.match(regex);
return match ? match[1].trim() : '';
}
extractSyntax(content: string): { modern?: string; classic?: string } {
const syntaxSection = this.extractSection(content, 'Syntax');
if (!syntaxSection) return {};
const modernMatch = syntaxSection.match(/===\s*"Modern"[\s\S]*?```[\s\S]*?\n([\s\S]*?)```/);
const classicMatch = syntaxSection.match(/===\s*"Classic"[\s\S]*?```[\s\S]*?\n([\s\S]*?)```/);
return {
modern: modernMatch ? modernMatch[1].trim() : undefined,
classic: classicMatch ? classicMatch[1].trim() : undefined,
};
}
extractParameters(content: string, subsectionTitle: string): { name: string; description: string }[] {
const syntaxSection = this.extractSection(content, 'Syntax');
const subsectionRegex = new RegExp(`###\\s+${subsectionTitle}\\s*\\n([\\s\\S]*?)(?=\\n###|\\n##|$)`, 'i');
const match = syntaxSection.match(subsectionRegex);
if (!match) return [];
const subsectionContent = match[1];
const params: { name: string; description: string }[] = [];
const paramMatches = subsectionContent.matchAll(/_([a-zA-Z0-9_,\s/]+)_\s*[-–—]+\s*([^\n]+(?:\n(?!_)[^\n]+)*)/g);
for (const paramMatch of paramMatches) {
const names = paramMatch[1]
.split(/[,/]/)
.map(n => n.trim().replace(/^_+|_+$/g, ''))
.filter(n => n.length > 0);
const description = paramMatch[2].trim().replace(/\s+/g, ' ');
for (const name of names) {
params.push({ name, description });
}
}
return params;
}
extractExample(content: string): string | undefined {
const exampleSection = this.extractSection(content, 'Examples');
if (!exampleSection) return undefined;
const codeMatch = exampleSection.match(/```[\s\S]*?\n([\s\S]*?)```/);
return codeMatch ? codeMatch[1].trim() : undefined;
}
extractSeeAlso(content: string): string[] {
const seeAlsoSection = this.extractSection(content, 'See also');
if (!seeAlsoSection) return [];
const links = seeAlsoSection.matchAll(/\[([^\]]+)\]/g);
return Array.from(links, match => match[1]);
}
parseMarkdownFile(filePath: string, content: string): ParsedOpcode | null {
try {
const frontMatter = this.parseFrontMatter(content);
if (!frontMatter.id || !frontMatter.category) {
console.warn(`Skipping ${filePath}: missing id or category`);
return null;
}
const description = this.extractFirstParagraph(content);
const syntax = this.extractSyntax(content);
const initParams = this.extractParameters(content, 'Initialization');
const perfParams = this.extractParameters(content, 'Performance');
const example = this.extractExample(content);
const seeAlso = this.extractSeeAlso(content);
return {
id: frontMatter.id,
category: frontMatter.category,
title: frontMatter.id,
description,
syntaxModern: syntax.modern,
syntaxClassic: syntax.classic,
initParams,
perfParams,
example,
seeAlso,
rawContent: content,
};
} catch (error) {
console.error(`Error parsing ${filePath}:`, error);
return null;
}
}
parseDirectory(dirPath: string): void {
if (!fs.existsSync(dirPath)) {
throw new Error(`Directory not found: ${dirPath}`);
}
const files = fs.readdirSync(dirPath);
let parsed = 0;
let skipped = 0;
for (const file of files) {
if (!file.endsWith('.md')) continue;
const filePath = path.join(dirPath, file);
const content = fs.readFileSync(filePath, 'utf-8');
const opcode = this.parseMarkdownFile(file, content);
if (opcode) {
this.opcodes.set(opcode.id, opcode);
parsed++;
} else {
skipped++;
}
}
console.log(`Parsed ${parsed} opcodes, skipped ${skipped}`);
}
convertToReference(opcode: ParsedOpcode): CsoundReference {
const syntax = opcode.syntaxModern || opcode.syntaxClassic;
const parameters = [
...opcode.initParams.map(p => ({ ...p, type: 'initialization' as const })),
...opcode.perfParams.map(p => ({ ...p, type: 'performance' as const })),
];
const rates = this.extractRates(syntax || '');
return {
name: opcode.id,
type: 'opcode',
category: opcode.category,
description: opcode.description,
syntax,
example: opcode.example,
rates,
parameters: parameters.length > 0 ? parameters : undefined,
seeAlso: opcode.seeAlso.length > 0 ? opcode.seeAlso : undefined,
};
}
private extractRates(syntax: string): string[] {
const rates: Set<string> = new Set();
if (/\bares\b|\basin\b|\basig\b/.test(syntax)) rates.add('a-rate');
if (/\bkres\b|\bkamp\b|\bkcps\b|\bkin\b/.test(syntax)) rates.add('k-rate');
if (/\bires\b|\bifn\b|\biphs\b/.test(syntax)) rates.add('i-rate');
return Array.from(rates);
}
getOpcodes(): ParsedOpcode[] {
return Array.from(this.opcodes.values());
}
getOpcodesByCategory(): Map<string, ParsedOpcode[]> {
const categories = new Map<string, ParsedOpcode[]>();
for (const opcode of this.opcodes.values()) {
const category = opcode.category;
if (!categories.has(category)) {
categories.set(category, []);
}
categories.get(category)!.push(opcode);
}
return categories;
}
getReferences(): CsoundReference[] {
return this.getOpcodes().map(op => this.convertToReference(op));
}
getReferencesByCategory(): Map<string, CsoundReference[]> {
const categories = new Map<string, CsoundReference[]>();
for (const opcode of this.opcodes.values()) {
const category = opcode.category;
if (!categories.has(category)) {
categories.set(category, []);
}
categories.get(category)!.push(this.convertToReference(opcode));
}
return categories;
}
}

352
scripts/csound-parser/pnpm-lock.yaml generated Normal file
View File

@ -0,0 +1,352 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
fuse.js:
specifier: ^7.1.0
version: 7.1.0
devDependencies:
'@types/node':
specifier: ^20.0.0
version: 20.19.21
tsx:
specifier: ^4.0.0
version: 4.20.6
typescript:
specifier: ^5.0.0
version: 5.9.3
packages:
'@esbuild/aix-ppc64@0.25.11':
resolution: {integrity: sha512-Xt1dOL13m8u0WE8iplx9Ibbm+hFAO0GsU2P34UNoDGvZYkY8ifSiy6Zuc1lYxfG7svWE2fzqCUmFp5HCn51gJg==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [aix]
'@esbuild/android-arm64@0.25.11':
resolution: {integrity: sha512-9slpyFBc4FPPz48+f6jyiXOx/Y4v34TUeDDXJpZqAWQn/08lKGeD8aDp9TMn9jDz2CiEuHwfhRmGBvpnd/PWIQ==}
engines: {node: '>=18'}
cpu: [arm64]
os: [android]
'@esbuild/android-arm@0.25.11':
resolution: {integrity: sha512-uoa7dU+Dt3HYsethkJ1k6Z9YdcHjTrSb5NUy66ZfZaSV8hEYGD5ZHbEMXnqLFlbBflLsl89Zke7CAdDJ4JI+Gg==}
engines: {node: '>=18'}
cpu: [arm]
os: [android]
'@esbuild/android-x64@0.25.11':
resolution: {integrity: sha512-Sgiab4xBjPU1QoPEIqS3Xx+R2lezu0LKIEcYe6pftr56PqPygbB7+szVnzoShbx64MUupqoE0KyRlN7gezbl8g==}
engines: {node: '>=18'}
cpu: [x64]
os: [android]
'@esbuild/darwin-arm64@0.25.11':
resolution: {integrity: sha512-VekY0PBCukppoQrycFxUqkCojnTQhdec0vevUL/EDOCnXd9LKWqD/bHwMPzigIJXPhC59Vd1WFIL57SKs2mg4w==}
engines: {node: '>=18'}
cpu: [arm64]
os: [darwin]
'@esbuild/darwin-x64@0.25.11':
resolution: {integrity: sha512-+hfp3yfBalNEpTGp9loYgbknjR695HkqtY3d3/JjSRUyPg/xd6q+mQqIb5qdywnDxRZykIHs3axEqU6l1+oWEQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [darwin]
'@esbuild/freebsd-arm64@0.25.11':
resolution: {integrity: sha512-CmKjrnayyTJF2eVuO//uSjl/K3KsMIeYeyN7FyDBjsR3lnSJHaXlVoAK8DZa7lXWChbuOk7NjAc7ygAwrnPBhA==}
engines: {node: '>=18'}
cpu: [arm64]
os: [freebsd]
'@esbuild/freebsd-x64@0.25.11':
resolution: {integrity: sha512-Dyq+5oscTJvMaYPvW3x3FLpi2+gSZTCE/1ffdwuM6G1ARang/mb3jvjxs0mw6n3Lsw84ocfo9CrNMqc5lTfGOw==}
engines: {node: '>=18'}
cpu: [x64]
os: [freebsd]
'@esbuild/linux-arm64@0.25.11':
resolution: {integrity: sha512-Qr8AzcplUhGvdyUF08A1kHU3Vr2O88xxP0Tm8GcdVOUm25XYcMPp2YqSVHbLuXzYQMf9Bh/iKx7YPqECs6ffLA==}
engines: {node: '>=18'}
cpu: [arm64]
os: [linux]
'@esbuild/linux-arm@0.25.11':
resolution: {integrity: sha512-TBMv6B4kCfrGJ8cUPo7vd6NECZH/8hPpBHHlYI3qzoYFvWu2AdTvZNuU/7hsbKWqu/COU7NIK12dHAAqBLLXgw==}
engines: {node: '>=18'}
cpu: [arm]
os: [linux]
'@esbuild/linux-ia32@0.25.11':
resolution: {integrity: sha512-TmnJg8BMGPehs5JKrCLqyWTVAvielc615jbkOirATQvWWB1NMXY77oLMzsUjRLa0+ngecEmDGqt5jiDC6bfvOw==}
engines: {node: '>=18'}
cpu: [ia32]
os: [linux]
'@esbuild/linux-loong64@0.25.11':
resolution: {integrity: sha512-DIGXL2+gvDaXlaq8xruNXUJdT5tF+SBbJQKbWy/0J7OhU8gOHOzKmGIlfTTl6nHaCOoipxQbuJi7O++ldrxgMw==}
engines: {node: '>=18'}
cpu: [loong64]
os: [linux]
'@esbuild/linux-mips64el@0.25.11':
resolution: {integrity: sha512-Osx1nALUJu4pU43o9OyjSCXokFkFbyzjXb6VhGIJZQ5JZi8ylCQ9/LFagolPsHtgw6himDSyb5ETSfmp4rpiKQ==}
engines: {node: '>=18'}
cpu: [mips64el]
os: [linux]
'@esbuild/linux-ppc64@0.25.11':
resolution: {integrity: sha512-nbLFgsQQEsBa8XSgSTSlrnBSrpoWh7ioFDUmwo158gIm5NNP+17IYmNWzaIzWmgCxq56vfr34xGkOcZ7jX6CPw==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [linux]
'@esbuild/linux-riscv64@0.25.11':
resolution: {integrity: sha512-HfyAmqZi9uBAbgKYP1yGuI7tSREXwIb438q0nqvlpxAOs3XnZ8RsisRfmVsgV486NdjD7Mw2UrFSw51lzUk1ww==}
engines: {node: '>=18'}
cpu: [riscv64]
os: [linux]
'@esbuild/linux-s390x@0.25.11':
resolution: {integrity: sha512-HjLqVgSSYnVXRisyfmzsH6mXqyvj0SA7pG5g+9W7ESgwA70AXYNpfKBqh1KbTxmQVaYxpzA/SvlB9oclGPbApw==}
engines: {node: '>=18'}
cpu: [s390x]
os: [linux]
'@esbuild/linux-x64@0.25.11':
resolution: {integrity: sha512-HSFAT4+WYjIhrHxKBwGmOOSpphjYkcswF449j6EjsjbinTZbp8PJtjsVK1XFJStdzXdy/jaddAep2FGY+wyFAQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [linux]
'@esbuild/netbsd-arm64@0.25.11':
resolution: {integrity: sha512-hr9Oxj1Fa4r04dNpWr3P8QKVVsjQhqrMSUzZzf+LZcYjZNqhA3IAfPQdEh1FLVUJSiu6sgAwp3OmwBfbFgG2Xg==}
engines: {node: '>=18'}
cpu: [arm64]
os: [netbsd]
'@esbuild/netbsd-x64@0.25.11':
resolution: {integrity: sha512-u7tKA+qbzBydyj0vgpu+5h5AeudxOAGncb8N6C9Kh1N4n7wU1Xw1JDApsRjpShRpXRQlJLb9wY28ELpwdPcZ7A==}
engines: {node: '>=18'}
cpu: [x64]
os: [netbsd]
'@esbuild/openbsd-arm64@0.25.11':
resolution: {integrity: sha512-Qq6YHhayieor3DxFOoYM1q0q1uMFYb7cSpLD2qzDSvK1NAvqFi8Xgivv0cFC6J+hWVw2teCYltyy9/m/14ryHg==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openbsd]
'@esbuild/openbsd-x64@0.25.11':
resolution: {integrity: sha512-CN+7c++kkbrckTOz5hrehxWN7uIhFFlmS/hqziSFVWpAzpWrQoAG4chH+nN3Be+Kzv/uuo7zhX716x3Sn2Jduw==}
engines: {node: '>=18'}
cpu: [x64]
os: [openbsd]
'@esbuild/openharmony-arm64@0.25.11':
resolution: {integrity: sha512-rOREuNIQgaiR+9QuNkbkxubbp8MSO9rONmwP5nKncnWJ9v5jQ4JxFnLu4zDSRPf3x4u+2VN4pM4RdyIzDty/wQ==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openharmony]
'@esbuild/sunos-x64@0.25.11':
resolution: {integrity: sha512-nq2xdYaWxyg9DcIyXkZhcYulC6pQ2FuCgem3LI92IwMgIZ69KHeY8T4Y88pcwoLIjbed8n36CyKoYRDygNSGhA==}
engines: {node: '>=18'}
cpu: [x64]
os: [sunos]
'@esbuild/win32-arm64@0.25.11':
resolution: {integrity: sha512-3XxECOWJq1qMZ3MN8srCJ/QfoLpL+VaxD/WfNRm1O3B4+AZ/BnLVgFbUV3eiRYDMXetciH16dwPbbHqwe1uU0Q==}
engines: {node: '>=18'}
cpu: [arm64]
os: [win32]
'@esbuild/win32-ia32@0.25.11':
resolution: {integrity: sha512-3ukss6gb9XZ8TlRyJlgLn17ecsK4NSQTmdIXRASVsiS2sQ6zPPZklNJT5GR5tE/MUarymmy8kCEf5xPCNCqVOA==}
engines: {node: '>=18'}
cpu: [ia32]
os: [win32]
'@esbuild/win32-x64@0.25.11':
resolution: {integrity: sha512-D7Hpz6A2L4hzsRpPaCYkQnGOotdUpDzSGRIv9I+1ITdHROSFUWW95ZPZWQmGka1Fg7W3zFJowyn9WGwMJ0+KPA==}
engines: {node: '>=18'}
cpu: [x64]
os: [win32]
'@types/node@20.19.21':
resolution: {integrity: sha512-CsGG2P3I5y48RPMfprQGfy4JPRZ6csfC3ltBZSRItG3ngggmNY/qs2uZKp4p9VbrpqNNSMzUZNFZKzgOGnd/VA==}
esbuild@0.25.11:
resolution: {integrity: sha512-KohQwyzrKTQmhXDW1PjCv3Tyspn9n5GcY2RTDqeORIdIJY8yKIF7sTSopFmn/wpMPW4rdPXI0UE5LJLuq3bx0Q==}
engines: {node: '>=18'}
hasBin: true
fsevents@2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
fuse.js@7.1.0:
resolution: {integrity: sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==}
engines: {node: '>=10'}
get-tsconfig@4.12.0:
resolution: {integrity: sha512-LScr2aNr2FbjAjZh2C6X6BxRx1/x+aTDExct/xyq2XKbYOiG5c0aK7pMsSuyc0brz3ibr/lbQiHD9jzt4lccJw==}
resolve-pkg-maps@1.0.0:
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
tsx@4.20.6:
resolution: {integrity: sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==}
engines: {node: '>=18.0.0'}
hasBin: true
typescript@5.9.3:
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
engines: {node: '>=14.17'}
hasBin: true
undici-types@6.21.0:
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
snapshots:
'@esbuild/aix-ppc64@0.25.11':
optional: true
'@esbuild/android-arm64@0.25.11':
optional: true
'@esbuild/android-arm@0.25.11':
optional: true
'@esbuild/android-x64@0.25.11':
optional: true
'@esbuild/darwin-arm64@0.25.11':
optional: true
'@esbuild/darwin-x64@0.25.11':
optional: true
'@esbuild/freebsd-arm64@0.25.11':
optional: true
'@esbuild/freebsd-x64@0.25.11':
optional: true
'@esbuild/linux-arm64@0.25.11':
optional: true
'@esbuild/linux-arm@0.25.11':
optional: true
'@esbuild/linux-ia32@0.25.11':
optional: true
'@esbuild/linux-loong64@0.25.11':
optional: true
'@esbuild/linux-mips64el@0.25.11':
optional: true
'@esbuild/linux-ppc64@0.25.11':
optional: true
'@esbuild/linux-riscv64@0.25.11':
optional: true
'@esbuild/linux-s390x@0.25.11':
optional: true
'@esbuild/linux-x64@0.25.11':
optional: true
'@esbuild/netbsd-arm64@0.25.11':
optional: true
'@esbuild/netbsd-x64@0.25.11':
optional: true
'@esbuild/openbsd-arm64@0.25.11':
optional: true
'@esbuild/openbsd-x64@0.25.11':
optional: true
'@esbuild/openharmony-arm64@0.25.11':
optional: true
'@esbuild/sunos-x64@0.25.11':
optional: true
'@esbuild/win32-arm64@0.25.11':
optional: true
'@esbuild/win32-ia32@0.25.11':
optional: true
'@esbuild/win32-x64@0.25.11':
optional: true
'@types/node@20.19.21':
dependencies:
undici-types: 6.21.0
esbuild@0.25.11:
optionalDependencies:
'@esbuild/aix-ppc64': 0.25.11
'@esbuild/android-arm': 0.25.11
'@esbuild/android-arm64': 0.25.11
'@esbuild/android-x64': 0.25.11
'@esbuild/darwin-arm64': 0.25.11
'@esbuild/darwin-x64': 0.25.11
'@esbuild/freebsd-arm64': 0.25.11
'@esbuild/freebsd-x64': 0.25.11
'@esbuild/linux-arm': 0.25.11
'@esbuild/linux-arm64': 0.25.11
'@esbuild/linux-ia32': 0.25.11
'@esbuild/linux-loong64': 0.25.11
'@esbuild/linux-mips64el': 0.25.11
'@esbuild/linux-ppc64': 0.25.11
'@esbuild/linux-riscv64': 0.25.11
'@esbuild/linux-s390x': 0.25.11
'@esbuild/linux-x64': 0.25.11
'@esbuild/netbsd-arm64': 0.25.11
'@esbuild/netbsd-x64': 0.25.11
'@esbuild/openbsd-arm64': 0.25.11
'@esbuild/openbsd-x64': 0.25.11
'@esbuild/openharmony-arm64': 0.25.11
'@esbuild/sunos-x64': 0.25.11
'@esbuild/win32-arm64': 0.25.11
'@esbuild/win32-ia32': 0.25.11
'@esbuild/win32-x64': 0.25.11
fsevents@2.3.3:
optional: true
fuse.js@7.1.0: {}
get-tsconfig@4.12.0:
dependencies:
resolve-pkg-maps: 1.0.0
resolve-pkg-maps@1.0.0: {}
tsx@4.20.6:
dependencies:
esbuild: 0.25.11
get-tsconfig: 4.12.0
optionalDependencies:
fsevents: 2.3.3
typescript@5.9.3: {}
undici-types@6.21.0: {}

View File

@ -0,0 +1,71 @@
import {
allCsoundReferences,
getCsoundReference,
getCsoundReferencesByCategory
} from '../../src/lib/csound-reference/csoundReference';
console.log('='.repeat(60));
console.log('Csound Reference Output Test');
console.log('='.repeat(60));
console.log(`\nTotal opcodes: ${allCsoundReferences.length}`);
console.log('\n--- Testing getCsoundReference() ---');
const oscil = getCsoundReference('oscil');
if (oscil) {
console.log(`\nFound oscil:`);
console.log(` Name: ${oscil.name}`);
console.log(` Category: ${oscil.category}`);
console.log(` Description: ${oscil.description.substring(0, 80)}...`);
console.log(` Syntax: ${oscil.syntax?.substring(0, 80)}...`);
console.log(` Rates: ${oscil.rates?.join(', ')}`);
console.log(` Parameters: ${oscil.parameters?.length || 0}`);
}
const moogladder = getCsoundReference('moogladder');
if (moogladder) {
console.log(`\nFound moogladder:`);
console.log(` Name: ${moogladder.name}`);
console.log(` Category: ${moogladder.category}`);
console.log(` Description: ${moogladder.description}`);
console.log(` Syntax: ${moogladder.syntax?.substring(0, 100)}...`);
console.log(` Rates: ${moogladder.rates?.join(', ')}`);
console.log(` Parameters: ${moogladder.parameters?.length || 0}`);
if (moogladder.parameters) {
console.log(` Parameters detail:`);
moogladder.parameters.forEach(p => {
console.log(` - ${p.name} (${p.type}): ${p.description.substring(0, 60)}...`);
});
}
}
console.log('\n--- Testing getCsoundReferencesByCategory() ---');
const oscillators = getCsoundReferencesByCategory('Signal Generators:Basic Oscillators');
console.log(`\nBasic Oscillators (${oscillators.length} opcodes):`);
oscillators.slice(0, 5).forEach(op => {
console.log(` - ${op.name}: ${op.description.substring(0, 60)}...`);
});
console.log('\n--- Sample categories ---');
const categories = new Set(allCsoundReferences.map(ref => ref.category));
const categoryArray = Array.from(categories).sort();
console.log(`\nTotal categories: ${categories.size}`);
console.log('First 10 categories:');
categoryArray.slice(0, 10).forEach(cat => {
const count = allCsoundReferences.filter(r => r.category === cat).length;
console.log(` - ${cat} (${count} opcodes)`);
});
console.log('\n--- Checking for opcodes with parameters ---');
const opcodesWithParams = allCsoundReferences.filter(ref => ref.parameters && ref.parameters.length > 0);
console.log(`\nOpcodes with parameters: ${opcodesWithParams.length} out of ${allCsoundReferences.length}`);
if (opcodesWithParams.length > 0) {
console.log('\nFirst 5 opcodes with parameters:');
opcodesWithParams.slice(0, 5).forEach(op => {
console.log(` - ${op.name}: ${op.parameters?.length} parameters`);
});
}
console.log('\n' + '='.repeat(60));
console.log('Test Complete!');
console.log('='.repeat(60));

View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"lib": ["ES2020"],
"outDir": "./dist",
"rootDir": "./",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"types": ["node"]
},
"include": ["*.ts"],
"exclude": ["node_modules", "dist"]
}

View File

@ -0,0 +1,35 @@
export interface CsoundReference {
name: string
type: 'opcode' | 'keyword' | 'header' | 'constant'
category: string
description: string
syntax?: string
example?: string
rates?: string[]
parameters?: {
name: string
description: string
type: 'initialization' | 'performance'
}[]
seeAlso?: string[]
}
export interface ParsedOpcode {
id: string
category: string
title: string
description: string
syntaxModern?: string
syntaxClassic?: string
initParams: { name: string; description: string }[]
perfParams: { name: string; description: string }[]
example?: string
seeAlso: string[]
rawContent: string
}
export interface CategoryGroup {
categoryKey: string
categoryName: string
opcodes: CsoundReference[]
}

View File

@ -11,6 +11,7 @@
import ConfirmDialog from "./lib/components/ui/ConfirmDialog.svelte";
import InputDialog from "./lib/components/ui/InputDialog.svelte";
import TemplateDialog from "./lib/components/ui/TemplateDialog.svelte";
import CsoundReference from "./lib/components/reference/CsoundReference.svelte";
import {
createCsoundDerivedStores,
type LogEntry,
@ -276,6 +277,11 @@
label: "Files",
content: filesTabContent,
},
{
id: "reference",
label: "Reference",
content: referenceTabContent,
},
];
</script>
@ -294,6 +300,10 @@
/>
{/snippet}
{#snippet referenceTabContent()}
<CsoundReference />
{/snippet}
<div class="app-container">
<TopBar title="OldBoy">
{#snippet leftActions()}

View File

@ -19,6 +19,7 @@
getBlock,
getDocument
} from '../../editor/block-eval';
import { csoundTooltip, csoundTooltipTheme } from '../../csound-reference/csoundTooltips';
interface Props {
value: string;
@ -99,6 +100,8 @@
rectangularSelection(),
crosshairCursor(),
highlightSelectionMatches(),
csoundTooltip,
csoundTooltipTheme,
keymap.of([
...closeBracketsKeymap,
...defaultKeymap,

View File

@ -0,0 +1,373 @@
<script lang="ts">
import { Search, ChevronDown, ChevronRight } from 'lucide-svelte';
import { allCsoundReferences, getCsoundReferencesByCategory } from '../../csound-reference/csoundReference';
import type { CsoundReference } from '../../csound-reference/types';
import Fuse from 'fuse.js';
let searchTerm = $state('');
let expandedCategories = $state(new Set<string>());
const fuse = new Fuse(allCsoundReferences, {
keys: [
{ name: 'name', weight: 0.7 },
{ name: 'description', weight: 0.2 },
{ name: 'category', weight: 0.1 }
],
threshold: 0.4,
includeScore: true
});
const allCategories = $derived(() => {
const cats = new Set(allCsoundReferences.map(ref => ref.category));
return Array.from(cats).sort();
});
const filteredCategories = $derived(() => {
if (!searchTerm.trim()) {
return allCategories();
}
const results = fuse.search(searchTerm);
const matchedRefs = results.map(r => r.item);
const matchedCats = new Set(matchedRefs.map(ref => ref.category));
return allCategories().filter(cat => matchedCats.has(cat));
});
function getFilteredReferences(category: string): CsoundReference[] {
const catRefs = getCsoundReferencesByCategory(category);
if (!searchTerm.trim()) {
return catRefs;
}
const results = fuse.search(searchTerm);
const matchedRefs = results.map(r => r.item);
return catRefs.filter(ref => matchedRefs.includes(ref));
}
function toggleCategory(category: string) {
const newSet = new Set(expandedCategories);
if (newSet.has(category)) {
newSet.delete(category);
} else {
newSet.add(category);
}
expandedCategories = newSet;
}
$effect(() => {
if (searchTerm.trim() && filteredCategories().length > 0 && filteredCategories().length <= 3) {
expandedCategories = new Set(filteredCategories());
} else if (!searchTerm.trim()) {
expandedCategories = new Set();
}
});
</script>
<div class="csound-reference">
<div class="search-bar">
<Search size={16} class="search-icon" />
<input
type="text"
placeholder="Search opcodes..."
bind:value={searchTerm}
class="search-input"
/>
</div>
<div class="reference-content">
{#each filteredCategories() as category}
{@const references = getFilteredReferences(category)}
{#if references.length > 0}
<div class="category">
<button
class="category-header"
onclick={() => toggleCategory(category)}
>
{#if expandedCategories.has(category)}
<ChevronDown size={14} />
{:else}
<ChevronRight size={14} />
{/if}
<span class="category-title">{category}</span>
<span class="category-count">{references.length}</span>
</button>
{#if expandedCategories.has(category)}
<div class="opcodes">
{#each references as opcode}
<div class="opcode">
<div class="opcode-header">
<span class="opcode-name">{opcode.name}</span>
<span class="opcode-type">{opcode.type}</span>
</div>
<p class="opcode-description">{opcode.description}</p>
{#if opcode.syntax}
<pre class="opcode-syntax">{opcode.syntax}</pre>
{/if}
{#if opcode.rates && opcode.rates.length > 0}
<div class="opcode-rates">
Rates: {opcode.rates.join(', ')}
</div>
{/if}
{#if opcode.parameters && opcode.parameters.length > 0}
<div class="opcode-params">
<div class="params-label">
Parameters ({opcode.parameters.length}):
</div>
{#each opcode.parameters.slice(0, 5) as param}
<div class="param">
<span class="param-name">{param.name}</span>
<span class="param-type">({param.type})</span>
<span class="param-desc">
{param.description.length > 80
? param.description.substring(0, 80) + '...'
: param.description}
</span>
</div>
{/each}
{#if opcode.parameters.length > 5}
<div class="param-more">
... and {opcode.parameters.length - 5} more
</div>
{/if}
</div>
{/if}
</div>
{/each}
</div>
{/if}
</div>
{/if}
{/each}
{#if searchTerm.trim() && filteredCategories().length === 0}
<div class="empty-state">
<Search size={48} />
<h3>No Results Found</h3>
<p>Try adjusting your search terms</p>
</div>
{/if}
</div>
</div>
<style>
.csound-reference {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.search-bar {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.75rem;
background-color: #252525;
border-bottom: 1px solid #3a3a3a;
}
.search-bar :global(.search-icon) {
color: rgba(255, 255, 255, 0.4);
flex-shrink: 0;
}
.search-input {
flex: 1;
background-color: #1a1a1a;
color: rgba(255, 255, 255, 0.87);
border: 1px solid #3a3a3a;
padding: 0.5rem;
font-size: 0.875rem;
font-family: 'Courier New', monospace;
outline: none;
transition: border-color 0.2s;
}
.search-input:focus {
border-color: #646cff;
}
.search-input::placeholder {
color: rgba(255, 255, 255, 0.3);
}
.reference-content {
flex: 1;
overflow-y: auto;
padding: 0.5rem;
}
.category {
margin-bottom: 0.75rem;
}
.category-header {
display: flex;
align-items: center;
gap: 0.5rem;
width: 100%;
padding: 0.5rem;
background-color: #2a2a2a;
border: none;
color: rgba(255, 255, 255, 0.87);
cursor: pointer;
transition: background-color 0.2s;
font-size: 0.875rem;
}
.category-header:hover {
background-color: #323232;
}
.category-header :global(svg) {
color: rgba(255, 255, 255, 0.6);
flex-shrink: 0;
}
.category-title {
flex: 1;
text-align: left;
font-weight: 500;
}
.category-count {
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.5);
background-color: #646cff;
padding: 0.125rem 0.5rem;
}
.opcodes {
padding-left: 1.5rem;
margin-top: 0.5rem;
}
.opcode {
background-color: #1a1a1a;
padding: 0.75rem;
margin-bottom: 0.5rem;
border-left: 2px solid #646cff;
}
.opcode-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
}
.opcode-name {
font-family: 'Courier New', monospace;
font-size: 0.875rem;
font-weight: 600;
color: #646cff;
}
.opcode-type {
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.5);
text-transform: uppercase;
}
.opcode-description {
color: rgba(255, 255, 255, 0.87);
font-size: 0.8125rem;
line-height: 1.5;
margin: 0 0 0.5rem 0;
}
.opcode-syntax {
background-color: #000;
color: #fbbf24;
padding: 0.5rem;
font-size: 0.75rem;
font-family: 'Courier New', monospace;
margin: 0 0 0.5rem 0;
overflow-x: auto;
white-space: pre-wrap;
word-break: break-all;
border: 1px solid #2a2a2a;
}
.opcode-rates {
font-size: 0.75rem;
color: #60a5fa;
margin-bottom: 0.5rem;
}
.opcode-params {
margin-top: 0.5rem;
}
.params-label {
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.6);
margin-bottom: 0.375rem;
text-transform: uppercase;
font-weight: 500;
}
.param {
display: flex;
gap: 0.375rem;
font-size: 0.75rem;
line-height: 1.4;
margin-bottom: 0.25rem;
}
.param-name {
color: #10b981;
font-family: 'Courier New', monospace;
font-weight: 500;
min-width: 4rem;
}
.param-type {
color: rgba(255, 255, 255, 0.4);
font-size: 0.6875rem;
}
.param-desc {
color: rgba(255, 255, 255, 0.7);
flex: 1;
}
.param-more {
font-size: 0.6875rem;
color: rgba(255, 255, 255, 0.5);
font-style: italic;
margin-top: 0.25rem;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 3rem 1rem;
text-align: center;
color: rgba(255, 255, 255, 0.5);
}
.empty-state :global(svg) {
margin-bottom: 1rem;
opacity: 0.3;
}
.empty-state h3 {
font-size: 1rem;
font-weight: 500;
margin: 0 0 0.5rem 0;
color: rgba(255, 255, 255, 0.6);
}
.empty-state p {
font-size: 0.875rem;
margin: 0;
color: rgba(255, 255, 255, 0.4);
}
</style>

View File

@ -0,0 +1,381 @@
import type { CsoundReference } from './types'
// Array Opcodes
export const arrayOpcodes: CsoundReference[] = [
{
name: 'array',
type: 'opcode',
category: 'Array Opcodes',
description: 'Converts an input into an array, optionally creating it.',
example: '--8<-- "examples/array.csd"',
seeAlso: ['array opcodes']
},
{
name: 'copya2ftab',
type: 'opcode',
category: 'Array Opcodes',
description: 'The _copya2ftab_ opcode takes a k-array and copies the contents to an f-table.',
syntax: 'copya2ftab(kArray[], ktab [, koffset])\n copya2ftab(iArray[], itab [, ioffset])',
example: '--8<-- "examples/copya2ftab-modern.csd"',
parameters: [
{
name: 'ktab',
description: 'f-table for destination.',
type: 'performance'
},
{
name: 'koffset',
description: 'offset into the f-table (defaults to 0).',
type: 'performance'
},
],
seeAlso: ['Array opcodes']
},
{
name: 'copyf2array',
type: 'opcode',
category: 'Array Opcodes',
description: 'The _copyf2array_ opcode takes an f-table and copies the contents to a t-var.',
syntax: 'copyf2array(tab, kftbl)',
example: '--8<-- "examples/copyf2array-modern.csd"',
parameters: [
{
name: 'tab',
description: 'tables for destination.',
type: 'performance'
},
{
name: 'kftbl',
description: 'f-tables for source.',
type: 'performance'
},
],
seeAlso: ['Array opcodes']
},
{
name: 'deinterleave',
type: 'opcode',
category: 'Array Opcodes',
description: 'Deinterleaves arrays by picking alternate data from its input.',
syntax: 'kout1[], kout2[] = deinterleave(kin[])',
example: '--8<-- "examples/deinterleave.csd"',
rates: ['k-rate'],
seeAlso: ['Array opcodes']
},
{
name: 'fillarray',
type: 'opcode',
category: 'Array Opcodes',
description: 'Generate a vector (one-dimensional k-rate array) with a sequence of numeric or string values.',
syntax: 'karray[] = fillarray(ival1, ival2,.....ivaln)\n karray = fillarray(ival1, ival2,.....ivaln)\n karray = fillarray(kval1, kval2,.....kvaln)',
example: '--8<-- "examples/fillarray.csd"',
seeAlso: ['Array opcodes']
},
{
name: 'genarray',
type: 'opcode',
category: 'Array Opcodes',
description: 'Generate a vector (one-dimensional k-rate or i-rate array) with an arithmetic sequence.',
syntax: 'karray = genarray(kstart, kens [, inc])\n iarray = genarray(istart, iens [, inc])',
example: '--8<-- "examples/genarray.csd"',
parameters: [
{
name: 'istart',
description: 'value to place in first element.',
type: 'initialization'
},
{
name: 'iend',
description: 'last value to place in array.',
type: 'initialization'
},
{
name: 'inc',
description: 'amount to add to previous value (default 1).',
type: 'initialization'
},
],
seeAlso: ['Array opcodes']
},
{
name: 'getcol',
type: 'opcode',
category: 'Array Opcodes',
description: 'Gets a given column from a 2-dimensional array as a vector.',
syntax: 'i/kout[] = getcol(i/kin[], i/kcol)',
example: '--8<-- "examples/getcol.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'icol',
description: 'column to be extracted.',
type: 'initialization'
},
{
name: 'kcol',
description: 'column to be extracted.',
type: 'performance'
},
],
seeAlso: ['Vectorial Opcodes', 'Array Opcodes']
},
{
name: 'getrow',
type: 'opcode',
category: 'Array Opcodes',
description: 'Gets a given row from a 2-dimensional array as a vector.',
syntax: 'i/kout[] = getrow(i/kin[], i/krow)',
example: '--8<-- "examples/rfft.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'irow',
description: 'row to be extracted.',
type: 'initialization'
},
{
name: 'krow',
description: 'row to be extracted.',
type: 'performance'
},
],
seeAlso: ['Vectorial Opcodes', 'Array Opcodes']
},
{
name: 'interleave',
type: 'opcode',
category: 'Array Opcodes',
description: 'Interleaves arrays into a a single one by placing the input data in alternate positions.',
syntax: 'kout[] = interleave(kin1[], kin2[])',
example: '--8<-- "examples/interleave.csd"',
seeAlso: ['Array opcodes']
},
{
name: 'maxarray',
type: 'opcode',
category: 'Array Opcodes',
description: 'Returns the maximum value in a k-rate array, and optional its index.',
syntax: 'kmax [,kindx] = maxarray(karray)',
example: '--8<-- "examples/maxarray.csd"',
parameters: [
{
name: 'kmax',
description: 'variable for result.',
type: 'performance'
},
{
name: 'kindx',
description: 'position (index) of result in array.',
type: 'performance'
},
{
name: 'karray',
description: 'array for reading.',
type: 'performance'
},
],
seeAlso: ['Array opcodes']
},
{
name: 'minarray',
type: 'opcode',
category: 'Array Opcodes',
description: 'Returns the minimum value in a k-rate array, and optional its index.',
syntax: 'kmin [,kindx] = minarray(karray)',
example: '--8<-- "examples/minarray.csd"',
parameters: [
{
name: 'kmin',
description: 'variable for result.',
type: 'performance'
},
{
name: 'kindx',
description: 'position (index) of result in array.',
type: 'performance'
},
{
name: 'karray',
description: 'array for reading.',
type: 'performance'
},
],
seeAlso: ['Array opcodes']
},
{
name: 'printarray',
type: 'opcode',
category: 'Array Opcodes',
description: 'Print the contents of an array.',
syntax: 'printarray(ixs[] [, Smft, Slabel ])\n printarray(kxs[] [, ktrig, Sfmt, Slabel ])',
example: '--8<-- "examples/printarray.csd"',
parameters: [
{
name: 'Sfmt',
description: 'If given, it is passed to printf for each element of the array. Otherwise a default format is used',
type: 'initialization'
},
{
name: 'Slabel',
description: 'If given, it is printed before the contents of the array, to easily identify the data',
type: 'initialization'
},
{
name: 'ktrig',
description: 'The array will be printed whenever this value changes from 0 to possitive. Can be used together with metro to print at a given time interval. A value of -1 indicates to print at each k-cycle (default = 1)',
type: 'performance'
},
],
seeAlso: ['Printing and Display', 'Array opcodes']
},
{
name: 'productarray',
type: 'opcode',
category: 'Array Opcodes',
description: 'Calculates the product of an array.',
syntax: 'kres/ires = product(karr[]/iarr[]) (k- or i-arrays )',
example: '--8<-- "examples/productarray.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
{
name: 'reshapearray',
type: 'opcode',
category: 'Array Opcodes',
description: 'Reshape an array, maintaining its capacity.',
syntax: 'reshapearray(array[], isize0 [, isize1 ])',
example: '--8<-- "examples/reshapearray.csd"',
parameters: [
{
name: 'isize0',
description: 'The size of the first dimension',
type: 'initialization'
},
{
name: 'isize1',
description: 'The size of the second dimension (0 for 1D arrays). _Defaults to 0_',
type: 'initialization'
},
],
seeAlso: ['Array opcodes']
},
{
name: 'scalearray',
type: 'opcode',
category: 'Array Opcodes',
description: 'The _scalearray_ opcode scales a subregion of a vector to a given minimum/maximum.',
syntax: 'scalearray(tarray, kmin, kmax[, kleft, kright])',
example: '--8<-- "examples/scalearray.csd"',
parameters: [
{
name: 'karray',
description: 'array for operation.',
type: 'performance'
},
{
name: 'kmin',
description: 'target minimum and maximum values.',
type: 'performance'
},
{
name: 'kmax',
description: 'target minimum and maximum values.',
type: 'performance'
},
{
name: 'kleft',
description: 'range of table to use, defaulting to 0 and size of the vector.',
type: 'performance'
},
{
name: 'kright',
description: 'range of table to use, defaulting to 0 and size of the vector.',
type: 'performance'
},
],
seeAlso: ['Array opcodes']
},
{
name: 'setcol',
type: 'opcode',
category: 'Array Opcodes',
description: 'Sets a given column of a 2-dimensional array from a vector.',
syntax: 'i/kout[] = setcol(i/kin[], i/kcol)',
example: '--8<-- "examples/setcol.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'icol',
description: 'column to be extracted.',
type: 'initialization'
},
{
name: 'kcol',
description: 'column to be set.',
type: 'performance'
},
],
seeAlso: ['Vectorial Opcodes', 'Array Opcodes']
},
{
name: 'setrow',
type: 'opcode',
category: 'Array Opcodes',
description: 'Sets a given row of a 2-dimensional array from a vector.',
syntax: 'i/kout[] = setrow(i/kin[], i/krow)',
example: '--8<-- "examples/rfft.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'irow',
description: 'row to be set.',
type: 'initialization'
},
{
name: 'krow',
description: 'row to be set.',
type: 'performance'
},
],
seeAlso: ['Vectorial Opcodes', 'Array Opcodes']
},
{
name: 'shiftin',
type: 'opcode',
category: 'Array Opcodes',
description: 'Shifts the contents of an audio variable into a 1-dimensional array.',
syntax: 'kout[] = shiftin(asig)',
example: '--8<-- "examples/shiftin.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'asig',
description: 'input audio',
type: 'performance'
},
],
seeAlso: ['Vectorial opcodes', 'array opcodes']
},
{
name: 'shiftout',
type: 'opcode',
category: 'Array Opcodes',
description: 'Shifts the contents of a 1-dimensional array into an audio variable.',
syntax: 'asig = shiftout(kIn[] [, ioff])',
example: '--8<-- "examples/shiftout.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ioff',
description: 'initial read offset position (optional, defaults to 0).',
type: 'initialization'
},
{
name: 'asig',
description: 'output audio',
type: 'performance'
},
],
seeAlso: ['Vectorial opcodes', 'array opcodes']
},
]

View File

@ -0,0 +1,15 @@
import type { CsoundReference } from './types'
// Array Operations: Autocorrelation
export const arrayOperationsAutocorrelation: CsoundReference[] = [
{
name: 'autocorr',
type: 'opcode',
category: 'Array Operations: Autocorrelation',
description: 'This opcode takes in an input array and computes its autocorrelation.',
syntax: 'kout[] = autocorr(kin[])',
example: '--8<-- "examples/autocorr-modern.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes']
},
]

View File

@ -0,0 +1,37 @@
import type { CsoundReference } from './types'
// Array Operations: Cepstrum
export const arrayOperationsCepstrum: CsoundReference[] = [
{
name: 'ceps',
type: 'opcode',
category: 'Array Operations: Cepstrum',
description: 'Calculate the cepstrum of an array input, optionally filtering coefficients.',
syntax: 'keps[] = ceps(kmags[] [, icoefs])',
example: '--8<-- "examples/ceps-modern.csd"',
parameters: [
{
name: 'icoefs',
description: 'the number of retained coefficients in the cepstrum output. By default, no coefficients are filtered.',
type: 'initialization'
},
],
seeAlso: ['Array-based spectral opcodes']
},
{
name: 'cepsinv',
type: 'opcode',
category: 'Array Operations: Cepstrum',
description: 'Calculate the inverse cepstrum of an array.',
syntax: 'kenv = cepsinv(keps[])',
example: '--8<-- "examples/cepsinv-modern.csd"',
parameters: [
{
name: 'kenv',
description: 'the inverse cepstrum (spectral envelope), an array of N+1 magnitudes.',
type: 'performance'
},
],
seeAlso: ['Array-based spectral opcodes']
},
]

View File

@ -0,0 +1,74 @@
import type { CsoundReference } from './types'
// Array Operations: complex numbers
export const arrayOperationsComplexNumbers: CsoundReference[] = [
{
name: 'c2r',
type: 'opcode',
category: 'Array Operations: complex numbers',
description: 'Real to complex format conversion.',
syntax: 'kout[] = c2r(kin[])',
example: '--8<-- "examples/c2r-modern.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
{
name: 'cmplxprod',
type: 'opcode',
category: 'Array Operations: complex numbers',
description: 'Complex product of two arrays of the same size and in real-imaginary interleaved format.',
syntax: 'kout[] = cmplxprod(kin1[], kin2[])',
example: '--8<-- "examples/cmplxprod.csd"',
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
{
name: 'mags',
type: 'opcode',
category: 'Array Operations: complex numbers',
description: 'Obtains the magnitudes of a complex-number array.',
syntax: 'kout[] = mags(kin[])',
example: '--8<-- "examples/mags.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
{
name: 'phs',
type: 'opcode',
category: 'Array Operations: complex numbers',
description: 'Obtains the phases of a complex-number array.',
syntax: 'kout[] = phs(kin[])',
example: '--8<-- "examples/phs.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
{
name: 'pol2rect',
type: 'opcode',
category: 'Array Operations: complex numbers',
description: 'Converts an input array in magnitude-phase format to real-imaginary format.',
syntax: 'kout[] = pol2rect(kin[])\n kout[] = pol2rect(kmags[], kphs[])',
example: '--8<-- "examples/pol2rect.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes']
},
{
name: 'r2c',
type: 'opcode',
category: 'Array Operations: complex numbers',
description: 'Real to complex format conversion.',
syntax: 'kout[] = r2c(kin[])',
example: '--8<-- "examples/r2c.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
{
name: 'rect2pol',
type: 'opcode',
category: 'Array Operations: complex numbers',
description: 'Converts an input array in real-imaginary format to magnitude-phase format.',
syntax: 'kout[] = rect2pol(kin[])',
example: '--8<-- "examples/rect2pol.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
]

View File

@ -0,0 +1,25 @@
import type { CsoundReference } from './types'
// Array Operations: Discrete Cosine Transform
export const arrayOperationsDiscreteCosineTransform: CsoundReference[] = [
{
name: 'dct',
type: 'opcode',
category: 'Array Operations: Discrete Cosine Transform',
description: 'Discrete Cosine Transform of a sample array (type-II DCT).',
syntax: 'kout[] = dct(kin[])\n iout[] = dct(iin[])',
example: '--8<-- "examples/dct.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'dctinv']
},
{
name: 'dctinv',
type: 'opcode',
category: 'Array Operations: Discrete Cosine Transform',
description: 'Inverse Discrete Cosine Transform of a sample array (type-III DCT).',
syntax: 'kout[] = dctinv(kin[])\n iout[] = dctinv(iin[])',
example: '--8<-- "examples/dctinv.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'dct']
},
]

View File

@ -0,0 +1,15 @@
import type { CsoundReference } from './types'
// Array Operations: dot product
export const arrayOperationsDotProduct: CsoundReference[] = [
{
name: 'dot',
type: 'opcode',
category: 'Array Operations: dot product',
description: 'Calculates the dot product of two arrays.',
syntax: 'kres/ires = dot(karr1[]/iarr1[], karr2[]/iarr2[]) (k- or i-arrays)',
example: '--8<-- "examples/dot.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
]

View File

@ -0,0 +1,66 @@
import type { CsoundReference } from './types'
// Array Operations: Fast Fourier Transform
export const arrayOperationsFastFourierTransform: CsoundReference[] = [
{
name: 'fft',
type: 'opcode',
category: 'Array Operations: Fast Fourier Transform',
description: 'Complex-to-complex Fast Fourier Transform.',
syntax: 'out:k[] = fft(in:k[])\n in:Complex[] = fft(in:Complex[][,inverse:i])\n in:Complex[] = fft(in:k[]);\n out:k[] = fft(in:Complex[]);',
example: '--8<-- "examples/fft.csd"',
parameters: [
{
name: 'out',
description: 'output array containing the complex or real-valued output, depending on the opcode version. It will be created if it does not exist.',
type: 'performance'
},
{
name: 'in',
description: 'input array containing the complex or real-valued input, depending on the opcode version.',
type: 'performance'
},
],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
{
name: 'fftinv',
type: 'opcode',
category: 'Array Operations: Fast Fourier Transform',
description: 'Complex-to-complex Inverse Fast Fourier Transform.',
syntax: 'kout[] = fftinv(kin[])',
example: '--8<-- "examples/ifft.csd"',
rates: ['k-rate'],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
{
name: 'rfft',
type: 'opcode',
category: 'Array Operations: Fast Fourier Transform',
description: 'Fast Fourier Transform of a real-value array.',
syntax: 'out:k[] = rfft(in:k[])\n out:Complex[] = rfft(in:k[])',
example: '--8<-- "examples/rfft.csd"',
seeAlso: ['Vectorial opcodes', 'Array opcodes', 'Array-based spectral opcodes']
},
{
name: 'rifft',
type: 'opcode',
category: 'Array Operations: Fast Fourier Transform',
description: 'Complex-to-real Inverse Fast Fourier Transform.',
syntax: 'out:k[] = rifft(in:k[])\n out:k[] = rifft(in:Complex[])',
example: '--8<-- "examples/irfft.csd"',
parameters: [
{
name: 'out',
description: 'output array containing the real-valued output. It will be created if it does not exist.',
type: 'performance'
},
{
name: 'in',
description: 'input array containing the complex input.',
type: 'performance'
},
],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'Array-based spectral opcodes']
},
]

View File

@ -0,0 +1,32 @@
import type { CsoundReference } from './types'
// Array Operations: Mel scale filterbank
export const arrayOperationsMelScaleFilterbank: CsoundReference[] = [
{
name: 'mfb',
type: 'opcode',
category: 'Array Operations: Mel scale filterbank',
description: 'Mel scale filterbank for spectral magnitudes.',
syntax: 'kout[] = mfb(kin[], klow, khigh, ibands)',
example: '--8<-- "examples/mfb.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'ibands',
description: 'number of bands in the Mel filter bank. Determines the size of the output array.',
type: 'initialization'
},
{
name: 'klow',
description: 'lowest frequency (rounded to the nearest bin centre frequency).',
type: 'performance'
},
{
name: 'khigh',
description: 'highest lowest frequency (rounded to the nearest bin centre frequency).',
type: 'performance'
},
],
seeAlso: ['Vectorial opcodes', 'array opcodes', 'dct']
},
]

View File

@ -0,0 +1,23 @@
import type { CsoundReference } from './types'
// Array Operations: sorting
export const arrayOperationsSorting: CsoundReference[] = [
{
name: 'sorta',
type: 'opcode',
category: 'Array Operations: sorting',
description: 'Takes a numeric array (k or i-rate) and returns it sorted in ascending order.',
syntax: 'k/i[] = sorta(k/i[]) (k- or i-arrays )',
example: '--8<-- "examples/sorta.csd"',
seeAlso: ['Array opcodes']
},
{
name: 'sortd',
type: 'opcode',
category: 'Array Operations: sorting',
description: 'Takes a numeric array (k or i-rate) and returns it sorted in descending order.',
syntax: 'k/i[] = sortd(k/i[]) (k- or i-arrays )',
example: '--8<-- "examples/sortd.csd"',
seeAlso: ['Array opcodes']
},
]

View File

@ -0,0 +1,322 @@
import type { CsoundReference } from './types'
import { orchestraSyntaxHeader } from './orchestra-syntax-header'
import { spectralProcessingAts } from './spectral-processing-ats'
import { osc } from './osc'
import { mathematicalOperationsMathematicalFunctions } from './mathematical-operations-mathematical-functions'
import { instrumentControlRealtimePerformanceControl } from './instrument-control-realtime-performance-control'
import { mathematicalOperationsArithmeticAndLogicOperations } from './mathematical-operations-arithmetic-and-logic-operations'
import { signalGeneratorsEnvelopeGenerators } from './signal-generators-envelope-generators'
import { signalGeneratorsAdditiveSynthesisResynthesis } from './signal-generators-additive-synthesis-resynthesis'
import { realTimeMidiInput } from './real-time-midi-input'
import { spectralProcessingLpc } from './spectral-processing-lpc'
import { signalModifiersReverberation } from './signal-modifiers-reverberation'
import { signalFlowGraphOpcodes } from './signal-flow-graph-opcodes'
import { mathematicalOperationsAmplitudeFunctions } from './mathematical-operations-amplitude-functions'
import { realTimeMidiConverters } from './real-time-midi-converters'
import { serialIO } from './serial-i-o'
import { signalModifiersStandardFiltersResonant } from './signal-modifiers-standard-filters-resonant'
import { signalModifiersStandardFiltersControl } from './signal-modifiers-standard-filters-control'
import { arrayOpcodes } from './array-opcodes'
import { instrumentControlInitializationAndReinitialization } from './instrument-control-initialization-and-reinitialization'
import { signalModifiersStandardFilters } from './signal-modifiers-standard-filters'
import { arrayOperationsAutocorrelation } from './array-operations-autocorrelation'
import { signalModifiersAmplitudeModifiers } from './signal-modifiers-amplitude-modifiers'
import { signalGeneratorsModelsAndEmulations } from './signal-generators-models-and-emulations'
import { signalGeneratorsSamplePlayback } from './signal-generators-sample-playback'
import { signalGeneratorsRandomNoiseGenerators } from './signal-generators-random-noise-generators'
import { signalModifiersPanningAndSpatialization } from './signal-modifiers-panning-and-spatialization'
import { spectralProcessingStreaming } from './spectral-processing-streaming'
import { mathematicalOperationsRandomFunctions } from './mathematical-operations-random-functions'
import { signalGeneratorsLinearAndExponentialGenerators } from './signal-generators-linear-and-exponential-generators'
import { instrumentControlProgramFlowControl } from './instrument-control-program-flow-control'
import { instrumentControlSensingAndControl } from './instrument-control-sensing-and-control'
import { signalGeneratorsDynamicSpectrumOscillators } from './signal-generators-dynamic-spectrum-oscillators'
import { arrayOperationsComplexNumbers } from './array-operations-complex-numbers'
import { mathematicalOperationsArrays } from './mathematical-operations-arrays'
import { vectorialCellularAutomata } from './vectorial-cellular-automata'
import { pitchConvertersFunctions } from './pitch-converters-functions'
import { spectralProcessingOther } from './spectral-processing-other'
import { arrayOperationsCepstrum } from './array-operations-cepstrum'
import { signalIOSoftwareBus } from './signal-i-o-software-bus'
import { signalModifiersWaveshaping } from './signal-modifiers-waveshaping'
import { mathematicalOperationsComparatorsAndAccumulators } from './mathematical-operations-comparators-and-accumulators'
import { instrumentControlClockControl } from './instrument-control-clock-control'
import { signalModifiersComparatorsAndAccumulators } from './signal-modifiers-comparators-and-accumulators'
import { instrumentControlCompilation } from './instrument-control-compilation'
import { signalModifiersConvolutionAndMorphing } from './signal-modifiers-convolution-and-morphing'
import { mathematicalOperationsTrigonometricFunctions } from './mathematical-operations-trigonometric-functions'
import { pitchConvertersTuningOpcodes } from './pitch-converters-tuning-opcodes'
import { signalGeneratorsFmSynthesis } from './signal-generators-fm-synthesis'
import { instrumentControlTimeReading } from './instrument-control-time-reading'
import { signalModifiersSpecializedFilters } from './signal-modifiers-specialized-filters'
import { arrayOperationsDiscreteCosineTransform } from './array-operations-discrete-cosine-transform'
import { orchestraSyntaxMacros } from './orchestra-syntax-macros'
import { signalModifiersDelay } from './signal-modifiers-delay'
import { signalModifiersSampleLevelOperators } from './signal-modifiers-sample-level-operators'
import { miscellaneous } from './miscellaneous'
import { signalGeneratorsGranularSynthesis } from './signal-generators-granular-synthesis'
import { signalIOSignalInput } from './signal-i-o-signal-input'
import { signalIOPrintingAndDisplay } from './signal-i-o-printing-and-display'
import { signalModifiersSpecialEffects } from './signal-modifiers-special-effects'
import { mathematicalOperationsOpcodeEquivalentsOfFunctions } from './mathematical-operations-opcode-equivalents-of-functions'
import { arrayOperationsDotProduct } from './array-operations-dot-product'
import { signalIOFileIO } from './signal-i-o-file-i-o'
import { orchestraSyntaxBlockStatements } from './orchestra-syntax-block-statements'
import { signalGeneratorsPhasors } from './signal-generators-phasors'
import { instrumentControlConditionalValues } from './instrument-control-conditional-values'
import { instrumentControlInvocation } from './instrument-control-invocation'
import { midiFilesMidiInputAndInitialization } from './midi-files-midi-input-and-initialization'
import { arrayOperationsFastFourierTransform } from './array-operations-fast-fourier-transform'
import { signalIOSoundfileQueries } from './signal-i-o-soundfile-queries'
import { tableControlReadWriteOperations } from './table-control-read-write-operations'
import { tableControlTableQueries } from './table-control-table-queries'
import { tableControl } from './table-control'
import { signalGeneratorsHyperVectorialSynthesis } from './signal-generators-hyper-vectorial-synthesis'
import { instrumentControlDurationControl } from './instrument-control-duration-control'
import { remoteOpcodes } from './remote-opcodes'
import { realTimeMidiEventExtenders } from './real-time-midi-event-extenders'
import { signalGeneratorsBasicOscillators } from './signal-generators-basic-oscillators'
import { signalModifiersSignalLimiters } from './signal-modifiers-signal-limiters'
import { utilities } from './utilities'
import { realTimeMidiSystemRealtime } from './real-time-midi-system-realtime'
import { signalIOSignalOutput } from './signal-i-o-signal-output'
import { arrayOperationsMelScaleFilterbank } from './array-operations-mel-scale-filterbank'
import { realTimeMidiNoteOutput } from './real-time-midi-note-output'
import { realTimeMidiMidiScoreInteroperability } from './real-time-midi-midi-score-interoperability'
import { realTimeMidiGenericIO } from './real-time-midi-generic-i-o'
import { mixerOpcodes } from './mixer-opcodes'
import { realTimeMidiOutput } from './real-time-midi-output'
import { signalGeneratorsTableAccess } from './signal-generators-table-access'
import { signalGeneratorsWaveguidePhysicalModeling } from './signal-generators-waveguide-physical-modeling'
import { instrumentControlStacks } from './instrument-control-stacks'
import { stringsManipulation } from './strings-manipulation'
import { spectralProcessingStft } from './spectral-processing-stft'
import { network } from './network'
import { realTimeMidiSliderBanks } from './real-time-midi-slider-banks'
import { signalGeneratorsScannedSynthesis } from './signal-generators-scanned-synthesis'
import { arrayOperationsSorting } from './array-operations-sorting'
import { spectralProcessingNonStandard } from './spectral-processing-non-standard'
import { signalGeneratorsWaveTerrainSynthesis } from './signal-generators-wave-terrain-synthesis'
import { stringsConversion } from './strings-conversion'
import { stringsDefinition } from './strings-definition'
export type { CsoundReference }
export const allCsoundReferences: CsoundReference[] = [
...orchestraSyntaxHeader,
...spectralProcessingAts,
...osc,
...mathematicalOperationsMathematicalFunctions,
...instrumentControlRealtimePerformanceControl,
...mathematicalOperationsArithmeticAndLogicOperations,
...signalGeneratorsEnvelopeGenerators,
...signalGeneratorsAdditiveSynthesisResynthesis,
...realTimeMidiInput,
...spectralProcessingLpc,
...signalModifiersReverberation,
...signalFlowGraphOpcodes,
...mathematicalOperationsAmplitudeFunctions,
...realTimeMidiConverters,
...serialIO,
...signalModifiersStandardFiltersResonant,
...signalModifiersStandardFiltersControl,
...arrayOpcodes,
...instrumentControlInitializationAndReinitialization,
...signalModifiersStandardFilters,
...arrayOperationsAutocorrelation,
...signalModifiersAmplitudeModifiers,
...signalGeneratorsModelsAndEmulations,
...signalGeneratorsSamplePlayback,
...signalGeneratorsRandomNoiseGenerators,
...signalModifiersPanningAndSpatialization,
...spectralProcessingStreaming,
...mathematicalOperationsRandomFunctions,
...signalGeneratorsLinearAndExponentialGenerators,
...instrumentControlProgramFlowControl,
...instrumentControlSensingAndControl,
...signalGeneratorsDynamicSpectrumOscillators,
...arrayOperationsComplexNumbers,
...mathematicalOperationsArrays,
...vectorialCellularAutomata,
...pitchConvertersFunctions,
...spectralProcessingOther,
...arrayOperationsCepstrum,
...signalIOSoftwareBus,
...signalModifiersWaveshaping,
...mathematicalOperationsComparatorsAndAccumulators,
...instrumentControlClockControl,
...signalModifiersComparatorsAndAccumulators,
...instrumentControlCompilation,
...signalModifiersConvolutionAndMorphing,
...mathematicalOperationsTrigonometricFunctions,
...pitchConvertersTuningOpcodes,
...signalGeneratorsFmSynthesis,
...instrumentControlTimeReading,
...signalModifiersSpecializedFilters,
...arrayOperationsDiscreteCosineTransform,
...orchestraSyntaxMacros,
...signalModifiersDelay,
...signalModifiersSampleLevelOperators,
...miscellaneous,
...signalGeneratorsGranularSynthesis,
...signalIOSignalInput,
...signalIOPrintingAndDisplay,
...signalModifiersSpecialEffects,
...mathematicalOperationsOpcodeEquivalentsOfFunctions,
...arrayOperationsDotProduct,
...signalIOFileIO,
...orchestraSyntaxBlockStatements,
...signalGeneratorsPhasors,
...instrumentControlConditionalValues,
...instrumentControlInvocation,
...midiFilesMidiInputAndInitialization,
...arrayOperationsFastFourierTransform,
...signalIOSoundfileQueries,
...tableControlReadWriteOperations,
...tableControlTableQueries,
...tableControl,
...signalGeneratorsHyperVectorialSynthesis,
...instrumentControlDurationControl,
...remoteOpcodes,
...realTimeMidiEventExtenders,
...signalGeneratorsBasicOscillators,
...signalModifiersSignalLimiters,
...utilities,
...realTimeMidiSystemRealtime,
...signalIOSignalOutput,
...arrayOperationsMelScaleFilterbank,
...realTimeMidiNoteOutput,
...realTimeMidiMidiScoreInteroperability,
...realTimeMidiGenericIO,
...mixerOpcodes,
...realTimeMidiOutput,
...signalGeneratorsTableAccess,
...signalGeneratorsWaveguidePhysicalModeling,
...instrumentControlStacks,
...stringsManipulation,
...spectralProcessingStft,
...network,
...realTimeMidiSliderBanks,
...signalGeneratorsScannedSynthesis,
...arrayOperationsSorting,
...spectralProcessingNonStandard,
...signalGeneratorsWaveTerrainSynthesis,
...stringsConversion,
...stringsDefinition,
]
export const csoundReferenceMap = new Map<string, CsoundReference>()
allCsoundReferences.forEach(ref => {
csoundReferenceMap.set(ref.name, ref)
})
export function getCsoundReference(name: string): CsoundReference | undefined {
return csoundReferenceMap.get(name)
}
export function getCsoundReferencesByCategory(category: string): CsoundReference[] {
return allCsoundReferences.filter(ref => ref.category === category)
}
export {
orchestraSyntaxHeader,
spectralProcessingAts,
osc,
mathematicalOperationsMathematicalFunctions,
instrumentControlRealtimePerformanceControl,
mathematicalOperationsArithmeticAndLogicOperations,
signalGeneratorsEnvelopeGenerators,
signalGeneratorsAdditiveSynthesisResynthesis,
realTimeMidiInput,
spectralProcessingLpc,
signalModifiersReverberation,
signalFlowGraphOpcodes,
mathematicalOperationsAmplitudeFunctions,
realTimeMidiConverters,
serialIO,
signalModifiersStandardFiltersResonant,
signalModifiersStandardFiltersControl,
arrayOpcodes,
instrumentControlInitializationAndReinitialization,
signalModifiersStandardFilters,
arrayOperationsAutocorrelation,
signalModifiersAmplitudeModifiers,
signalGeneratorsModelsAndEmulations,
signalGeneratorsSamplePlayback,
signalGeneratorsRandomNoiseGenerators,
signalModifiersPanningAndSpatialization,
spectralProcessingStreaming,
mathematicalOperationsRandomFunctions,
signalGeneratorsLinearAndExponentialGenerators,
instrumentControlProgramFlowControl,
instrumentControlSensingAndControl,
signalGeneratorsDynamicSpectrumOscillators,
arrayOperationsComplexNumbers,
mathematicalOperationsArrays,
vectorialCellularAutomata,
pitchConvertersFunctions,
spectralProcessingOther,
arrayOperationsCepstrum,
signalIOSoftwareBus,
signalModifiersWaveshaping,
mathematicalOperationsComparatorsAndAccumulators,
instrumentControlClockControl,
signalModifiersComparatorsAndAccumulators,
instrumentControlCompilation,
signalModifiersConvolutionAndMorphing,
mathematicalOperationsTrigonometricFunctions,
pitchConvertersTuningOpcodes,
signalGeneratorsFmSynthesis,
instrumentControlTimeReading,
signalModifiersSpecializedFilters,
arrayOperationsDiscreteCosineTransform,
orchestraSyntaxMacros,
signalModifiersDelay,
signalModifiersSampleLevelOperators,
miscellaneous,
signalGeneratorsGranularSynthesis,
signalIOSignalInput,
signalIOPrintingAndDisplay,
signalModifiersSpecialEffects,
mathematicalOperationsOpcodeEquivalentsOfFunctions,
arrayOperationsDotProduct,
signalIOFileIO,
orchestraSyntaxBlockStatements,
signalGeneratorsPhasors,
instrumentControlConditionalValues,
instrumentControlInvocation,
midiFilesMidiInputAndInitialization,
arrayOperationsFastFourierTransform,
signalIOSoundfileQueries,
tableControlReadWriteOperations,
tableControlTableQueries,
tableControl,
signalGeneratorsHyperVectorialSynthesis,
instrumentControlDurationControl,
remoteOpcodes,
realTimeMidiEventExtenders,
signalGeneratorsBasicOscillators,
signalModifiersSignalLimiters,
utilities,
realTimeMidiSystemRealtime,
signalIOSignalOutput,
arrayOperationsMelScaleFilterbank,
realTimeMidiNoteOutput,
realTimeMidiMidiScoreInteroperability,
realTimeMidiGenericIO,
mixerOpcodes,
realTimeMidiOutput,
signalGeneratorsTableAccess,
signalGeneratorsWaveguidePhysicalModeling,
instrumentControlStacks,
stringsManipulation,
spectralProcessingStft,
network,
realTimeMidiSliderBanks,
signalGeneratorsScannedSynthesis,
arrayOperationsSorting,
spectralProcessingNonStandard,
signalGeneratorsWaveTerrainSynthesis,
stringsConversion,
stringsDefinition,
}

View File

@ -0,0 +1,239 @@
import { EditorView, hoverTooltip } from '@codemirror/view';
import { getCsoundReference } from './csoundReference';
function getWordAt(view: EditorView, pos: number): { text: string; from: number; to: number } | null {
const doc = view.state.doc;
const line = doc.lineAt(pos);
let start = pos;
let end = pos;
while (start > line.from) {
const char = doc.sliceString(start - 1, start);
if (!/[a-zA-Z0-9_]/.test(char)) break;
start--;
}
while (end < line.to) {
const char = doc.sliceString(end, end + 1);
if (!/[a-zA-Z0-9_]/.test(char)) break;
end++;
}
if (start === end) return null;
const text = doc.sliceString(start, end);
return { text, from: start, to: end };
}
export const csoundTooltip = hoverTooltip((view, pos) => {
const word = getWordAt(view, pos);
if (!word) return null;
const reference = getCsoundReference(word.text);
if (!reference) return null;
return {
pos: word.from,
end: word.to,
above: true,
create() {
const dom = document.createElement('div');
dom.className = 'csound-tooltip';
const header = document.createElement('div');
header.className = 'csound-tooltip-header';
const title = document.createElement('span');
title.className = 'csound-tooltip-title';
title.textContent = reference.name;
const type = document.createElement('span');
type.className = 'csound-tooltip-type';
type.textContent = reference.type;
header.appendChild(title);
header.appendChild(type);
const description = document.createElement('div');
description.className = 'csound-tooltip-description';
description.textContent = reference.description;
dom.appendChild(header);
dom.appendChild(description);
if (reference.syntax) {
const syntaxLabel = document.createElement('div');
syntaxLabel.className = 'csound-tooltip-syntax-label';
syntaxLabel.textContent = 'Syntax:';
const syntax = document.createElement('pre');
syntax.className = 'csound-tooltip-syntax';
syntax.textContent = reference.syntax;
dom.appendChild(syntaxLabel);
dom.appendChild(syntax);
}
if (reference.rates && reference.rates.length > 0) {
const rates = document.createElement('div');
rates.className = 'csound-tooltip-rates';
rates.textContent = `Rates: ${reference.rates.join(', ')}`;
dom.appendChild(rates);
}
if (reference.parameters && reference.parameters.length > 0) {
const paramsLabel = document.createElement('div');
paramsLabel.className = 'csound-tooltip-params-label';
paramsLabel.textContent = `Parameters (${reference.parameters.length}):`;
dom.appendChild(paramsLabel);
const paramsList = document.createElement('div');
paramsList.className = 'csound-tooltip-params';
reference.parameters.slice(0, 5).forEach(param => {
const paramItem = document.createElement('div');
paramItem.className = 'csound-tooltip-param';
const paramName = document.createElement('span');
paramName.className = 'csound-tooltip-param-name';
paramName.textContent = param.name;
const paramDesc = document.createElement('span');
paramDesc.className = 'csound-tooltip-param-desc';
paramDesc.textContent = param.description.length > 60
? param.description.substring(0, 60) + '...'
: param.description;
paramItem.appendChild(paramName);
paramItem.appendChild(paramDesc);
paramsList.appendChild(paramItem);
});
if (reference.parameters.length > 5) {
const more = document.createElement('div');
more.className = 'csound-tooltip-more';
more.textContent = `... and ${reference.parameters.length - 5} more`;
paramsList.appendChild(more);
}
dom.appendChild(paramsList);
}
return { dom };
}
};
});
export const csoundTooltipTheme = EditorView.theme({
'.cm-tooltip.cm-tooltip-hover': {
backgroundColor: 'rgba(0, 0, 0, 0.95)',
backdropFilter: 'blur(8px)',
color: '#ffffff',
fontSize: '12px',
fontFamily: 'monospace',
padding: '0',
maxWidth: '500px',
border: '1px solid #3a3a3a',
zIndex: '100'
},
'.csound-tooltip': {
padding: '10px 12px'
},
'.csound-tooltip-header': {
display: 'flex',
alignItems: 'center',
gap: '8px',
marginBottom: '6px',
paddingBottom: '6px',
borderBottom: '1px solid #3a3a3a'
},
'.csound-tooltip-title': {
fontWeight: '600',
color: '#646cff',
fontSize: '14px'
},
'.csound-tooltip-type': {
fontSize: '10px',
color: '#9ca3af',
backgroundColor: 'rgba(255, 255, 255, 0.1)',
padding: '2px 6px',
textTransform: 'uppercase'
},
'.csound-tooltip-description': {
color: '#e5e7eb',
lineHeight: '1.5',
marginBottom: '8px'
},
'.csound-tooltip-syntax-label': {
fontSize: '10px',
color: '#9ca3af',
marginTop: '8px',
marginBottom: '4px',
textTransform: 'uppercase',
fontWeight: '500'
},
'.csound-tooltip-syntax': {
backgroundColor: 'rgba(0, 0, 0, 0.4)',
color: '#fbbf24',
padding: '6px 8px',
fontSize: '11px',
fontFamily: 'monospace',
margin: '0 0 8px 0',
whiteSpace: 'pre-wrap',
lineHeight: '1.4',
border: '1px solid #2a2a2a'
},
'.csound-tooltip-rates': {
fontSize: '11px',
color: '#60a5fa',
marginBottom: '8px'
},
'.csound-tooltip-params-label': {
fontSize: '10px',
color: '#9ca3af',
marginTop: '8px',
marginBottom: '4px',
textTransform: 'uppercase',
fontWeight: '500'
},
'.csound-tooltip-params': {
display: 'flex',
flexDirection: 'column',
gap: '4px'
},
'.csound-tooltip-param': {
display: 'flex',
gap: '6px',
fontSize: '11px',
lineHeight: '1.4'
},
'.csound-tooltip-param-name': {
color: '#10b981',
fontWeight: '500',
minWidth: '60px'
},
'.csound-tooltip-param-desc': {
color: '#d1d5db',
flex: '1'
},
'.csound-tooltip-more': {
fontSize: '10px',
color: '#9ca3af',
fontStyle: 'italic',
marginTop: '4px'
}
});

View File

@ -0,0 +1,37 @@
import type { CsoundReference } from './types'
// Instrument Control:Clock Control
export const instrumentControlClockControl: CsoundReference[] = [
{
name: 'clockoff',
type: 'opcode',
category: 'Instrument Control:Clock Control',
description: 'Stops one of a number of internal clocks.',
syntax: 'clockoff(inum)',
example: '--8<-- "examples/clockoff-modern.csd"',
parameters: [
{
name: 'inum',
description: 'the number of a clock. There are 32 clocks numbered 0 through 31. All other values are mapped to clock number 32.',
type: 'initialization'
},
],
seeAlso: ['Clock Control']
},
{
name: 'clockon',
type: 'opcode',
category: 'Instrument Control:Clock Control',
description: 'Starts one of a number of internal clocks.',
syntax: 'clockon(inum)',
example: '--8<-- "examples/clockon-modern.csd"',
parameters: [
{
name: 'inum',
description: 'the number of a clock. There are 32 clocks numbered 0 through 31. All other values are mapped to clock number 32.',
type: 'initialization'
},
],
seeAlso: ['Clock Control']
},
]

View File

@ -0,0 +1,94 @@
import type { CsoundReference } from './types'
// Instrument Control:Compilation
export const instrumentControlCompilation: CsoundReference[] = [
{
name: 'compilecsd',
type: 'opcode',
category: 'Instrument Control:Compilation',
description: 'Compiles a new orchestra from an ASCII file.',
syntax: 'ires = compilecsd(Sfilename)',
example: '--8<-- "examples/compilecsd-modern.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'ires',
description: 'returns 0 if compilation was successful, or -1 if not.',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'compileorc',
type: 'opcode',
category: 'Instrument Control:Compilation',
description: 'Compiles a new orchestra from an ASCII file.',
syntax: 'ires = compileorc(Sfilename)',
example: '--8<-- "examples/compileorc-modern.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'ires',
description: 'returns 0 if compilation was successful, or -1 if not.',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'compilestr',
type: 'opcode',
category: 'Instrument Control:Compilation',
description: 'Compiles a new orchestra passed in as an ASCII string.',
syntax: 'ires = compilestr(Sorch)',
example: '--8<-- "examples/compilestr-modern.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'ires',
description: 'returns 0 if compilation was successful, or -1 if not.',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'evalstr',
type: 'opcode',
category: 'Instrument Control:Compilation',
description: 'Evaluates a string containing Csound code, returning a value from the global space (instr 0).',
syntax: 'ires = evalstr(Scode)\n kres = evalstr(Scode, ktrig)',
example: 'ival evalstr "return 2 + 2"\nprint ival',
rates: ['k-rate', 'i-rate'],
parameters: [
{
name: 'Scode',
description: 'a string to be compiled and evaluated.',
type: 'initialization'
},
{
name: 'ktrig',
description: 'triggers the compilation/evaluation if non-zero.',
type: 'performance'
},
],
seeAlso: ['String Manipulation Opcodes']
},
{
name: 'return',
type: 'opcode',
category: 'Instrument Control:Compilation',
description: 'Returns a value from an instrument at i-time.',
syntax: 'return(ival)',
example: 'ival evalstr "return 2 + 2"\nprint ival',
parameters: [
{
name: 'ival',
description: 'a value to be returned by instrument.',
type: 'initialization'
},
],
seeAlso: ['String Manipulation Opcodes']
},
]

View File

@ -0,0 +1,53 @@
import type { CsoundReference } from './types'
// Instrument Control:Conditional Values
export const instrumentControlConditionalValues: CsoundReference[] = [
{
name: 'equals',
type: 'opcode',
category: 'Instrument Control:Conditional Values',
description: 'Compares two values for equality.',
example: '--8<-- "examples/equals.csd"',
seeAlso: ['Conditional Values']
},
{
name: 'greaterequal',
type: 'opcode',
category: 'Instrument Control:Conditional Values',
description: 'Determines if one value is greater than or equal to another.',
example: '--8<-- "examples/greaterequal.csd"',
seeAlso: ['Conditional Values']
},
{
name: 'greaterthan',
type: 'opcode',
category: 'Instrument Control:Conditional Values',
description: 'Determines if one value is greater than another.',
example: '--8<-- "examples/greaterthan.csd"',
seeAlso: ['Conditional Values']
},
{
name: 'lessequal',
type: 'opcode',
category: 'Instrument Control:Conditional Values',
description: 'Determines if one value is less than or equal to another.',
example: '--8<-- "examples/lessequal.csd"',
seeAlso: ['Conditional Values']
},
{
name: 'lessthan',
type: 'opcode',
category: 'Instrument Control:Conditional Values',
description: 'Determines if one value is less than another.',
example: '--8<-- "examples/lessthan.csd"',
seeAlso: ['Conditional Values']
},
{
name: 'notequal',
type: 'opcode',
category: 'Instrument Control:Conditional Values',
description: 'Determines if one value is not equal to another.',
example: '--8<-- "examples/notequal.csd"',
seeAlso: ['Conditional Values']
},
]

View File

@ -0,0 +1,21 @@
import type { CsoundReference } from './types'
// Instrument Control:Duration Control
export const instrumentControlDurationControl: CsoundReference[] = [
{
name: 'ihold',
type: 'opcode',
category: 'Instrument Control:Duration Control',
description: 'Causes a finite-duration note to become a &#8220;held&#8221; note.',
syntax: 'ihold()',
example: '--8<-- "examples/ihold-modern.csd"',
parameters: [
{
name: 'ihold',
description: 'this i-time statement causes a finite-duration note to become a &#8220;held&#8221; note. It thus has the same effect as a negative p3 ( see score [i Statement](../scoregens/i.md)), except that p3 here remains positive and the instrument reclassifies itself to being held indefinitely. The note can be turned off explicitly with _turnoff_, or its space taken over by another note of the same instrument number (i.e. it is tied into that note). Effective at i-time only; no-op during a _reinit_ pass.',
type: 'performance'
},
],
seeAlso: ['Duration Control Statements']
},
]

View File

@ -0,0 +1,185 @@
import type { CsoundReference } from './types'
// Instrument Control:Initialization and Reinitialization
export const instrumentControlInitializationAndReinitialization: CsoundReference[] = [
{
name: 'assign',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Performs a simple assignment.',
example: '--8<-- "examples/assign-modern.csd"',
seeAlso: ['Initialization and Reinitialization', 'Array opcodes']
},
{
name: 'create',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: '',
syntax: 'var:InstrDef = create(code:S)\n var:Instr = create(instr:InstrDef)\n var:Opcode = create(opc:OpcodeDef[,overload:i]\n var:Opcode[] = create(opc:OpcodeDef,len:i[,overload:i])',
example: '--8<-- "examples/create.csd"',
parameters: [
{
name: 'code',
description: 'String containing Csound language code for an instrument.',
type: 'initialization'
},
{
name: 'instr',
description: 'compiled instrument definition.',
type: 'initialization'
},
{
name: 'opc',
description: 'opcode definition',
type: 'initialization'
},
{
name: 'overload',
description: '(optional, defaults to 0) opcode overload (version) (see [opcodeinfo](../opcodes/opcodeinfo.md))',
type: 'initialization'
},
{
name: 'len',
description: 'opcode object array length.',
type: 'initialization'
},
],
},
{
name: 'init',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Initialises one or more objects.',
syntax: 'var:{a,k,i,S,OpcodeDef}[,...] = init(arg:{i,S}[,...])\n var{i[],k[],a[]} = init(size1:i[,size2:i,...])\n err:i = init(inst:Instr[,p4:i,...])\n [var:*,... =] init(op:Opcode[,arg1:*,...])',
example: '--8<-- "examples/init.csd"',
seeAlso: ['Initialization and Reinitialization', 'Array opcodes']
},
{
name: 'nstrnum',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Returns the number of a named instrument.',
syntax: 'insno = nstrnum("name")',
example: '--8<-- "examples/nstrnum_nstrstr.csd"',
parameters: [
{
name: 'insno',
description: 'the instrument number of the named instrument.',
type: 'initialization'
},
],
seeAlso: ['Initialization and Reinitialization']
},
{
name: 'nstrstr',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Returns the string of a named instr from its number or an empty string if no such association exists.',
syntax: 'Sname = nstrstr(insno)\n Sname = nstrstr(knsno)',
example: '--8<-- "examples/nstrnum_nstrstr.csd"',
parameters: [
{
name: 'insno',
description: 'the instrument number of the named instrument.',
type: 'initialization'
},
{
name: 'knsno',
description: 'the named instrument\'s number.',
type: 'performance'
},
{
name: 'Sname',
description: 'the named instrument\'s name.',
type: 'performance'
},
],
},
{
name: 'opcodeinfo',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: '',
syntax: 'opcodeinfo(opc:OpcodeDef)\n opcodeinfo(obj:Opcode)',
example: '--8<-- "examples/opcodeinfo.csd"',
parameters: [
{
name: 'opc',
description: 'opcode definition',
type: 'initialization'
},
{
name: 'obj',
description: 'opcode object',
type: 'initialization'
},
],
},
{
name: 'p',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Show the value in a given p-field.',
example: '--8<-- "examples/p.csd"',
parameters: [
{
name: 'x',
description: 'the number of the p-field.',
type: 'initialization'
},
],
seeAlso: ['Initialization and Reinitialization']
},
{
name: 'passign',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Assigns a range of p-fields to ivariables, or i- or k-array.',
syntax: 'ivar1, ... = passign([istart][, iend])\n iarray = passign([istart][, iend])\n karray = passign([istart][, iend])',
example: '--8<-- "examples/passign.csd"',
seeAlso: ['assign', 'pcount', 'Initialization and Reinitialization']
},
{
name: 'plusbecomes',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Performs add and assignment.',
example: '--8<-- "examples/reverb.csd"',
seeAlso: ['Initialization and Reinitialization']
},
{
name: 'pset',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Defines and initializes numeric arrays at orchestra load time.',
syntax: 'pset(icon1 [, icon2] [...])',
example: '--8<-- "examples/pset.csd"',
seeAlso: ['Initialization and Reinitialization', 'Orchestra Header Statements']
},
{
name: 'reinit',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Suspends a performance while a special initialization pass is executed.',
syntax: 'reinit(label)',
example: '--8<-- "examples/reinit-modern.csd"',
seeAlso: ['Initialization and Reinitialization']
},
{
name: 'rigoto',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Transfers control during a reinit pass.',
syntax: 'rigoto(label)',
seeAlso: ['Initialization and Reinitialization']
},
{
name: 'rireturn',
type: 'opcode',
category: 'Instrument Control:Initialization and Reinitialization',
description: 'Terminates a [reinit](../opcodes/reinit.md) pass (i.e., no-op at standard i-time).',
syntax: 'rireturn()',
example: '--8<-- "examples/reinit.csd"',
seeAlso: ['Initialization and Reinitialization']
},
]

View File

@ -0,0 +1,313 @@
import type { CsoundReference } from './types'
// Instrument Control:Invocation
export const instrumentControlInvocation: CsoundReference[] = [
{
name: 'event',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Generates a score event from an instrument.',
syntax: 'event("scorechar", kinsnum, kdelay, kdur, [, kp4] [, kp5] [, ...])\n event("scorechar", "insname", kdelay, kdur, [, kp4] [, kp5] [, ...])',
example: '--8<-- "examples/event.csd"',
parameters: [
{
name: 'kinsnum',
description: 'The instrument to use for the event. This corresponds to the first p-field, p1, in a score statement.',
type: 'performance'
},
{
name: 'kdelay',
description: 'When (in seconds) the event will occur from the current performance time. This corresponds to the second p-field, p2, in a score statement.',
type: 'performance'
},
{
name: 'kdur',
description: 'How long (in seconds) the event will happen. This corresponds to the third p-field, p3, in a score statement.',
type: 'performance'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'event_i',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Generates a score event from an instrument.',
syntax: 'event_i("scorechar", iinsnum, idelay, idur, [, ip4] [, ip5] [, ...])\n event_i("scorechar", "insname", idelay, idur, [, ip4] [, ip5] [, ...])',
example: '--8<-- "examples/event_i.csd"',
parameters: [
{
name: 'iinsnum',
description: 'The instrument to use for the event. This corresponds to the first p-field, p1, in a score statement.',
type: 'initialization'
},
{
name: 'idelay',
description: 'When (in seconds) the event will occur from the current performance time. This corresponds to the second p-field, p2, in a score statement.',
type: 'initialization'
},
{
name: 'idur',
description: 'How long (in seconds) the event will happen. This corresponds to the third p-field, p3, in a score statement.',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'mute',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Mutes/unmutes new instances of a given instrument.',
syntax: 'mute(insnum [, iswitch])\n mute("insname" [, iswitch])',
example: '--8<-- "examples/mute.csd"',
parameters: [
{
name: 'insnum',
description: 'instrument number. Equivalent to _p1_ in a score [i statement](../scoregens/i.md).',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'nstance',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Schedules a new instrument instance, storing the instance handle in a variable.',
syntax: 'iHandle = nstance(insnum, iwhen, idur [, ip4] [, ip5] [...])\n iHandle = nstance("insname", iwhen, idur [, ip4] [, ip5] [...])',
example: '--8<-- "examples/nstance.csd"',
parameters: [
{
name: 'iHandle',
description: 'this variable will contain a handle to the event instance. It can be used, for example, to stop the given instrument instance via the turnoff opcode. Note that the instance handle is only valid once the instrument is initialised.',
type: 'initialization'
},
{
name: 'insnum',
description: 'instrument number. Equivalent to p1 in a score [i statement](../scoregens/i.md). _insnum_ must be a number greater than the number of the calling instrument.',
type: 'initialization'
},
{
name: 'iwhen',
description: 'start time of the new event. Equivalent to p2 in a score [i statement](../scoregens/i.md). _iwhen_ must be nonnegative. If _iwhen_ is zero, _insum_ must be greater than or equal to the p1 of the current instrument.',
type: 'initialization'
},
{
name: 'idur',
description: 'duration of event. Equivalent to p3 in a score [i statement](../scoregens/i.md).',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation', 'http://www.csoundjournal.com/issue15/phrase_loops.html']
},
{
name: 'readscore',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Read, preprocess and schedule a score from an input string.',
syntax: 'readscore(Sin)',
example: '--8<-- "examples/readscore.csd"',
seeAlso: ['Instrument Invocation']
},
{
name: 'remove',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Removes the definition of an instrument as long as it is not in use.',
syntax: 'remove(insnum)',
parameters: [
{
name: 'insnum',
description: 'number or name of the instrument to be deleted',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'schedkwhen',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Adds a new score event generated by a k-rate trigger.',
syntax: 'schedkwhen(ktrigger, kmintim, kmaxnum, kinsnum, kwhen, kdur )\n [, ip4] [, ip5] [...])\n schedkwhen(ktrigger, kmintim, kmaxnum, "insname", kwhen, kdur \\\n [, ip4] [, ip5] [...])',
example: '--8<-- "examples/schedkwhen.csd"',
parameters: [
{
name: 'ktrigger',
description: 'triggers a new score event. If _ktrigger_ = 0, no new event is triggered.',
type: 'performance'
},
{
name: 'kmintim',
description: 'minimum time between generated events, in seconds. If _kmintim_ &lt;= 0, no time limit exists. If the _kinsnum_ is negative (to turn off an instrument), this test is bypassed.',
type: 'performance'
},
{
name: 'kmaxnum',
description: 'maximum number of simultaneous instances of instrument _kinsnum_ allowed. If the number of existant instances of _kinsnum_ is &gt;= _kmaxnum_, no new event is generated. If _kmaxnum_ is &lt;= 0, it is not used to limit event generation. If the _kinsnum_ is negative (to turn off an instrument), this test is bypassed.',
type: 'performance'
},
{
name: 'kinsnum',
description: 'instrument number. Equivalent to p1 in a score [i statement](../scoregens/i.md).',
type: 'performance'
},
{
name: 'kwhen',
description: 'start time of the new event. Equivalent to p2 in a score [i statement](../scoregens/i.md). Measured from the time of the triggering event. _kwhen_ must be &gt;= 0. If _kwhen_ &gt; 0, the instrument will not be initialized until the actual time when it should start performing.',
type: 'performance'
},
{
name: 'kdur',
description: 'duration of event. Equivalent to p3 in a score [i statement](../scoregens/i.md). If _kdur_ = 0, the instrument will only do an initialization pass, with no performance. If _kdur_ is negative, a held note is initiated. (See [ihold](../opcodes/ihold.md) and [i statement](../scoregens/i.md).)',
type: 'performance'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'schedkwhennamed',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Similar to [schedkwhen](../opcodes/schedkwhen.md) but uses a named instrument at init-time.',
syntax: 'schedkwhennamed(ktrigger, kmintim, kmaxnum, "name", kwhen, kdur \\\n [, ip4] [, ip5] [...])',
example: '--8<-- "examples/schedkwhennamed.csd"',
parameters: [
{
name: 'ktrigger',
description: 'triggers a new score event. If _ktrigger_ is 0, no new event is triggered.',
type: 'performance'
},
{
name: 'kmintim',
description: 'minimum time between generated events, in seconds. If _kmintim_ is less than or equal to 0, no time limit exists.',
type: 'performance'
},
{
name: 'kmaxnum',
description: 'maximum number of simultaneous instances of named instrument allowed. If the number of existant instances of the named instrument is greater than or equal to _kmaxnum_, no new event is generated. If _kmaxnum_ is less than or equal to 0, it is not used to limit event generation.',
type: 'performance'
},
{
name: 'kwhen',
description: 'start time of the new event. Equivalent to p2 in a score [i statement](../scoregens/i.md). Measured from the time of the triggering event. _kwhen_ must be greater than or equal to 0. If _kwhen_ greater than 0, the instrument will not be initialized until the actual time when it should start performing.',
type: 'performance'
},
{
name: 'kdur',
description: 'duration of event. Equivalent to p3 in a score [i statement](../scoregens/i.md). If _kdur_ is 0, the instrument will only do an initialization pass, with no performance. If _kdur_ is negative, a held note is initiated. (See [ihold](../opcodes/ihold.md) and [i statement](../scoregens/i.md).)',
type: 'performance'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'schedule',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Adds a new score event.',
syntax: 'schedule(insnum, iwhen, idur [, ip4] [, ip5] [...])\n schedule("insname", iwhen, idur [, ip4] [, ip5] [...])\n schedule(iPar[])',
example: '--8<-- "examples/schedule.csd"',
parameters: [
{
name: 'insnum',
description: 'instrument number. Equivalent to p1 in a score [i statement](../scoregens/i.md). _insnum_ must be a number greater than the number of the calling instrument.',
type: 'initialization'
},
{
name: 'iwhen',
description: 'start time of the new event. Equivalent to p2 in a score [i statement](../scoregens/i.md). _iwhen_ must be nonnegative. If _iwhen_ is zero, _insum_ must be greater than or equal to the p1 of the current instrument.',
type: 'initialization'
},
{
name: 'idur',
description: 'duration of event. Equivalent to p3 in a score [i statement](../scoregens/i.md).',
type: 'initialization'
},
],
seeAlso: ['Instrument Invocation', 'http://www.csoundjournal.com/issue15/phrase_loops.html']
},
{
name: 'schedulek',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Adds a new score event.',
syntax: 'schedulek(knsnum, kwhen, kdur [, kp4] [, kp5] [...])\n schedulek("insname", kwhen, kdur [, kp4] [, kp5] [...])\n schedulek(kPar[])',
example: '--8<-- "examples/schedulek.csd"',
parameters: [
{
name: 'knsnum',
description: 'instrument number. Equivalent to p1 in a score [i statement](../scoregens/i.md). _knsnum_ must be a number greater than the number of the calling instrument.',
type: 'performance'
},
{
name: 'kwhen',
description: 'start time of the new event. Equivalent to p2 in a score [i statement](../scoregens/i.md). _kwhen_ must be nonnegative. If _kwhen_ is zero, _insum_ must be greater than or equal to the p1 of the current instrument.',
type: 'performance'
},
{
name: 'kdur',
description: 'duration of event. Equivalent to p3 in a score [i statement](../scoregens/i.md).',
type: 'performance'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'schedwhen',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Adds a new score event.',
syntax: 'schedwhen(ktrigger, kinsnum, kwhen, kdur [, ip4] [, ip5] [...])\n schedwhen(ktrigger, "insname", kwhen, kdur [, ip4] [, ip5] [...])',
example: '--8<-- "examples/schedwhen.csd"',
parameters: [
{
name: 'kinsnum',
description: 'instrument number. Equivalent to p1 in a score [i statement](../scoregens/i.md).',
type: 'performance'
},
{
name: 'ktrigger',
description: 'trigger value for new event',
type: 'performance'
},
{
name: 'kwhen',
description: 'start time of the new event. Equivalent to p2 in a score [i statement](../scoregens/i.md).',
type: 'performance'
},
{
name: 'kdur',
description: 'duration of event. Equivalent to p3 in a score [i statement](../scoregens/i.md).',
type: 'performance'
},
],
seeAlso: ['Instrument Invocation']
},
{
name: 'scoreline',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Issues one or more score line events from an instrument.',
syntax: 'scoreline(Sin, ktrig)',
example: '--8<-- "examples/scoreline.csd"',
parameters: [
{
name: 'ktrig',
description: 'event trigger, 1 issues the score event, 0 bypasses it.',
type: 'performance'
},
],
seeAlso: ['Instrument Invocation', 'http://www.csoundjournal.com/issue15/phrase_loops.html', 'https://flossmanual.csound.com/csound-language/live-events']
},
{
name: 'scoreline_i',
type: 'opcode',
category: 'Instrument Control:Invocation',
description: 'Issues one or more score line events from an instrument at i-time.',
syntax: 'scoreline_i(Sin)',
example: '--8<-- "examples/scoreline_i.csd"',
seeAlso: ['Instrument Invocation', 'http://www.csoundjournal.com/issue15/phrase_loops.html', 'https://flossmanual.csound.com/csound-language/live-events']
},
]

View File

@ -0,0 +1,288 @@
import type { CsoundReference } from './types'
// Instrument Control:Program Flow Control
export const instrumentControlProgramFlowControl: CsoundReference[] = [
{
name: 'break',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'A syntactic looping construction used in for, while, and until loops.',
example: '--8<-- "examples/break.csd"',
seeAlso: ['Program Flow Control: Looping Constructions']
},
{
name: 'cggoto',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Conditionally transfer control to _label_ on every pass. (Combination of [cigoto](../opcodes/cigoto.md) and [ckgoto](../opcodes/ckgoto.md))',
syntax: 'cggoto(condition, label)',
example: '--8<-- "examples/cggoto-modern.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'cigoto',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'During the i-time pass only, conditionally transfer control to the statement labeled by _label_.',
syntax: 'cigoto(condition, label)',
example: '--8<-- "examples/cigoto-modern.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'ckgoto',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'During the p-time passes only, conditionally transfer control to the statement labeled by _label_.',
syntax: 'ckgoto(condition, label)',
example: '--8<-- "examples/ckgoto-modern.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'cngoto',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Transfers control on every pass when the condition is _not_ true.',
syntax: 'cngoto(condition, label)',
example: '--8<-- "examples/cngoto-modern.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'continue',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'A syntactic looping construction used in for, while, and until loops.',
example: '--8<-- "examples/continue.csd"',
seeAlso: ['Program Flow Control: Looping Constructions']
},
{
name: 'else',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Executes a block of code when an "if...then" condition is false.',
example: '--8<-- "examples/else.csd"',
seeAlso: ['Program Flow Control', 'http://www.csoundjournal.com/2006spring/controlFlow.html']
},
{
name: 'elseif',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Defines another "if...then" condition when a "if...then" condition is false.',
example: '--8<-- "examples/elseif.csd"',
seeAlso: ['Program Flow Control', 'http://www.csoundjournal.com/2006spring/controlFlow.html']
},
{
name: 'endif',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Closes a block of code that begins with an ["if...then"](../opcodes/if.md) statement.',
example: '--8<-- "examples/endif.csd"',
seeAlso: ['Program Flow Control', 'http://www.csoundjournal.com/2006spring/controlFlow.html']
},
{
name: 'for',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'A syntactic looping construction.',
example: '--8<-- "examples/forin.csd"',
seeAlso: ['Program Flow Control: Looping Constructions']
},
{
name: 'goto',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Transfer control to _label_ on every pass. (Combination of [igoto](../opcodes/igoto.md) and [kgoto](../opcodes/kgoto.md))',
syntax: 'goto(label)',
example: '--8<-- "examples/goto-modern.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'if',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Branches conditionally at initialization or during performance time.',
example: '--8<-- "examples/igoto.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'igoto',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'During the i-time pass only, unconditionally transfer control to the statement labeled by _label_.',
syntax: 'igoto(label)',
example: '--8<-- "examples/igoto-modern.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'kgoto',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'During the p-time passes only, unconditionally transfer control to the statement labeled by _label_.',
syntax: 'kgoto(label)',
example: '--8<-- "examples/kgoto.csd"',
seeAlso: ['Program Flow Control']
},
{
name: 'loop_ge',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Construction of looping operations.',
syntax: 'loop_ge(indx, idecr, imin, label)\n loop_ge(kndx, kdecr, kmin, label)',
example: '--8<-- "examples/loop_-group-modern.csd"',
parameters: [
{
name: 'indx',
description: 'i-rate variable to count loop.',
type: 'initialization'
},
{
name: 'idecr',
description: 'value to decrement the loop.',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum value of loop index.',
type: 'initialization'
},
{
name: 'kndx',
description: 'k-rate variable to count loop.',
type: 'performance'
},
{
name: 'kdecr',
description: 'value to decrement the loop.',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum value of loop index.',
type: 'performance'
},
],
seeAlso: ['Program Flow Control: Looping Constructions', 'http://www.csoundjournal.com/2006summer/controlFlow_part2.html', ' https://flossmanual.csound.com/csound-language/control-structures']
},
{
name: 'loop_gt',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Construction of looping operations.',
syntax: 'loop_gt(indx, idecr, imin, label)\n loop_gt(kndx, kdecr, kmin, label)',
example: '--8<-- "examples/loop_gt.csd"',
parameters: [
{
name: 'indx',
description: 'i-rate variable to count loop.',
type: 'initialization'
},
{
name: 'idecr',
description: 'value to decrement the loop.',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum value of loop index.',
type: 'initialization'
},
{
name: 'kndx',
description: 'k-rate variable to count loop.',
type: 'performance'
},
{
name: 'kdecr',
description: 'value to decrement the loop.',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum value of loop index.',
type: 'performance'
},
],
seeAlso: ['Program Flow Control: Looping Constructions', 'http://www.csoundjournal.com/2006summer/controlFlow_part2.html', ' https://flossmanual.csound.com/csound-language/control-structures']
},
{
name: 'loop_le',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Construction of looping operations.',
syntax: 'loop_le(indx, incr, imax, label)\n loop_le(kndx, kncr, kmax, label)',
example: '--8<-- "examples/loop_le.csd"',
parameters: [
{
name: 'indx',
description: 'i-rate variable to count loop.',
type: 'initialization'
},
{
name: 'incr',
description: 'value to increment the loop.',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum value of loop index.',
type: 'initialization'
},
{
name: 'kndx',
description: 'k-rate variable to count loop.',
type: 'performance'
},
{
name: 'kncr',
description: 'value to increment the loop.',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum value of loop index.',
type: 'performance'
},
],
seeAlso: ['Program Flow Control: Looping Constructions', 'http://www.csoundjournal.com/2006summer/controlFlow_part2.html', ' https://flossmanual.csound.com/csound-language/control-structures']
},
{
name: 'loop_lt',
type: 'opcode',
category: 'Instrument Control:Program Flow Control',
description: 'Construction of looping operations.',
syntax: 'loop_lt(indx, incr, imax, label)\n loop_lt(kndx, kncr, kmax, label)',
example: '--8<-- "examples/loop_lt.csd"',
parameters: [
{
name: 'indx',
description: 'i-rate variable to count loop.',
type: 'initialization'
},
{
name: 'incr',
description: 'value to increment the loop.',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum value of loop index.',
type: 'initialization'
},
{
name: 'kndx',
description: 'k-rate variable to count loop.',
type: 'performance'
},
{
name: 'kncr',
description: 'value to increment the loop.',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum value of loop index.',
type: 'performance'
},
],
seeAlso: ['Program Flow Control: Looping Constructions', 'http://www.csoundjournal.com/2006summer/controlFlow_part2.html', ' https://flossmanual.csound.com/csound-language/control-structures']
},
]

View File

@ -0,0 +1,175 @@
import type { CsoundReference } from './types'
// Instrument Control:Realtime Performance Control
export const instrumentControlRealtimePerformanceControl: CsoundReference[] = [
{
name: 'active',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: 'Returns the number of active instances of an instrument with options to ignore releasing instances.',
syntax: 'ir = active(insnum [,iopt [,inorel]])\n ir = active(Sinsname [,iopt [,inorel]])\n kres = active(kinsnum [,iopt [,inorel]])',
example: '--8<-- "examples/active-modern.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'insnum',
description: 'number or string name of the instrument to be reported',
type: 'initialization'
},
{
name: 'Sinsname',
description: 'instrument name',
type: 'initialization'
},
{
name: 'iopt',
description: 'select currently active (zero, default), or all every active (non zero)',
type: 'initialization'
},
{
name: 'inorel',
description: 'if non-zero ignore instruments in release phase (zero, default), only valid if iopts is zero.',
type: 'initialization'
},
{
name: 'kinsnum',
description: 'number or string name of the instrument to be reported',
type: 'performance'
},
],
seeAlso: ['Real-time Performance Control']
},
{
name: 'cpumeter',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: 'Reports the usage of cpu either total or per core to monitor how close to max-out the processing is.',
syntax: 'ktot[,kcpu1, kcpu2,...] = cpumeter(ifreq)',
example: '--8<-- "examples/cpumeter.csd"',
seeAlso: ['Real-time Performance Control']
},
{
name: 'cpuprc',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: 'Control allocation of cpu resources on a per-instrument basis, to optimize realtime output.',
syntax: 'cpuprc(insnum, ipercent)\n cpuprc(Sinsname, ipercent)',
example: '--8<-- "examples/cpuprc.csd"',
parameters: [
{
name: 'insnum',
description: 'instrument number or string',
type: 'initialization'
},
{
name: 'Sinsname',
description: 'instrument number or string',
type: 'initialization'
},
{
name: 'ipercent',
description: 'percent of cpu processing-time to assign. Can also be expressed as a fractional value.',
type: 'initialization'
},
],
seeAlso: ['Real-time Performance Control']
},
{
name: 'exitnow',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: 'Exit Csound as fast as possible, with no cleaning up.',
syntax: 'exitnow([ivalue])',
example: '--8<-- "examples/exitnow.csd"',
seeAlso: ['Real-time Performance Control']
},
{
name: 'maxalloc',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: 'Limits the number of allocations of an instrument.',
syntax: 'maxalloc(insnum, icount)\n maxalloc(Sinsname, icount)',
example: '--8<-- "examples/maxalloc.csd"',
parameters: [
{
name: 'insnum',
description: 'instrument number',
type: 'initialization'
},
{
name: 'Sinsname',
description: 'instrument name',
type: 'initialization'
},
{
name: 'icount',
description: 'number of instrument allocations',
type: 'initialization'
},
],
seeAlso: ['Real-time Performance Control']
},
{
name: 'perf',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: '',
syntax: 'err:k = perf(ins:Instr[, p4:k, ...])\n [var:*,... =] perf(opc:Opcode[,arg1:*,...])',
example: '--8<-- "examples/create.csd"',
parameters: [
{
name: 'err',
description: 'error code (0 if successful)',
type: 'performance'
},
],
seeAlso: ['Initialization and Reinitialization']
},
{
name: 'prealloc',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: 'Creates space for instruments but does not run them.',
syntax: 'prealloc(insnum, icount)\n prealloc("insname", icount)',
example: '--8<-- "examples/prealloc.csd"',
parameters: [
{
name: 'insnum',
description: 'instrument number',
type: 'initialization'
},
{
name: 'icount',
description: 'number of instrument allocations',
type: 'initialization'
},
],
seeAlso: ['Real-time Performance Control']
},
{
name: 'setp',
type: 'opcode',
category: 'Instrument Control:Realtime Performance Control',
description: '',
syntax: 'setp(ins:Instr,num:k,val:k)',
example: '--8<-- "examples/create.csd"',
parameters: [
{
name: 'ins',
description: 'instrument instance',
type: 'performance'
},
{
name: 'num',
description: 'parameter number',
type: 'performance'
},
{
name: 'val',
description: 'parameter value',
type: 'performance'
},
],
seeAlso: ['Initialization and Reinitialization']
},
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
import type { CsoundReference } from './types'
// Instrument Control:Stacks
export const instrumentControlStacks: CsoundReference[] = [
{
name: 'pop',
type: 'opcode',
category: 'Instrument Control:Stacks',
description: 'Pops values from the global stack. Deprecated.',
syntax: 'xval1, [xval2, ... , xval31] = pop()\n ival1, [ival2, ... , ival31] = pop()',
example: '--8<-- "examples/pop.csd"',
seeAlso: ['Stacks', 'http://csound.1045644.n5.nabble.com/passing-a-string-to-a-UDO-td1099284.html']
},
{
name: 'pop_f',
type: 'opcode',
category: 'Instrument Control:Stacks',
description: 'Pops an f-sig frame from the global stack. Deprecated.',
syntax: 'fsig = pop_f()',
parameters: [
{
name: 'fsig',
description: 'f-signal to be popped from the stack.',
type: 'performance'
},
],
seeAlso: ['Stacks']
},
{
name: 'push',
type: 'opcode',
category: 'Instrument Control:Stacks',
description: 'Pushes a value into the global stack. Deprecated.',
syntax: 'push(xval1, [xval2, ... , xval31])\n push(ival1, [ival2, ... , ival31])',
example: '--8<-- "examples/push.csd"',
seeAlso: ['Stacks', 'http://csound.1045644.n5.nabble.com/passing-a-string-to-a-UDO-td1099284.html']
},
{
name: 'push_f',
type: 'opcode',
category: 'Instrument Control:Stacks',
description: 'Pushes an f-sig frame into the global stack. Deprecated.',
syntax: 'push_f(fsig)',
parameters: [
{
name: 'fsig',
description: 'f-signal to be pushed into the stack.',
type: 'performance'
},
],
seeAlso: ['Stacks']
},
{
name: 'stack',
type: 'opcode',
category: 'Instrument Control:Stacks',
description: 'Initializes and sets the size of the global stack. Deprecated.',
syntax: 'stack(iStackSize)',
example: '--8<-- "examples/stack.csd"',
parameters: [
{
name: 'iStackSize',
description: 'size of the stack in bytes.',
type: 'initialization'
},
],
seeAlso: ['Stacks', 'http://csound.1045644.n5.nabble.com/passing-a-string-to-a-UDO-td1099284.html']
},
]

View File

@ -0,0 +1,102 @@
import type { CsoundReference } from './types'
// Instrument Control:Time Reading
export const instrumentControlTimeReading: CsoundReference[] = [
{
name: 'date',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Returns the number seconds since a base date, using the operating system\'s clock.',
syntax: 'ir[, inano] = date()\n kr[, knano] = date()',
example: '--8<-- "examples/date.csd"',
seeAlso: ['Time Reading']
},
{
name: 'dates',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Returns as a string the date and time specified.',
syntax: 'Sir = dates([ itime])',
example: '--8<-- "examples/dates.csd"',
parameters: [
{
name: 'itime',
description: 'the time is seconds since the start of the epoch. If omited or negative the current time is taken.',
type: 'initialization'
},
{
name: 'Sir',
description: 'the date and time as a string.',
type: 'initialization'
},
],
seeAlso: ['Time Reading']
},
{
name: 'elapsedcycles',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Read absolute time, in k-rate cycles, since the start of the performance.',
syntax: 'ires = elapsedcycles()\n kres = elapsedcycles()',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Time Reading']
},
{
name: 'elapsedtime',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Read absolute time, in seconds, since the start of the performance.',
syntax: 'ires = elapsedtime()\n kres = elapsedtime()',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Time Reading']
},
{
name: 'eventcycles',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Read absolute time in k-rate cycles, since the start of an instance of an instrument.',
syntax: 'kres = eventcycles()',
rates: ['k-rate'],
seeAlso: ['Time Reading']
},
{
name: 'eventtime',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Read absolute time, in seconds, since the start of an instance of an instrument.',
syntax: 'kres = eventtime()',
rates: ['k-rate'],
seeAlso: ['Time Reading']
},
{
name: 'readclock',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Reads the value of an internal clock.',
syntax: 'ir = readclock(inum)',
example: '--8<-- "examples/readclock.csd"',
parameters: [
{
name: 'inum',
description: 'the number of a clock. There are 32 clocks numbered 0 through 31. All other values are mapped to clock number 32.',
type: 'initialization'
},
{
name: 'ir',
description: 'value at i-time, of the clock specified by _inum_',
type: 'initialization'
},
],
seeAlso: ['Time Reading']
},
{
name: 'rtclock',
type: 'opcode',
category: 'Instrument Control:Time Reading',
description: 'Read the real time clock from the operating system.',
syntax: 'ires = rtclock()\n kres = rtclock()',
example: '--8<-- "examples/rtclock.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Time Reading']
},
]

View File

@ -0,0 +1,52 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Amplitude Functions
export const mathematicalOperationsAmplitudeFunctions: CsoundReference[] = [
{
name: 'ampdb',
type: 'opcode',
category: 'Mathematical Operations:Amplitude Functions',
description: 'Returns the amplitude equivalent of the decibel value x. Thus:',
example: '--8<-- "examples/ampdb-modern.csd"',
seeAlso: ['Amplitude Converters']
},
{
name: 'ampdbfs',
type: 'opcode',
category: 'Mathematical Operations:Amplitude Functions',
description: 'Returns the amplitude equivalent (in 16-bit signed integer scale) of the full scale decibel (dB FS) value _x_.',
example: '--8<-- "examples/ampdbfs-modern.csd"',
seeAlso: ['Amplitude Converters']
},
{
name: 'db',
type: 'opcode',
category: 'Mathematical Operations:Amplitude Functions',
description: 'Returns the amplitude equivalent for a given decibel amount.',
example: '--8<-- "examples/db.csd"',
parameters: [
{
name: 'x',
description: 'a value expressed in decibels.',
type: 'initialization'
},
],
seeAlso: ['Amplitude Converters']
},
{
name: 'dbamp',
type: 'opcode',
category: 'Mathematical Operations:Amplitude Functions',
description: 'Returns the decibel equivalent of the raw amplitude _x_.',
example: '--8<-- "examples/dbamp.csd"',
seeAlso: ['Amplitude Converters']
},
{
name: 'dbfsamp',
type: 'opcode',
category: 'Mathematical Operations:Amplitude Functions',
description: 'Returns the decibel equivalent of the raw amplitude _x_, relative to full scale amplitude.',
example: '--8<-- "examples/dbfsamp.csd"',
seeAlso: ['Amplitude Converters']
},
]

View File

@ -0,0 +1,116 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Arithmetic and Logic Operations
export const mathematicalOperationsArithmeticAndLogicOperations: CsoundReference[] = [
{
name: 'adds',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Addition operator.',
example: '--8<-- "examples/adds-modern.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'divides',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Division operator.',
example: '--8<-- "examples/divides.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'modulus',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Modulus operator.',
example: '--8<-- "examples/modulus.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'multiplies',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Multiplication operator.',
example: '--8<-- "examples/multiplies.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opand',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Logical AND operator.',
example: '--8<-- "examples/opand.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opbitand',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Bitwise AND operator.',
example: '--8<-- "examples/bitwise-modern.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opbitnot',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Bitwise NOT operator.',
example: '--8<-- "examples/bitwise-group-modern.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opbitor',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Bitwise OR operator.',
example: '--8<-- "examples/bitwise-modern.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opbitshl',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Bitshift left operator.',
example: '--8<-- "examples/bitshift-modern.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opbitshr',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Bitshift right operator.',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opnonequiv',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Bitwise NON EQUIVALENCE operator.',
example: '--8<-- "examples/bitwise-group-modern.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opnot',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Logical NOT operator.',
example: '--8<-- "examples/opnot.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'opor',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: 'Logical OR operator.',
example: '--8<-- "examples/logicOR.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
{
name: 'raises',
type: 'opcode',
category: 'Mathematical Operations:Arithmetic and Logic Operations',
description: '&#8220;Power of&#8221; operator.',
example: '--8<-- "examples/raises.csd"',
seeAlso: ['Arithmetic and Logic Operations']
},
]

View File

@ -0,0 +1,65 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Arrays
export const mathematicalOperationsArrays: CsoundReference[] = [
{
name: 'cbrt',
type: 'opcode',
category: 'Mathematical Operations:Arrays',
description: 'Cubic root function.',
syntax: 'ires[] = cbrt(iarg)\n kres[] = cbrt(karg)',
example: '--8<-- "examples/cbrt-modern.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
{
name: 'fmax',
type: 'opcode',
category: 'Mathematical Operations:Arrays',
description: 'Returns the maximum of its two arguments.',
syntax: 'ires[] = fmax(iarg1[], iarg2[])\n kres[] = fmax(karg1[], karg2[])\n ires[] = fmax(iarg1[], iarg2)\n kres[] = fmax(karg[], karg2)',
example: '--8<-- "examples/fmax.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
{
name: 'fmin',
type: 'opcode',
category: 'Mathematical Operations:Arrays',
description: 'Returns the minimum of its two arguments.',
syntax: 'ires[] = fmin(iarg1[], iarg2[])\n kres[] = fmin(karg1[], karg2[])\n ires[] = fmin(iarg1[], iarg2)\n kres[] = fmin(karg[], karg2)',
example: '--8<-- "examples/fmin.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
{
name: 'fmod',
type: 'opcode',
category: 'Mathematical Operations:Arrays',
description: 'Computes the remainder of the division of its first argument by the second.',
syntax: 'ires[] = fmod(iarg1[], iarg2[])\n kres[] = fmod(karg1[], karg2[])\n ires[] = fmod(iarg1[], iarg2)\n kres[] = fmod(karg[], karg2)',
example: '--8<-- "examples/fmod.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
{
name: 'hypot',
type: 'opcode',
category: 'Mathematical Operations:Arrays',
description: 'Euclidean distance function.',
syntax: 'ires[] = hypot(iarg1[], iarg2[])\n kres[] = hypot(karg1[], karg2[])',
example: '--8<-- "examples/hypot.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
{
name: 'limit1',
type: 'opcode',
category: 'Mathematical Operations:Arrays',
description: 'Limits the value of an argument to the range [0,1].',
syntax: 'ires[] = limit1(iarg)\n kres[] = limit1(karg)',
example: '--8<-- "examples/limit1.csd"',
rates: ['k-rate', 'i-rate'],
seeAlso: ['Array opcodes']
},
]

View File

@ -0,0 +1,14 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Comparators and Accumulators
export const mathematicalOperationsComparatorsAndAccumulators: CsoundReference[] = [
{
name: 'clear',
type: 'opcode',
category: 'Mathematical Operations:Comparators and Accumulators',
description: 'Zeroes a list of audio signals.',
syntax: 'clear(avar1 [, avar2] [, avar3] [...])\n clear(avar[])',
example: '--8<-- "examples/clear-modern.csd"',
seeAlso: ['File Input and Output', 'Comparators and Accumulators']
},
]

View File

@ -0,0 +1,167 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Mathematical Functions
export const mathematicalOperationsMathematicalFunctions: CsoundReference[] = [
{
name: 'abs',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the absolute value of its input.',
example: '--8<-- "examples/abs-modern.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'arg',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the argument of a complex number.',
seeAlso: ['Mathematical Functions']
},
{
name: 'ceil',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the smallest integer not less than *x*.',
example: '--8<-- "examples/ceil-modern.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'complex',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns a complex number, optionally in polar form.',
seeAlso: ['Mathematical Functions']
},
{
name: 'conj',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the conjugate of a complex number.',
seeAlso: ['Mathematical Functions']
},
{
name: 'exp',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns e raised to the xth power.',
example: '--8<-- "examples/exp.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'floor',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the largest integer not greater than *x*.',
example: '--8<-- "examples/floor.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'frac',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the fractional part of a decimal number.',
example: '--8<-- "examples/frac.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'imag',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the imaginary part of a complex number.',
seeAlso: ['Mathematical Functions']
},
{
name: 'int',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Extracts an integer from a decimal number.',
example: '--8<-- "examples/int.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'log',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the natural log of _x_ (_x_ positive only).',
example: '--8<-- "examples/log.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'log10',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the base 10 log of _x_ (_x_ positive only).',
example: '--8<-- "examples/log10.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'log2',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the base 2 log of _x_ (_x_ positive only).',
example: '--8<-- "examples/log2.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'logbtwo',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Performs a logarithmic base two calculation.',
example: '--8<-- "examples/logbtwo.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'polar',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns a complex number in polar format.',
seeAlso: ['Mathematical Functions']
},
{
name: 'powoftwo',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Performs a power-of-two calculation.',
example: '--8<-- "examples/powoftwo.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'qinf',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the number of times the argument is not a number, with the sign of the first infinity.',
example: '--8<-- "examples/qinf.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'qnan',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the number of times the argument is not a number.',
example: '--8<-- "examples/qnan.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'real',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the real part of a complex number.',
seeAlso: ['Mathematical Functions']
},
{
name: 'round',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the integer value nearest to _x_.',
example: '--8<-- "examples/round.csd"',
seeAlso: ['Mathematical Functions']
},
{
name: 'sqrt',
type: 'opcode',
category: 'Mathematical Operations:Mathematical Functions',
description: 'Returns the square root of _x_ (_x_ non-negative).',
example: '--8<-- "examples/sqrt.csd"',
seeAlso: ['Mathematical Functions']
},
]

View File

@ -0,0 +1,101 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Opcode Equivalents of Functions
export const mathematicalOperationsOpcodeEquivalentsOfFunctions: CsoundReference[] = [
{
name: 'divz',
type: 'opcode',
category: 'Mathematical Operations:Opcode Equivalents of Functions',
description: 'Safely divides two numbers.',
example: '--8<-- "examples/divz.csd"',
seeAlso: ['Opcode Equivalents of Functions']
},
{
name: 'mac',
type: 'opcode',
category: 'Mathematical Operations:Opcode Equivalents of Functions',
description: 'Multiplies and accumulates a- and k-rate signals.',
syntax: 'ares = mac(ksig1, asig1 [, ksig2] [, asig2] [, ksig3] [, asig3] [...])',
example: '--8<-- "examples/mac.csd"',
rates: ['a-rate'],
seeAlso: ['Opcode Equivalents of Functions']
},
{
name: 'maca',
type: 'opcode',
category: 'Mathematical Operations:Opcode Equivalents of Functions',
description: 'Multiply and accumulate a-rate signals only.',
syntax: 'ares = maca(asig1 , asig2 [, asig3] [, asig4] [, asig5] [...])',
example: '--8<-- "examples/maca.csd"',
rates: ['a-rate'],
seeAlso: ['Opcode Equivalents of Functions']
},
{
name: 'polynomial',
type: 'opcode',
category: 'Mathematical Operations:Opcode Equivalents of Functions',
description: 'Efficiently evaluates a polynomial of arbitrary order.',
syntax: 'aout = polynomial(ain, k0 [, k1 [, k2 [...]]])',
example: '--8<-- "examples/polynomial.csd"',
parameters: [
{
name: 'ain',
description: 'the input signal used as the independent variable of the polynomial ("x").',
type: 'performance'
},
{
name: 'aout',
description: 'the output signal ("y").',
type: 'performance'
},
],
seeAlso: ['Waveshaping', 'Opcode Equivalents of Functions']
},
{
name: 'pow',
type: 'opcode',
category: 'Mathematical Operations:Opcode Equivalents of Functions',
description: 'Computes one argument to the power of another argument and scales the result.',
syntax: 'ares = pow(aarg, k= pow([, inorm])\n ires = pow(iarg, i= pow([, inorm])\n kres = pow(karg, k= pow([, inorm])\n ires[] = pow(iarg[], ipow[])\n kres[] = pow(karg[], kpow[])\n ires[] = pow(iarg[], ipow)\n kres[] = pow(karg[], kpow)',
example: '--8<-- "examples/pow.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'aarg',
description: 'the base.',
type: 'performance'
},
{
name: 'iarg',
description: 'the base.',
type: 'performance'
},
{
name: 'karg',
description: 'the base.',
type: 'performance'
},
{
name: 'ipow',
description: 'the exponent.',
type: 'performance'
},
{
name: 'kpow',
description: 'the exponent.',
type: 'performance'
},
],
seeAlso: ['Mathematical Functions', 'Opcode Equivalents of Functions']
},
{
name: 'product',
type: 'opcode',
category: 'Mathematical Operations:Opcode Equivalents of Functions',
description: 'Multiplies any number of a-rate signals.',
syntax: 'ares = product(asig1, asig2 [, asig3] [...])',
example: '--8<-- "examples/product.csd"',
rates: ['a-rate'],
seeAlso: ['Opcode Equivalents of Functions']
},
]

View File

@ -0,0 +1,21 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Random Functions
export const mathematicalOperationsRandomFunctions: CsoundReference[] = [
{
name: 'birnd',
type: 'opcode',
category: 'Mathematical Operations:Random Functions',
description: 'Returns a random number in a bi-polar range.',
example: '--8<-- "examples/birnd-modern.csd"',
seeAlso: ['Random Functions']
},
{
name: 'rnd',
type: 'opcode',
category: 'Mathematical Operations:Random Functions',
description: 'Returns a random number in a unipolar range at the rate given by the input argument.',
example: '--8<-- "examples/rnd.csd"',
seeAlso: ['Random Functions']
},
]

View File

@ -0,0 +1,61 @@
import type { CsoundReference } from './types'
// Mathematical Operations:Trigonometric Functions
export const mathematicalOperationsTrigonometricFunctions: CsoundReference[] = [
{
name: 'cos',
type: 'opcode',
category: 'Mathematical Operations:Trigonometric Functions',
description: 'Returns the cosine of _x_ (_x_ in radians).',
example: '--8<-- "examples/cos.csd"',
seeAlso: ['Trigonometric Functions']
},
{
name: 'cosh',
type: 'opcode',
category: 'Mathematical Operations:Trigonometric Functions',
description: 'Returns the hyperbolic cosine of _x_ (_x_ in radians).',
example: '--8<-- "examples/cosh.csd"',
seeAlso: ['Trigonometric Functions']
},
{
name: 'cosinv',
type: 'opcode',
category: 'Mathematical Operations:Trigonometric Functions',
description: 'Returns the arccosine of _x_ (_x_ in radians).',
example: '--8<-- "examples/cosinv.csd"',
seeAlso: ['Trigonometric Functions']
},
{
name: 'signum',
type: 'opcode',
category: 'Mathematical Operations:Trigonometric Functions',
description: 'Returns the signum of _x_ returning -1, 0 or 1.',
example: '--8<-- "examples/signum.csd"',
seeAlso: ['Trigonometric Functions']
},
{
name: 'sin',
type: 'opcode',
category: 'Mathematical Operations:Trigonometric Functions',
description: 'Returns the sine of _x_ (_x_ in radians).',
example: '--8<-- "examples/sin.csd"',
seeAlso: ['Trigonometric Functions']
},
{
name: 'sinh',
type: 'opcode',
category: 'Mathematical Operations:Trigonometric Functions',
description: 'Returns the hyperbolic sine of _x_ (_x_ in radians).',
example: '--8<-- "examples/sinh.csd"',
seeAlso: ['Trigonometric Functions']
},
{
name: 'sininv',
type: 'opcode',
category: 'Mathematical Operations:Trigonometric Functions',
description: 'Returns the arcsine of _x_ (_x_ in radians).',
example: '--8<-- "examples/sininv.csd"',
seeAlso: ['Trigonometric Functions']
},
]

View File

@ -0,0 +1,21 @@
import type { CsoundReference } from './types'
// MIDI files:MIDI input and Initialization
export const midiFilesMidiInputAndInitialization: CsoundReference[] = [
{
name: 'eventtype',
type: 'opcode',
category: 'MIDI files:MIDI input and Initialization',
description: 'Returns the event type for an instrument.',
syntax: 'type:i = eventtype()',
seeAlso: ['MIDI input and Initialization']
},
{
name: 'midifilestatus',
type: 'opcode',
category: 'MIDI files:MIDI input and Initialization',
description: 'Returns the playback status of MIDI file input.',
syntax: 'status:k = midifilestatus([id:k])',
seeAlso: ['MIDI input and Initialization']
},
]

View File

@ -0,0 +1,187 @@
import type { CsoundReference } from './types'
// Miscellaneous
export const miscellaneous: CsoundReference[] = [
{
name: 'directory',
type: 'opcode',
category: 'Miscellaneous',
description: 'Reads a directory and outputs to a string array a list of file names.',
syntax: 'SFiles[] = directory(SDirectory [, SExtention])',
example: '--8<-- "examples/directory.csd"',
parameters: [
{
name: 'SDirectory',
description: 'a string that identifies the directory to browse for files',
type: 'initialization'
},
{
name: 'SExtention',
description: 'Optional. Sets the desired file type. If left out, all files names will be retrieved.',
type: 'initialization'
},
],
seeAlso: ['Miscellaneous opcodes']
},
{
name: 'framebuffer',
type: 'opcode',
category: 'Miscellaneous',
description: 'Read audio signals into 1 dimensional k-rate arrays and vice-versa with a specified buffer size.',
syntax: 'kout[] = framebuffer(ain, isize)\n aout = framebuffer(kin, isize)',
example: '--8<-- "examples/framebuffer.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'isize',
description: 'The amount of samples that the buffer will contain.',
type: 'initialization'
},
{
name: 'ain',
description: 'The audio signal input to the framebuffer.',
type: 'performance'
},
{
name: 'aout',
description: 'The audio signal output from the framebuffer. _kin_ -- The k-rate array input to the framebuffer.',
type: 'performance'
},
],
seeAlso: ['Array-based spectral opcodes']
},
{
name: 'modmatrix',
type: 'opcode',
category: 'Miscellaneous',
description: 'Modulation matrix opcode with optimizations for sparse matrices.',
syntax: 'modmatrix(iresfn, isrcmodfn, isrcparmfn, imodscale, inum_mod, \\\n inum_parm, kupdate)',
example: '--8<-- "examples/modmatrix.csd"',
parameters: [
{
name: 'iresfn',
description: 'ftable number for the parameter output variables',
type: 'initialization'
},
{
name: 'isrcmodfn',
description: 'ftable number for the modulation source variables',
type: 'initialization'
},
{
name: 'isrcparmfn',
description: 'ftable number for the parameter input variables',
type: 'initialization'
},
{
name: 'imodscale',
description: 'scaling/routing coefficient matrix. This is also a csound ftable, used as a matrix of inum_mod rows and inum_parm columns.',
type: 'initialization'
},
{
name: 'inum_mod',
description: 'number of modulation variables',
type: 'initialization'
},
{
name: 'inum_parm',
description: 'number of parmeter (input and output) variables.',
type: 'initialization'
},
{
name: 'kupdate',
description: 'flag to update the scaling coefficients. When the flag is set to a nonzero value, the scaling coefficients are read directly from the imodscale ftable. When the flag is set to zero, the scaling coefficients are scanned, and an optimized scaling matrix stored internally in the opcode.',
type: 'performance'
},
],
seeAlso: ['Miscellaneous opcodes']
},
{
name: 'nchnls_hw',
type: 'opcode',
category: 'Miscellaneous',
description: 'Returns the number of audio channels in the underlying hardware.',
syntax: 'idacc, iadcc = nchnls_hw()',
example: '--8<-- "examples/nchnls_hw.csd"',
seeAlso: ['Miscellaneous opcodes']
},
{
name: 'olabuffer',
type: 'opcode',
category: 'Miscellaneous',
description: 'Sum overlapping frames of audio as k-rate arrays and read as an audio signal.',
syntax: 'aout = olabuffer(kin, ioverlap)',
example: '--8<-- "examples/framebuffer.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'ioverlap',
description: 'The amount of overlaps per k-array input frame sample size. For example for an input window size of 1024, and a hop size of 256 the overlap factor would be 4. The overlap factor must be larger than or equal to ksmps and must also be an integer multiple of the input k-rate array sample count.',
type: 'initialization'
},
{
name: 'aout',
description: 'The resulting audio signal from the added input frames.',
type: 'performance'
},
{
name: 'kin',
description: 'A k-rate array containing sequential frames of audio.',
type: 'performance'
},
],
seeAlso: ['Array-based spectral opcodes']
},
{
name: 'pwd',
type: 'opcode',
category: 'Miscellaneous',
description: 'Asks the underlying operating system for the current directory (folder) name as a string.',
syntax: 'Sres = pwd()',
example: '--8<-- "examples/pwd.csd"',
parameters: [
{
name: 'Sres',
description: 'the returned string.',
type: 'performance'
},
],
seeAlso: ['Miscellaneous opcodes']
},
{
name: 'select',
type: 'opcode',
category: 'Miscellaneous',
description: 'Select sample value from three based on audio-rate comparisons of two signals.',
syntax: 'aout = select(a1, a2, aless, aequal, amore)',
example: '--8<-- "examples/select.csd"',
parameters: [
{
name: 'a1',
description: 'audio signals that are compared.',
type: 'performance'
},
{
name: 'a2',
description: 'audio signals that are compared.',
type: 'performance'
},
{
name: 'aless',
description: 'audio signal selected if a1[n]&lt;a2[n]',
type: 'performance'
},
{
name: 'aequal',
description: 'audio signal selected if a1[n]=a2[n]',
type: 'performance'
},
{
name: 'asig',
description: 'audio signal selected if a1[n]&gt;a2[n]',
type: 'performance'
},
],
seeAlso: ['Miscellaneous opcodes']
},
]

View File

@ -0,0 +1,149 @@
import type { CsoundReference } from './types'
// Mixer Opcodes
export const mixerOpcodes: CsoundReference[] = [
{
name: 'MixerClear',
type: 'opcode',
category: 'Mixer Opcodes',
description: 'Resets all channels of a buss to 0.',
syntax: 'MixerClear()',
example: 'instr 220 ; Master output\n ; It applies a bass enhancement, compression and fadeout\n ; to the whole piece, outputs signals, and clears the mixer.\n a1 MixerReceive 220, 0\n a2 MixerReceive 220, 1\n ; Bass enhancement\n al1 butterlp a1, 100\n al2 butterlp a2, 100\n a1 = al1*1.5 + a1\n a2 = al2*1.5 + a2 \n\n ; Global amplitude shape\n kenv linseg 0., p5 / 2.0, p4, p3 - p5, p4, p5 / 2.0, 0.\n a1=a1*kenv\n a2=a2*kenv \n \n ; Compression\n a1 dam a1, 5000, 0.5, 1, 0.2, 0.1 \n a2 dam a2, 5000, 0.5, 1, 0.2, 0.1 \n \n ; Remove DC bias\n a1blocked dcblock\t\ta1\n a2blocked\tdcblock\t\ta2\n \n ; Output signals\n outs a1blocked, a2blocked\n MixerClear\nendin',
seeAlso: ['Mixer Opcodes']
},
{
name: 'MixerGetLevel',
type: 'opcode',
category: 'Mixer Opcodes',
description: 'Gets the level at which signals from the send are being added to the buss.',
syntax: 'kgain = MixerGetLevel(isend, ibuss)',
example: '--8<-- "examples/Mixer.csd"',
parameters: [
{
name: 'isend',
description: 'The number of the send, for example the number of the instrument sending the signal.',
type: 'initialization'
},
{
name: 'ibuss',
description: 'The number of the buss, for example the number of the instrument receiving the signal.',
type: 'initialization'
},
{
name: 'kgain',
description: 'The level (any real number) at which the signal from the send will be mixed onto the buss.',
type: 'performance'
},
],
seeAlso: ['Mixer Opcodes']
},
{
name: 'MixerReceive',
type: 'opcode',
category: 'Mixer Opcodes',
description: 'Receives an arate signal that has been mixed onto a channel of a buss.',
syntax: 'asignal = MixerReceive(ibuss, ichannel)',
example: 'instr 220 ; Master output\n ; It applies a bass enhancement, compression and fadeout\n ; to the whole piece, outputs signals, and clears the mixer.\n a1 MixerReceive 220, 0\n a2 MixerReceive 220, 1\n ; Bass enhancement\n al1 butterlp a1, 100\n al2 butterlp a2, 100\n a1 = al1*1.5 + a1\n a2 = al2*1.5 + a2 \n\n ; Global amplitude shape\n kenv linseg 0., p5 / 2.0, p4, p3 - p5, p4, p5 / 2.0, 0.\n a1=a1*kenv\n a2=a2*kenv \n \n ; Compression\n a1 dam a1, 5000, 0.5, 1, 0.2, 0.1 \n a2 dam a2, 5000, 0.5, 1, 0.2, 0.1 \n \n ; Remove DC bias\n a1blocked dcblock\t\ta1\n a2blocked\tdcblock\t\ta2\n \n ; Output signals\n outs a1blocked, a2blocked\n MixerClear\nendin',
parameters: [
{
name: 'ibuss',
description: 'The number of the buss, for example the number of the instrument receiving the signal.',
type: 'initialization'
},
{
name: 'ichannel',
description: 'The number of the channel. Each buss has _nchnls_ channels.',
type: 'initialization'
},
{
name: 'asignal',
description: 'The signal that has been mixed onto the indicated channel of the buss.',
type: 'performance'
},
],
seeAlso: ['Mixer Opcodes']
},
{
name: 'MixerSend',
type: 'opcode',
category: 'Mixer Opcodes',
description: 'Mixes an arate signal into a channel of a buss.',
syntax: 'MixerSend(asignal, isend, ibuss, ichannel)',
example: 'instr 100 ; Fluidsynth output\n; INITIALIZATION\n; Normalize so iamplitude for p5 of 80 == ampdb(80).\niamplitude \t\t= \t\t\tampdb(p5) * 2.0\n; AUDIO\naleft, aright \t\tfluidAllOut\t\tgiFluidsynth\nasig1 \t\t\t= \t\t\taleft * iamplitude\nasig2 \t\t\t= \t\t\taright * iamplitude\n\t\t\t; To the chorus.\n\t\t\tMixerSend\t\tasig1, 100, 200, 0\n\t\t\tMixerSend\t\tasig2, 100, 200, 1\n\t\t\t; To the reverb.\n\t\t\tMixerSend\t\tasig1, 100, 210, 0\n\t\t\tMixerSend\t\tasig2, 100, 210, 1\n\t\t\t; To the output.\n\t\t\tMixerSend\t\tasig1, 100, 220, 0\n\t\t\tMixerSend\t\tasig2, 100, 220, 1\nendin',
parameters: [
{
name: 'isend',
description: 'The number of the send, for example the number of the instrument sending the signal. The gain of the send is controlled by the [MixerSetLevel](../opcodes/mixersetlevel.md) opcode. The reason that the sends are numbered is to enable different levels for different sends to be set independently of the actual level of the signals.',
type: 'initialization'
},
{
name: 'ibuss',
description: 'The number of the buss, for example the number of the instrument receiving the signal.',
type: 'initialization'
},
{
name: 'ichannel',
description: 'The number of the channel. Each buss has <literal>nchnls</literal> channels.',
type: 'initialization'
},
{
name: 'asignal',
description: 'The signal that will be mixed into the indicated channel of the buss.',
type: 'performance'
},
],
seeAlso: ['Mixer Opcodes']
},
{
name: 'MixerSetLevel',
type: 'opcode',
category: 'Mixer Opcodes',
description: 'Sets the level at which signals from the send are added to the buss. Plugin opcode in mixer',
syntax: 'MixerSetLevel(isend, ibuss, kgain)',
example: 'instr 1\n\tMixerSetLevel\t\tp4, p5, p6\nendin',
parameters: [
{
name: 'isend',
description: 'The number of the send, for example the number of the instrument sending the signal (but any integer can be used).',
type: 'initialization'
},
{
name: 'ibuss',
description: 'The number of the buss, for example the number of the instrument receiving the signal (but any integer can be used).',
type: 'initialization'
},
{
name: 'kgain',
description: 'The level (any real number) at which the signal from the send will be mixed onto the buss. The default is 0.',
type: 'performance'
},
],
seeAlso: ['Mixer Opcodes']
},
{
name: 'MixerSetLevel_i',
type: 'opcode',
category: 'Mixer Opcodes',
description: 'Sets the level at which signals from the send are added to the buss.',
syntax: 'MixerSetLevel_i(isend, ibuss, igain)',
example: 'MixerSetLevel_i\t\t3, 4, 0.76',
parameters: [
{
name: 'isend',
description: 'The number of the send, for example the number of the instrument sending the signal (but any integer can be used).',
type: 'initialization'
},
{
name: 'ibuss',
description: 'The number of the buss, for example the number of the instrument receiving the signal (but any integer can be used).',
type: 'initialization'
},
{
name: 'igain',
description: 'The level (any real number) at which the signal from the send will be mixed onto the buss. The default is 0.',
type: 'initialization'
},
],
seeAlso: ['Mixer Opcodes']
},
]

View File

@ -0,0 +1,124 @@
import type { CsoundReference } from './types'
// Network
export const network: CsoundReference[] = [
{
name: 'remoteport',
type: 'opcode',
category: 'Network',
description: 'Defines the port for use with the _insremot_, _midremot_, _insglobal_ and _midglobal_ opcodes.',
syntax: 'remoteport(iportnum)',
parameters: [
{
name: 'iportnum',
description: 'number of the port to be used. If zero or negative the default port 40002 is selected.',
type: 'initialization'
},
],
seeAlso: ['Remote Opcodes']
},
{
name: 'sockrecv',
type: 'opcode',
category: 'Network',
description: 'Receives data from other processes using the low-level UDP or TCP protocols.',
syntax: 'asig = sockrecv(iport, ilength)\n ksig = sockrecv(iport, ilength)\n asigl, asigr = sockrecvs(iport, ilength)\n String = sockrecv(iport, ilength)\n asig [,kstate] = strecv(Sipaddr, iport)',
example: 'sr = 44100\n ksmps = 100\n nchnls = 1\n\n\n instr 1\n a1 sockrecv 7777, 200\n out a1\n endin',
rates: ['a-rate'],
parameters: [
{
name: 'Sipaddr',
description: 'a string that is the IP address of the sender in standard 4-octet dotted form.',
type: 'initialization'
},
{
name: 'iport',
description: 'the number of the port that is used for the communication.',
type: 'initialization'
},
{
name: 'ilength',
description: 'the length of the individual packets in UDP transmission. This number must be sufficiently small to fit a single MTU, which is set to the save value of 1456. In UDP transmissions the sender and receiver needs agree on this value',
type: 'initialization'
},
{
name: 'asig',
description: 'audio data to be received.',
type: 'performance'
},
{
name: 'asigl',
description: 'audio data to be received.',
type: 'performance'
},
{
name: 'asigr',
description: 'audio data to be received.',
type: 'performance'
},
{
name: 'ksig',
description: 'control data to be received.',
type: 'performance'
},
{
name: 'String',
description: 'string data to be received.',
type: 'performance'
},
{
name: 'kstate',
description: 'optional output to give the state of the receipt. Gives the number of bytes transferred in the current performance cycle or -1 if the sender has ceased writing.',
type: 'performance'
},
],
seeAlso: ['Network']
},
{
name: 'socksend',
type: 'opcode',
category: 'Network',
description: 'Sends data to other processes using the low-level UDP or TCP protocols.',
syntax: 'socksend(asig, Sipaddr, iport, ilength)\n socksend(ksig, Sipaddr, iport, ilength)\n socksends(asigl, asigr, Sipaddr, iport, ilength)\n stsend(asig, Sipaddr, iport)',
example: 'sr = 44100\n ksmps = 100\n nchnls = 1\n\n\n instr 1\n a1 oscil 20000,441,1\n socksend a1, "172.16.0.255",7777, 200\n endin',
rates: ['a-rate'],
parameters: [
{
name: 'Sipaddr',
description: 'a string that is the IP address of the receiver in standard 4-octet dotted form.',
type: 'initialization'
},
{
name: 'iport',
description: 'the number of the port that is used for the communication.',
type: 'initialization'
},
{
name: 'ilength',
description: 'the length of the individual packets in UDP transmission. This number must be sufficiently small to fit a single MTU, which is set to the save value of 1456. In UDP transmissions the receiver needs to know this value',
type: 'initialization'
},
{
name: 'asig',
description: 'data to be transmitted.',
type: 'performance'
},
{
name: 'ksig',
description: 'data to be transmitted.',
type: 'performance'
},
{
name: 'asigl',
description: 'data to be transmitted.',
type: 'performance'
},
{
name: 'asigr',
description: 'data to be transmitted.',
type: 'performance'
},
],
seeAlso: ['Network']
},
]

View File

@ -0,0 +1,54 @@
import type { CsoundReference } from './types'
// Orchestra Syntax:Block Statements
export const orchestraSyntaxBlockStatements: CsoundReference[] = [
{
name: 'endin',
type: 'opcode',
category: 'Orchestra Syntax:Block Statements',
description: 'Ends the current instrument block.',
example: '--8<-- "examples/endin.csd"',
seeAlso: ['Instrument Statements']
},
{
name: 'endop',
type: 'opcode',
category: 'Orchestra Syntax:Block Statements',
description: 'Marks the end of an user-defined opcode block.',
example: '--8<-- "examples/endop.csd"',
seeAlso: ['User Defined Opcodes (UDO)', 'http://www.csoundjournal.com/2006summer/controlFlow_part2.html', 'http://www.csounds.com/udo/']
},
{
name: 'instr',
type: 'opcode',
category: 'Orchestra Syntax:Block Statements',
description: 'Starts an instrument block.',
example: '--8<-- "examples/instr.csd"',
seeAlso: ['Instrument Statements']
},
{
name: 'opcode',
type: 'opcode',
category: 'Orchestra Syntax:Block Statements',
description: 'Defines the start of user-defined opcode block.',
example: '--8<-- "examples/opcode.csd"',
parameters: [
{
name: 'name',
description: 'name of the opcode. It may consist of any combination of letters, digits, and underscore but should not begin with a digit. If an opcode with the specified name already exists, it is redefined (a warning is printed in such cases). Some reserved words (like _instr_ and _endin_) cannot be redefined.',
type: 'initialization'
},
{
name: 'intypes',
description: 'list of input types, any combination of the characters: a, f, k, O, P, V, K, i, o, p, and j. A single 0 character can be used if there are no input arguments. Double quotes and delimiter characters (e.g. comma) are _not_ needed.',
type: 'initialization'
},
{
name: 'outtypes',
description: 'list of output types. The format is the same as in the case of _intypes_.',
type: 'initialization'
},
],
seeAlso: ['User Defined Opcodes (UDO)']
},
]

View File

@ -0,0 +1,68 @@
import type { CsoundReference } from './types'
// Orchestra Syntax:Header
export const orchestraSyntaxHeader: CsoundReference[] = [
{
name: 'Zerodbfs',
type: 'opcode',
category: 'Orchestra Syntax:Header',
description: 'Sets the value of 0 decibels using full scale amplitude.',
example: '--8<-- "examples/0dbfs-modern.csd"',
parameters: [
{
name: 'iarg',
description: 'the value of 0 decibels using full scale amplitude.',
type: 'initialization'
},
],
seeAlso: ['Orchestra Header Statements']
},
{
name: 'A4',
type: 'opcode',
category: 'Orchestra Syntax:Header',
description: 'Sets the base frequency for pitch A4.',
example: '--8<-- "examples/A4-modern.csd"',
seeAlso: ['Orchestra Header Statements']
},
{
name: 'kr',
type: 'opcode',
category: 'Orchestra Syntax:Header',
description: 'Sets the control rate.',
example: 'sr = 10000\nkr = 500\nksmps = 20\ngi1 = sr/2.\nga init 0\nitranspose = octpch(.0l)',
seeAlso: ['Orchestra Header Statements']
},
{
name: 'ksmps',
type: 'opcode',
category: 'Orchestra Syntax:Header',
description: 'Sets the number of samples in a control period.',
example: '--8<-- "examples/ksmps.csd"',
seeAlso: ['Orchestra Header Statements']
},
{
name: 'nchnls',
type: 'opcode',
category: 'Orchestra Syntax:Header',
description: 'Sets the number of channels of audio output.',
example: '--8<-- "examples/nchnls.csd"',
seeAlso: ['Orchestra Header Statements']
},
{
name: 'nchnls_i',
type: 'opcode',
category: 'Orchestra Syntax:Header',
description: 'Sets the number of channels of audio input.',
example: '--8<-- "examples/nchnls_i.csd"',
seeAlso: ['Orchestra Header Statements']
},
{
name: 'sr',
type: 'opcode',
category: 'Orchestra Syntax:Header',
description: 'Sets the audio sampling rate.',
example: 'sr = 10000\nkr = 500\nksmps = 20\ngi1 = sr/2.\nga init 0\nitranspose = octpch(.0l)',
seeAlso: ['Orchestra Header Statements']
},
]

View File

@ -0,0 +1,45 @@
import type { CsoundReference } from './types'
// Orchestra Syntax:Macros
export const orchestraSyntaxMacros: CsoundReference[] = [
{
name: 'define',
type: 'opcode',
category: 'Orchestra Syntax:Macros',
description: 'Defines a macro.',
example: '--8<-- "examples/define.csd"',
seeAlso: ['Orchestra Macros']
},
{
name: 'dollar',
type: 'opcode',
category: 'Orchestra Syntax:Macros',
description: 'Calls a defined macro.',
example: '--8<-- "examples/define.csd"',
seeAlso: ['Orchestra Macros']
},
{
name: 'ifdef',
type: 'opcode',
category: 'Orchestra Syntax:Macros',
description: 'Conditional reading of code.',
example: '#define debug ##\n instr 1\n#ifdef debug\n print "calling oscil"\n#end\n a1 oscil 32000,440,1\n out a1\n endin',
seeAlso: ['Orchestra Macros']
},
{
name: 'ifndef',
type: 'opcode',
category: 'Orchestra Syntax:Macros',
description: 'Conditional reading of code.',
example: '#define final ##\n instr 1\n#ifndef final\n print "calling oscil"\n#end\n a1 oscil 32000,440,1\n out a1\n endin',
seeAlso: ['Orchestra Macros']
},
{
name: 'include',
type: 'opcode',
category: 'Orchestra Syntax:Macros',
description: 'Includes an external file for processing.',
example: '/* table1.inc */\n; Table #1, a sine wave.\nf 1 0 16384 10 1\n/* table1.inc */',
seeAlso: ['Orchestra Macros']
},
]

View File

@ -0,0 +1,187 @@
import type { CsoundReference } from './types'
// OSC
export const osc: CsoundReference[] = [
{
name: 'OSCbundle',
type: 'opcode',
category: 'OSC',
description: 'Sends data to other processes using the OSC protocol by packing messages in a bundle.',
syntax: 'OSCbundle(kwhen, ihost, iport, Sdest[], Stype[], kArgs[][] [, isize])',
example: '--8<-- "examples/oscbundle.csd"',
parameters: [
{
name: 'ihost',
description: 'a string that is the intended host computer domain name. An empty string is interpreted as the current computer.',
type: 'initialization'
},
{
name: 'iport',
description: 'the number of the port that is used for the communication.',
type: 'initialization'
},
{
name: 'isize',
description: 'maximum packet size in bytes, defaults to 65536.',
type: 'initialization'
},
{
name: 'kwhen',
description: 'a bundle of messages is sent whenever this value changes. A message will always be sent on the first call.',
type: 'performance'
},
],
seeAlso: ['OSC (Open Sound Control)', 'http://www.youtube.com/watch?v=JX1C3TqP_9Y']
},
{
name: 'OSCcount',
type: 'opcode',
category: 'OSC',
description: 'Gives the Count of OSC messages currently unread but received by the current listeners.',
syntax: 'kans = OSCcount()',
example: 'sr = 44100\n ksmps = 100\n nchnls = 2\n\n gihandle OSCinit 7770\n\n instr 1\n kf1 init 0\n kf2 init 0\n kk OSCcount\nnxtmsg:\n\nif (kk == 0) goto ex\n kr OSClisten gihandle, "/foo/bar", "ff", kf1, kf2\n printk 0,kf1\n printk 0,kf2\n kk -= 1\n kgoto nxtmsg\nex:\n endin',
parameters: [
{
name: 'kans',
description: 'set to the number of messages accepted by this Csound process to any address but not yet presented to a call of OSClisten.',
type: 'performance'
},
],
seeAlso: ['OSC (Open Sound Control)', 'http://www.youtube.com/watch?v=JX1C3TqP_9Y']
},
{
name: 'OSCinit',
type: 'opcode',
category: 'OSC',
description: 'Start a listening process for OSC messages to a particular port.',
syntax: 'ihandle = OSCinit(iport)',
example: 'sr = 44100\nksmps = 100\nnchnls = 2\n\ngihandle OSCinit 7770\n\n instr 1\n kf1 init 0\n kf2 init 0\nnxtmsg:\n kk OSClisten gihandle, "/foo/bar", "ff", kf1, kf2\nif (kk == 0) goto ex\n printk 0,kf1\n printk 0,kf2\n kgoto nxtmsg\nex:\n endin',
parameters: [
{
name: 'ihandle',
description: 'handle returned that can be passed to any number of OSClisten opcodes to receive messages on this port.',
type: 'initialization'
},
{
name: 'iport',
description: 'the port on which to listen.',
type: 'initialization'
},
],
seeAlso: ['OSC (Open Sound Control)', 'http://www.youtube.com/watch?v=JX1C3TqP_9Y']
},
{
name: 'OSCinitM',
type: 'opcode',
category: 'OSC',
description: 'Start a multicast listening process to a particular port, which can be used by OSClisten.',
syntax: 'ihandle = OSCinitM(Sgroup, iport)',
example: 'sr = 44100\nksmps = 100\nnchnls = 2\n\ngihandle OSCinitM "225.0.0.1", 7770\n\n instr 1\n kf1 init 0\n kf2 init 0\nnxtmsg:\n kk OSClisten gihandle, "/foo/bar", "ff", kf1, kf2\nif (kk == 0) goto ex\n printk 0,kf1\n printk 0,kf2\n kgoto nxtmsg\nex:\n endin',
parameters: [
{
name: 'Sgroup',
description: 'string giving the IP address of the multicast group.',
type: 'initialization'
},
{
name: 'ihandle',
description: 'handle returned that can be passed to any number of OSClisten opcodes to receive messages on this port.',
type: 'initialization'
},
{
name: 'iport',
description: 'the port on which to listen.',
type: 'initialization'
},
],
seeAlso: ['OSC (Open Sound Control)', 'http://www.youtube.com/watch?v=JX1C3TqP_9Y']
},
{
name: 'OSClisten',
type: 'opcode',
category: 'OSC',
description: 'Listen for OSC messages to a particular path, either from a custom-defined OSC server or from the Csound UDP server.',
syntax: 'kans = OSClisten(ihandle, idest, itype [, xdata1, xdata2, ...])\n kans, kdata[] = OSClisten(ihandle, idest, itype)\n kans, ... = OSClisten(idest, itype)',
example: 'sr = 44100\n ksmps = 100\n nchnls = 2\n\n gihandle OSCinit 7770\n\n instr 1\n kf1 init 0\n kf2 init 0\nnxtmsg:\n kk OSClisten gihandle, "/foo/bar", "ff", kf1, kf2\nif (kk == 0) goto ex\n printk 0,kf1\n printk 0,kf2\n kgoto nxtmsg\nex:\n endin',
parameters: [
{
name: 'ihandle',
description: 'In the first two versions (overloads) of the opcode, a handle returned by an earlier call to OSCinit, to associate OSClisten with a particular port number. The third overload does not take a handle as it will listen for messages sent to the Csound [UDP server](../overview/udp-server.md).',
type: 'initialization'
},
{
name: 'idest',
description: 'a string that is the destination address. This takes the form of a path prefixed with a forward slash, with optional subdirectories separated by forward slashes. Csound processes incoming messages that match this address.',
type: 'initialization'
},
{
name: 'itype',
description: 'a string that indicates the types of the optional arguments that are to be read. The string can contain the characters "acdfhisAG" which stand for audio, character, double, float, 64-bit integer, 32-bit integer, string, scalar array and f-table. All types other than \'asA\' require a k-rate variable; \'s\' requires a string variable, \'a\' an audio variable and \'A\' an i- or k- rate array. For type \'G\', a variable or constant can be used.',
type: 'initialization'
},
{
name: 'kans',
description: 'set to 1 if a new message was received, or 0 if not. If multiple messages are received in a single control period, the messages are buffered, and OSClisten can be called again until zero is returned.',
type: 'performance'
},
],
seeAlso: ['OSC (Open Sound Control)', 'http://www.youtube.com/watch?v=JX1C3TqP_9Y']
},
{
name: 'OSCraw',
type: 'opcode',
category: 'OSC',
description: 'Listen for all OSC messages at a given port.',
syntax: 'Smess[], klen = OSCraw(iport)',
example: '--8<-- "examples/OSCraw.csd"',
parameters: [
{
name: 'iport',
description: 'a port where messages are going to be received from.',
type: 'initialization'
},
{
name: 'klen',
description: 'number of items placed in the output array. It is 0 if no message has been received, and at least 2 if a message has been received (address, types are the minimum items).',
type: 'performance'
},
],
seeAlso: ['OSC (Open Sound Control)', 'http://www.youtube.com/watch?v=JX1C3TqP_9Y']
},
{
name: 'OSCsend',
type: 'opcode',
category: 'OSC',
description: 'Sends data to other listening processes using the OSC protocol.',
syntax: 'OSCsend(kwhen, ihost, iport, idestination [, itype , xdata1, xdata2, ...])',
example: 'instr 1\n OSCsend 1, "xenakis.cs.bath.ac.uk",7770, "/foo/bar", "sis", "FOO", 42, "bar"\n endin',
parameters: [
{
name: 'ihost',
description: 'a string that is the intended host computer domain name. An empty string is interpreted as the current computer.',
type: 'initialization'
},
{
name: 'iport',
description: 'the number of the port that is used for the communication.',
type: 'initialization'
},
{
name: 'idestination',
description: 'a string that is the destination address. This takes the form of a file name with directories. Csound just passes this string to the raw sending code and makes no interpretation.',
type: 'initialization'
},
{
name: 'itype',
description: 'a string that indicates the types of the optional arguments that are read at k-rate. The string can contain the characters "abcdfilmstAG" which stand for audio, Boolean, character, double, float, 32-bit integer, 64-bit integer, MIDI, string, timestamp, k-rate array and ftable. The OSC message may not have any types, in which case, it will consist only of the destination address.',
type: 'initialization'
},
{
name: 'kwhen',
description: 'a message is sent whenever this value changes. A message will always be sent on the first call.',
type: 'performance'
},
],
seeAlso: ['OSC (Open Sound Control)', 'http://www.youtube.com/watch?v=JX1C3TqP_9Y']
},
]

View File

@ -0,0 +1,280 @@
import type { CsoundReference } from './types'
// Pitch Converters:Functions
export const pitchConvertersFunctions: CsoundReference[] = [
{
name: 'cent',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Calculates a factor to raise/lower a frequency by a given amount of cents.',
example: '--8<-- "examples/cent-modern.csd"',
parameters: [
{
name: 'x',
description: 'a value expressed in cents.',
type: 'initialization'
},
],
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'cpsmidinn',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts a Midi note number value to cycles-per-second.',
example: '--8<-- "examples/cpsmidinn.csd"',
seeAlso: ['Pitch Converters: Functions', 'Midi Converters']
},
{
name: 'cpsoct',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts an octave-point-decimal value to cycles-per-second.',
example: '--8<-- "examples/cpsoct.csd"',
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'cpspch',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts a pitch-class value to cycles-per-second.',
example: '--8<-- "examples/cpspch.csd"',
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'ftom',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Convert frequency to midi note number, taking global value of A4 into account.',
syntax: 'imidi = ftom(ifreq [,irnd])\n kmidi = ftom(kfreq [,irnd])\n imidis[] = ftom(ifreqs[] [,irnd])\n kmidis[] = ftom(kfreqs[] [,irnd])',
example: '--8<-- "examples/mtof-ftom.csd"',
parameters: [
{
name: 'kfreq',
description: 'Frequency',
type: 'performance'
},
{
name: 'ifreq',
description: 'Frequency',
type: 'performance'
},
{
name: 'irnd',
description: 'Optional, if non-zero the result is rounded to the nearest integer (default zero).',
type: 'performance'
},
{
name: 'kmidi',
description: 'Corresponding midi note number',
type: 'performance'
},
{
name: 'imidi',
description: 'Corresponding midi note number',
type: 'performance'
},
],
seeAlso: ['Pitch Converters: Functions', 'Midi Converters']
},
{
name: 'mtof',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Convert a midi note number value to frequency, taking global value of A4 into account.',
syntax: 'ifreq = mtof(imidi)\n kfreq = mtof(kmidi)\n ifreqs[] = mtof(imidis[])\n kfreqs[] = mtof(kmidis[])',
example: '--8<-- "examples/mtof-ftom.csd"',
parameters: [
{
name: 'kmidi',
description: 'Midi note number (also as array)',
type: 'performance'
},
{
name: 'imidi',
description: 'Midi note number (also as array)',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency corresponding to midi note value. An array is returned if the input is an array',
type: 'performance'
},
{
name: 'ifreq',
description: 'Frequency corresponding to midi note value. An array is returned if the input is an array',
type: 'performance'
},
],
seeAlso: ['Pitch Converters: Functions', 'Midi Converters']
},
{
name: 'mton',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Convert midi note number to string note name, with an accuracy of 1 cent.',
syntax: 'Snote = mton(kmidi)\n Snote = mton(imidi)',
example: '--8<-- "examples/mton-ntom.csd"',
parameters: [
{
name: 'kmidi',
description: 'Midi note number',
type: 'performance'
},
{
name: 'imidi',
description: 'Midi note number',
type: 'performance'
},
{
name: 'Snote',
description: 'Note name',
type: 'performance'
},
],
seeAlso: ['Pitch Converters: Functions', 'Midi Converters']
},
{
name: 'ntof',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Convert note name to frequency.',
syntax: 'kfreq = ntof(Snote)\n ifreq = ntof(Snote)',
example: '--8<-- "examples/ntof.csd"',
parameters: [
{
name: 'Snote',
description: 'Note name',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency',
type: 'performance'
},
],
seeAlso: ['Pitch Converters: Functions', 'Midi Converters']
},
{
name: 'ntom',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Convert note name to midi note number.',
syntax: 'kmidi = ntom(Snote)\n imidi = ntom(Snote)',
example: '--8<-- "examples/mton-ntom.csd"',
parameters: [
{
name: 'Snote',
description: 'Note name',
type: 'performance'
},
{
name: 'kmidi',
description: 'Midi note number',
type: 'performance'
},
],
seeAlso: ['Pitch Converters: Functions', 'Midi Converters']
},
{
name: 'octave',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Calculates a factor to raise/lower a frequency by a given amount of octaves.',
example: '--8<-- "examples/octave.csd"',
parameters: [
{
name: 'x',
description: 'a value expressed in octaves.',
type: 'initialization'
},
],
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'octcps',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts a cycles-per-second value to octave-point-decimal.',
example: '--8<-- "examples/octcps.csd"',
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'octmidinn',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts a Midi note number value to octave-point-decimal.',
example: '--8<-- "examples/cpsmidinn.csd"',
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'octpch',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts a pitch-class value to octave-point-decimal.',
example: '--8<-- "examples/octpch.csd"',
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'pchmidinn',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts a Midi note number value to octave point pitch-class units.',
example: '--8<-- "examples/cpsmidinn.csd"',
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'pchoct',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Converts an octave-point-decimal value to pitch-class.',
example: '--8<-- "examples/pchoct.csd"',
seeAlso: ['Pitch Converters: Functions']
},
{
name: 'pchtom',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Convert pch to midi note number.',
syntax: 'imidi = pchtom(ipch)\n kmidi = pchtom(kpch)',
example: '--8<-- "examples/pchtom.csd"',
parameters: [
{
name: 'kpch',
description: 'pitch represented as Octave.pitchclass',
type: 'performance'
},
{
name: 'ipch',
description: 'pitch represented as Octave.pitchclass',
type: 'performance'
},
{
name: 'kmidi',
description: 'midi note number',
type: 'performance'
},
{
name: 'imidi',
description: 'midi note number',
type: 'performance'
},
],
seeAlso: ['Pitch Converters: Functions', 'Midi Converters']
},
{
name: 'semitone',
type: 'opcode',
category: 'Pitch Converters:Functions',
description: 'Calculates a factor to raise/lower a frequency by a given amount of semitones.',
example: '--8<-- "examples/semitone.csd"',
parameters: [
{
name: 'x',
description: 'a value expressed in semitones.',
type: 'initialization'
},
],
seeAlso: ['Pitch Converters: Functions']
},
]

View File

@ -0,0 +1,116 @@
import type { CsoundReference } from './types'
// Pitch Converters:Tuning Opcodes
export const pitchConvertersTuningOpcodes: CsoundReference[] = [
{
name: 'cps2pch',
type: 'opcode',
category: 'Pitch Converters:Tuning Opcodes',
description: 'Converts a pitch-class value into cycles-per-second (Hz) for equal divisions of the octave.',
syntax: 'icps = cps2pch(ipch, iequal)',
example: '--8<-- "examples/cps2pch.csd"',
parameters: [
{
name: 'ipch',
description: 'Input number of the form 8ve.pc, indicating an \'octave\' and which note in the octave.',
type: 'initialization'
},
{
name: 'iequal',
description: 'If positive, the number of equal intervals into which the \'octave\' is divided. Must be less than or equal to 100. If negative, is the number of a table of frequency multipliers.',
type: 'initialization'
},
],
seeAlso: ['Pitch Converters: Tuning Opcodes']
},
{
name: 'cpstun',
type: 'opcode',
category: 'Pitch Converters:Tuning Opcodes',
description: 'Returns micro-tuning values at k-rate.',
syntax: 'kcps = cpstun(ktrig, kindex, kfn)',
example: '--8<-- "examples/cpstun.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'kcps',
description: 'Return value in cycles per second.',
type: 'performance'
},
{
name: 'ktrig',
description: 'A trigger signal used to trigger the evaluation.',
type: 'performance'
},
{
name: 'kindex',
description: 'An integer number denoting an index of scale.',
type: 'performance'
},
{
name: 'kfn',
description: 'Function table containing the parameters (numgrades, interval, basefreq, basekeymidi) and the tuning ratios.',
type: 'performance'
},
],
seeAlso: ['Pitch Converters: Tuning Opcodes']
},
{
name: 'cpstuni',
type: 'opcode',
category: 'Pitch Converters:Tuning Opcodes',
description: 'Returns micro-tuning values at init-rate.',
syntax: 'icps = cpstuni(index, ifn)',
example: '--8<-- "examples/cpstuni.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'icps',
description: 'Return value in cycles per second.',
type: 'initialization'
},
{
name: 'index',
description: 'An integer number denoting an index of scale.',
type: 'initialization'
},
{
name: 'ifn',
description: 'Function table containing the parameters (numgrades, interval, basefreq, basekeymidi) and the tuning ratios.',
type: 'initialization'
},
],
seeAlso: ['Pitch Converters: Tuning Opcodes']
},
{
name: 'cpsxpch',
type: 'opcode',
category: 'Pitch Converters:Tuning Opcodes',
description: 'Converts a pitch-class value into cycles-per-second (Hz) for equal divisions of any interval.',
syntax: 'icps = cpsxpch(ipch, iequal, irepeat, ibase)',
example: '--8<-- "examples/cpsxpch.csd"',
parameters: [
{
name: 'ipch',
description: 'Input number of the form 8ve.pc, indicating an \'octave\' and which note in the octave.',
type: 'initialization'
},
{
name: 'iequal',
description: 'if positive, the number of equal intervals into which the \'octave\' is divided. Must be less than or equal to 100. If negative, is the number of a table of frequency multipliers.',
type: 'initialization'
},
{
name: 'irepeat',
description: 'Number indicating the interval which is the \'octave.\' The integer 2 corresponds to octave divisions, 3 to a twelfth, 4 is two octaves, and so on. This need not be an integer, but must be positive.',
type: 'initialization'
},
{
name: 'ibase',
description: 'The frequency which corresponds to pitch 0.0',
type: 'initialization'
},
],
seeAlso: ['Pitch Converters: Tuning Opcodes']
},
]

View File

@ -0,0 +1,176 @@
import type { CsoundReference } from './types'
// Real-time MIDI:Converters
export const realTimeMidiConverters: CsoundReference[] = [
{
name: 'ampmidi',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get the velocity of the current MIDI event.',
syntax: 'iamp = ampmidi(iscal [, ifn])',
example: '--8<-- "examples/ampmidi-modern.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'iscal',
description: 'i-time scaling factor',
type: 'initialization'
},
],
seeAlso: ['Midi Converters']
},
{
name: 'ampmidicurve',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Maps an input MIDI velocity number to an output gain factor with a maximum value of 1, modifying the output gain by a dynamic range and a shaping exponent.',
syntax: 'igain = ampmidicurve(ivelocity, idynamicrange, iexponent)\n kgain = ampmidicurve(kvelocity, kdynamicrange, kexponent)',
example: '--8<-- "examples/ampmidicurve-modern.csd"',
parameters: [
{
name: 'imidivelocity',
description: 'MIDI velocity number, ranging from 0 through 127.',
type: 'initialization'
},
{
name: 'idynamicrange',
description: 'Intended dynamic range of gain, from 0 through 1.',
type: 'initialization'
},
{
name: 'iexponent',
description: 'Exponent applied to shape the gain response curve, 1 or greater.',
type: 'initialization'
},
{
name: 'kmidivelocity',
description: 'MIDI velocity number, ranging from 0 through 127.',
type: 'performance'
},
{
name: 'kdynamicrange',
description: 'Intended dynamic range of gain, from 0 through 1.',
type: 'performance'
},
{
name: 'kexponent',
description: 'Exponent applied to shape the gain response curve, 1 or greater.',
type: 'performance'
},
],
seeAlso: ['Midi Converters']
},
{
name: 'ampmidid',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Musically map MIDI velocity to peak amplitude within a specified dynamic range in decibels.',
syntax: 'iamplitude = ampmidid(ivelocity, idecibels)\n kamplitude = ampmidid(kvelocity, idecibels)',
example: '--8<-- "examples/ampmidid-modern.csd"',
parameters: [
{
name: 'iamplitude',
description: 'Amplitude.',
type: 'initialization'
},
{
name: 'ivelocity',
description: 'MIDI velocity number, ranging from 0 through 127.',
type: 'initialization'
},
{
name: 'idecibels',
description: 'Desired dynamic range in decibels.',
type: 'initialization'
},
{
name: 'kamplitude',
description: 'Amplitude.',
type: 'performance'
},
{
name: 'kvelocity',
description: 'MIDI velocity number, ranging from 0 through 127.',
type: 'performance'
},
],
seeAlso: ['Midi Converters']
},
{
name: 'cpsmidi',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get the note number of the current MIDI event, expressed in cycles-per-second.',
syntax: 'icps = cpsmidi()',
example: '--8<-- "examples/cpsmidi.csd"',
seeAlso: ['Midi Converters']
},
{
name: 'cpsmidib',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in cycles-per-second.',
syntax: 'icps = cpsmidib([irange])\n kcps = cpsmidib([irange])',
example: '--8<-- "examples/cpsmidib.csd"',
rates: ['k-rate'],
seeAlso: ['Midi Converters']
},
{
name: 'cpstmid',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get a MIDI note number (allows customized micro-tuning scales).',
syntax: 'icps = cpstmid(ifn)',
example: '--8<-- "examples/cpstmid.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'ifn',
description: 'function table containing the parameters (_numgrades_, _interval_, _basefreq_, _basekeymidi_) and the tuning ratios.',
type: 'initialization'
},
{
name: 'numgrades',
description: 'the number of grades of the micro-tuning scale 2. _interval_ -- the frequency range covered before repeating the grade ratios, for example 2 for one octave, 1.5 for a fifth etc. 3. _basefreq_ -- the base frequency of the scale in Hz 4. _basekeymidi_ -- the MIDI note number to which _basefreq_ is assigned unmodified',
type: 'performance'
},
],
seeAlso: ['Midi Converters']
},
{
name: 'octmidi',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get the note number, in octave-point-decimal units, of the current MIDI event.',
syntax: 'ioct = octmidi()',
example: '--8<-- "examples/octmidi.csd"',
seeAlso: ['Midi Converters']
},
{
name: 'octmidib',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in octave-point-decimal.',
syntax: 'ioct = octmidib([irange])\n koct = octmidib([irange])',
example: '--8<-- "examples/octmidib.csd"',
seeAlso: ['Midi Converters']
},
{
name: 'pchmidi',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get the note number of the current MIDI event, expressed in pitch-class units.',
syntax: 'ipch = pchmidi()',
example: '--8<-- "examples/pchmidi.csd"',
seeAlso: ['Midi Converters']
},
{
name: 'pchmidib',
type: 'opcode',
category: 'Real-time MIDI:Converters',
description: 'Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in pitch-class units.',
syntax: 'ipch = pchmidib([irange])\n kpch = pchmidib([irange])',
example: '--8<-- "examples/pchmidib.csd"',
seeAlso: ['Midi Converters']
},
]

View File

@ -0,0 +1,36 @@
import type { CsoundReference } from './types'
// Real-time MIDI:Event Extenders
export const realTimeMidiEventExtenders: CsoundReference[] = [
{
name: 'lastcycle',
type: 'opcode',
category: 'Real-time MIDI:Event Extenders',
description: 'Indicates whether an event is in its last performance cycle.',
syntax: 'kflag = lastcycle()',
example: '--8<-- "examples/lastcycle.csd"',
parameters: [
{
name: 'kflag',
description: 'indicates whether the note is in its _last cycle_. (1 if this the last cycle, otherwise 0)',
type: 'performance'
},
],
seeAlso: ['Event Extenders']
},
{
name: 'release',
type: 'opcode',
category: 'Real-time MIDI:Event Extenders',
description: 'Indicates whether a note is in its _release_ stage.',
syntax: 'kflag = release()',
parameters: [
{
name: 'kflag',
description: 'indicates whether the note is in its _release_ stage. (1 if a note off is received, otherwise 0)',
type: 'performance'
},
],
seeAlso: ['Event Extenders']
},
]

View File

@ -0,0 +1,76 @@
import type { CsoundReference } from './types'
// Real-time MIDI:Generic I/O
export const realTimeMidiGenericIO: CsoundReference[] = [
{
name: 'midiin',
type: 'opcode',
category: 'Real-time MIDI:Generic I/O',
description: 'Returns a generic MIDI message received by the MIDI IN port.',
syntax: 'kstatus, kchan, kdata1, kdata2 = midiin()',
example: '--8<-- "examples/midiin.csd"',
parameters: [
{
name: 'kstatus',
description: 'the type of MIDI message. Can be:',
type: 'performance'
},
{
name: 'kchan',
description: 'MIDI channel (1-16 if only one input port is used, higher if channel is port mapped.)',
type: 'performance'
},
{
name: 'kdata1',
description: 'message-dependent data values',
type: 'performance'
},
{
name: 'kdata2',
description: 'message-dependent data values',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization', 'Generic Input and Output']
},
{
name: 'midiout',
type: 'opcode',
category: 'Real-time MIDI:Generic I/O',
description: 'Sends a generic MIDI message to the MIDI OUT port.',
syntax: 'midiout(kstatus, kchan, kdata1, kdata2)',
example: '--8<-- "examples/midiout.csd"',
parameters: [
{
name: 'kstatus',
description: 'the type of MIDI message. Can be:',
type: 'performance'
},
{
name: 'kchan',
description: 'MIDI channel (1-16)',
type: 'performance'
},
{
name: 'kdata1',
description: 'message-dependent data values',
type: 'performance'
},
{
name: 'kdata2',
description: 'message-dependent data values',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output', 'Generic Input and Output']
},
{
name: 'midiout_i',
type: 'opcode',
category: 'Real-time MIDI:Generic I/O',
description: 'Sends a generic MIDI message to the MIDI OUT port.',
syntax: 'midiout_i(istatus, ichan, idata1, idata2)',
example: '--8<-- "examples/midiout_i.csd"',
seeAlso: ['MIDI Message Output', 'Generic Input and Output']
},
]

View File

@ -0,0 +1,692 @@
import type { CsoundReference } from './types'
// Real-time MIDI:Input
export const realTimeMidiInput: CsoundReference[] = [
{
name: 'aftouch',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Get the current after-touch value for this channel.',
syntax: 'kaft = aftouch([imin] [, imax])',
example: '--8<-- "examples/aftouch-modern.csd"',
seeAlso: ['MIDI input and Initialization']
},
{
name: 'chanctrl',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Get the current value of a MIDI channel controller and optionally map it onto specified range.',
syntax: 'ival = chanctrl(ichnl, ictlno [, ilow] [, ihigh])\n kval = chanctrl(ichnl, ictlno [, ilow] [, ihigh])',
example: '--8<-- "examples/chanctrl-modern.csd"',
parameters: [
{
name: 'ichnl',
description: 'the MIDI channel (1-16).',
type: 'initialization'
},
{
name: 'ictlno',
description: 'the MIDI controller number (0-127).',
type: 'initialization'
},
{
name: 'ilow',
description: 'low and high ranges for mapping',
type: 'initialization'
},
{
name: 'ihigh',
description: 'low and high ranges for mapping',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrl14',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Allows a floating-point 14-bit MIDI signal scaled with a minimum and a maximum range.',
syntax: 'idest = ctrl14(ichan, ictlno1, ictlno2, imin, imax [, ifn])\n kdest = ctrl14(ichan, ictlno1, ictlno2, kmin, kmax [, ifn])',
example: '--8<-- "examples/ctrl14.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'idest',
description: 'output signal',
type: 'initialization'
},
{
name: 'ichan',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'ictln1o',
description: 'most-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno2',
description: 'least-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'imin',
description: 'user-defined minimum floating-point value of output',
type: 'initialization'
},
{
name: 'imax',
description: 'user-defined maximum floating-point value of output',
type: 'initialization'
},
{
name: 'kdest',
description: 'output signal',
type: 'performance'
},
{
name: 'kmin',
description: 'user-defined minimum floating-point value of output',
type: 'performance'
},
{
name: 'kmax',
description: 'user-defined maximum floating-point value of output',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrl21',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Allows a floating-point 21-bit MIDI signal scaled with a minimum and a maximum range.',
syntax: 'idest = ctrl21(ichan, ictlno1, ictlno2, ictlno3, imin, imax [, ifn])\n kdest = ctrl21(ichan, ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn])',
example: '--8<-- "examples/ctrl21.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'idest',
description: 'output signal',
type: 'initialization'
},
{
name: 'ichan',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'ictlno1',
description: 'most-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno2',
description: 'mid-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno3',
description: 'least-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'imin',
description: 'user-defined minimum floating-point value of output',
type: 'initialization'
},
{
name: 'imax',
description: 'user-defined maximum floating-point value of output',
type: 'initialization'
},
{
name: 'kdest',
description: 'output signal',
type: 'performance'
},
{
name: 'kmin',
description: 'user-defined minimum floating-point value of output',
type: 'performance'
},
{
name: 'kmax',
description: 'user-defined maximum floating-point value of output',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrl7',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Allows a floating-point 7-bit MIDI signal scaled with a minimum and a maximum range.',
syntax: 'idest = ctrl7(ichan, ictlno, imin, imax [, ifn])\n kdest = ctrl7(ichan, ictlno, kmin, kmax [, ifn])\n adest = ctrl7(ichan, ictlno, kmin, kmax [, ifn] [, icutoff])',
example: '--8<-- "examples/ctrl7.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'idest',
description: 'output signal',
type: 'initialization'
},
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ictlno',
description: 'MIDI controller number (0-127)',
type: 'initialization'
},
{
name: 'imin',
description: 'user-defined minimum floating-point value of output',
type: 'initialization'
},
{
name: 'imax',
description: 'user-defined maximum floating-point value of output',
type: 'initialization'
},
{
name: 'kdest',
description: 'output signal',
type: 'performance'
},
{
name: 'adest',
description: 'output signal',
type: 'performance'
},
{
name: 'kmin',
description: 'user-defined minimum floating-point value of output',
type: 'performance'
},
{
name: 'kmax',
description: 'user-defined maximum floating-point value of output',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrlinit',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Sets the initial values for a set of MIDI controllers.',
syntax: 'ctrlinit(ichnl, ictlno1, ival1 [, ictlno2] [, ival2] [, ictlno3] \\\n [, ival3] [,...ival32])',
example: '--8<-- "examples/ctrlinit.csd"',
parameters: [
{
name: 'ichnl',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization', 'Orchestra Header Statements']
},
{
name: 'ctrlpreset',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Defines a preset for MIDI controllers.',
syntax: 'kpreset = ctrlpreset(ktag, kchnl, kctlno1, [kctlno2] [, kctlno3] ...)',
example: '--8<-- "examples/ctrls.csd"',
parameters: [
{
name: 'kpreset',
description: 'the numeric tag for where the preset it stored. If ktag is not zero kpreset will be the same as ktag.',
type: 'performance'
},
{
name: 'ktag',
description: 'the tag for this preset; either a strictly positive integer or zero if the system is to allocate an unused preset.',
type: 'performance'
},
{
name: 'kchanl',
description: 'the MIDI channel to which the preset refers.',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrlprint',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Print the saved values of MIDI controllers from an array to the console or a file.',
syntax: 'ctrlprint(kcont[][, Sfile])',
example: '--8<-- "examples/ctrls.csd"',
parameters: [
{
name: 'Sfile',
description: 'File name to receive the values. If omitted it writes to the console.',
type: 'initialization'
},
{
name: 'kcont',
description: 'the array of controls as saved by _ctrlsave_.',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrlprintpresets',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Prints the current collection of presets for MIDI controllers in a format that can be used in an orchestra, to the console or a file.',
syntax: 'ctrlprintpresets([Sfilenam])',
example: '--8<-- "examples/ctrls.csd"',
parameters: [
{
name: 'Sfilename',
description: '(optional) file to which to print. If omitted it uses the current output.',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrlsave',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Recovers the current values of MIDI controllers to a k-array.',
syntax: 'kconnt[] = ctrlsave(ichnl, ictlno1, [ictlno2] [, ictlno3] ...)',
example: '--8<-- "examples/ctrls.csd"',
parameters: [
{
name: 'ichnl',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'ctrlselect',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Loads a preset of values for MIDI controllers from a previous ctrlpreset call.',
syntax: 'ctrlselect(kpre)',
example: '--8<-- "examples/ctrls.csd"',
parameters: [
{
name: 'kpre',
description: 'the numeric tag for the preset, as returned by ctrlpreset.',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'initc14',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Initializes the controllers used to create a 14-bit MIDI value.',
syntax: 'initc14(ichan, ictlno1, ictlno2, ivalue)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ictlno1',
description: 'most significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno2',
description: 'least significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value (must be within 0 to 1)',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'initc21',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Initializes the controllers used to create a 21-bit MIDI value.',
syntax: 'initc21(ichan, ictlno1, ictlno2, ictlno3, ivalue)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ictlno1',
description: 'most significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno2',
description: 'medium significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno3',
description: 'least significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value (must be within 0 to 1)',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'initc7',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Initializes the controller used to create a 7-bit MIDI value.',
syntax: 'initc7(ichan, ictlno, ivalue)',
example: '--8<-- "examples/initc7.csd"',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ictlno',
description: 'controller number (0-127)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value (must be within 0 to 1)',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'massign',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Assigns a MIDI channel number to a Csound instrument.',
syntax: 'massign(ichnl, insnum[, ireset])\n massign(ichnl, "insname"[, ireset])',
example: '--8<-- "examples/massign.csd"',
parameters: [
{
name: 'ichnl',
description: 'MIDI channel number (1-16).',
type: 'initialization'
},
{
name: 'insnum',
description: 'Csound orchestra instrument number. If zero or negative, the channel is muted (i.e. it does not trigger a csound instrument, though information will still be received by opcodes like [midiin](../opcodes/midiin.md)).',
type: 'initialization'
},
{
name: 'ireset',
description: 'If non-zero resets the controllers; default is to reset.',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization', 'Orchestra Header Statements']
},
{
name: 'midic14',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Allows a floating-point 14-bit MIDI signal scaled with a minimum and a maximum range.',
syntax: 'idest = midic14(ictlno1, ictlno2, imin, imax [, ifn])\n kdest = midic14(ictlno1, ictlno2, kmin, kmax [, ifn])',
example: '--8<-- "examples/midic14.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'idest',
description: 'output signal',
type: 'initialization'
},
{
name: 'ictln1o',
description: 'most-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno2',
description: 'least-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'imin',
description: 'user-defined minimum floating-point value of output',
type: 'initialization'
},
{
name: 'imax',
description: 'user-defined maximum floating-point value of output',
type: 'initialization'
},
{
name: 'kdest',
description: 'output signal',
type: 'performance'
},
{
name: 'kmin',
description: 'user-defined minimum floating-point value of output',
type: 'performance'
},
{
name: 'kmax',
description: 'user-defined maximum floating-point value of output',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'midic21',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Allows a floating-point 21-bit MIDI signal scaled with a minimum and a maximum range.',
syntax: 'idest = midic21(ictlno1, ictlno2, ictlno3, imin, imax [, ifn])\n kdest = midic21(ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn])',
example: '--8<-- "examples/midic21.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'idest',
description: 'output signal',
type: 'initialization'
},
{
name: 'ictln1o',
description: 'most-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno2',
description: 'mid-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'ictlno3',
description: 'least-significant byte controller number (0-127)',
type: 'initialization'
},
{
name: 'imin',
description: 'user-defined minimum floating-point value of output',
type: 'initialization'
},
{
name: 'imax',
description: 'user-defined maximum floating-point value of output',
type: 'initialization'
},
{
name: 'kdest',
description: 'output signal',
type: 'performance'
},
{
name: 'kmin',
description: 'user-defined minimum floating-point value of output',
type: 'performance'
},
{
name: 'kmax',
description: 'user-defined maximum floating-point value of output',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'midic7',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Allows a floating-point 7-bit MIDI signal scaled with a minimum and a maximum range.',
syntax: 'idest = midic7(ictlno, imin, imax [, ifn])\n kdest = midic7(ictlno, kmin, kmax [, ifn])',
example: '--8<-- "examples/midic7.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'idest',
description: 'output signal',
type: 'initialization'
},
{
name: 'ictlno',
description: 'MIDI controller number (0-127)',
type: 'initialization'
},
{
name: 'imin',
description: 'user-defined minimum floating-point value of output',
type: 'initialization'
},
{
name: 'imax',
description: 'user-defined maximum floating-point value of output',
type: 'initialization'
},
{
name: 'kdest',
description: 'output signal',
type: 'performance'
},
{
name: 'kmin',
description: 'user-defined minimum floating-point value of output',
type: 'performance'
},
{
name: 'kmax',
description: 'user-defined maximum floating-point value of output',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'midictrl',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Get the current value (0-127) of a specified MIDI controller.',
syntax: 'ival = midictrl(inum [, imin] [, imax])\n kval = midictrl(inum [, imin] [, imax])',
example: '--8<-- "examples/midictrl.csd"',
parameters: [
{
name: 'inum',
description: 'MIDI controller number (0-127)',
type: 'initialization'
},
{
name: 'imin',
description: 'set minimum and maximum limits on values obtained.',
type: 'initialization'
},
{
name: 'imax',
description: 'set minimum and maximum limits on values obtained.',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization']
},
{
name: 'notnum',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Get a note number from a MIDI event.',
syntax: 'ival = notnum()',
example: '--8<-- "examples/notnum.csd"',
seeAlso: ['MIDI input and Initialization']
},
{
name: 'pchbend',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Get the current pitch-bend value for this channel.',
syntax: 'ibend = pchbend([imin] [, imax])\n kbend = pchbend([imin] [, imax])',
example: '--8<-- "examples/pchbend.csd"',
seeAlso: ['MIDI input and Initialization']
},
{
name: 'pgmassign',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Assigns an instrument number to a specified MIDI program.',
syntax: 'pgmassign(ipgm, inst[, ichn])\n pgmassign(ipgm, "insname"[, ichn])',
example: '--8<-- "examples/pgmassign.csd"',
parameters: [
{
name: 'ipgm',
description: 'MIDI program number (1 to 128). A value of zero selects all programs.',
type: 'initialization'
},
{
name: 'inst',
description: 'instrument number. If set to zero, or negative, MIDI program changes to _ipgm_ are ignored. Currently, assignment to an instrument that does not exist has the same effect. This may be changed in a later release to print an error message.',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization', 'Orchestra Header Statements']
},
{
name: 'polyaft',
type: 'opcode',
category: 'Real-time MIDI:Input',
description: 'Returns the polyphonic after-touch pressure of the selected note number, optionally mapped to an user-specified range.',
syntax: 'ires = polyaft(inote [, ilow] [, ihigh])\n kres = polyaft(inote [, ilow] [, ihigh])',
example: '--8<-- "examples/polyaft.csd"',
rates: ['k-rate', 'i-rate'],
parameters: [
{
name: 'inote',
description: 'note number. Normally set to the value returned by [notnum](../opcodes/notnum.md)',
type: 'initialization'
},
{
name: 'kres',
description: 'polyphonic pressure (aftertouch).',
type: 'performance'
},
],
seeAlso: ['MIDI input and Initialization']
},
]

View File

@ -0,0 +1,237 @@
import type { CsoundReference } from './types'
// Real-time MIDI:MIDI/Score Interoperability
export const realTimeMidiMidiScoreInteroperability: CsoundReference[] = [
{
name: 'midichannelaftertouch',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI channel\'s aftertouch value.',
syntax: 'midichannelaftertouch(xchannelaftertouch [, ilow] [, ihigh])',
example: '--8<-- "examples/midichannelaftertouch.csd"',
parameters: [
{
name: 'xchannelaftertouch',
description: 'returns the MIDI channel aftertouch during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midichn',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Returns the MIDI channel number (1 - 16) from which the note was activated.',
syntax: 'ichn = midichn()',
example: '--8<-- "examples/midichn.csd"',
parameters: [
{
name: 'ichn',
description: 'channel number. If the current note was activated from score, it is set to zero.',
type: 'initialization'
},
],
seeAlso: ['MIDI input and Initialization', 'MIDI/Score Interoperability']
},
{
name: 'midicontrolchange',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI control change value.',
syntax: 'midicontrolchange(xcontroller, xcontrollervalue [, ilow] [, ihigh])',
example: '--8<-- "examples/midicontrolchange.csd"',
parameters: [
{
name: 'xcontroller',
description: 'specifies the MIDI controller number (0-127) to read from.',
type: 'performance'
},
{
name: 'xcontrollervalue',
description: 'returns the value of the MIDI controller during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'mididefault',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Changes values, depending on MIDI activation.',
syntax: 'mididefault(xdefault, xvalue)',
example: '--8<-- "examples/mididefault.csd"',
parameters: [
{
name: 'xdefault',
description: 'specifies a default value that will be used during MIDI activation.',
type: 'performance'
},
{
name: 'xvalue',
description: 'overwritten by _xdefault_ during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midinoteoff',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI noteoff value.',
syntax: 'midinoteoff(xkey, xvelocity)',
example: '--8<-- "examples/midinoteoff.csd"',
parameters: [
{
name: 'xkey',
description: 'returns MIDI key during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
{
name: 'xvelocity',
description: 'returns MIDI velocity during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midinoteoncps',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI note number as a cycles-per-second frequency.',
syntax: 'midinoteoncps(xcps, xvelocity)',
example: '--8<-- "examples/midinoteoncps.csd"',
parameters: [
{
name: 'xcps',
description: 'returns MIDI key translated to cycles per second during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
{
name: 'xvelocity',
description: 'returns MIDI velocity during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midinoteonkey',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI note number value.',
syntax: 'midinoteonkey(xkey, xvelocity)',
example: '--8<-- "examples/midinoteonkey.csd"',
parameters: [
{
name: 'xkey',
description: 'returns MIDI key during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
{
name: 'xvelocity',
description: 'returns MIDI velocity during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midinoteonoct',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI note number value as octave-point-decimal value.',
syntax: 'midinoteonoct(xoct, xvelocity)',
example: '--8<-- "examples/midinoteonoct.csd"',
parameters: [
{
name: 'xoct',
description: 'returns MIDI key translated to linear octaves during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
{
name: 'xvelocity',
description: 'returns MIDI velocity during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midinoteonpch',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI note number as a pitch-class value.',
syntax: 'midinoteonpch(xpch, xvelocity)',
example: '--8<-- "examples/midinoteonpch.csd"',
parameters: [
{
name: 'xpch',
description: 'returns MIDI key translated to octave.pch during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
{
name: 'xvelocity',
description: 'returns MIDI velocity during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midipitchbend',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI pitchbend value.',
syntax: 'midipitchbend(xpitchbend [, ilow] [, ihigh])',
example: '--8<-- "examples/midipitchbend.csd"',
parameters: [
{
name: 'xpitchbend',
description: 'returns the MIDI pitch bend during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midipolyaftertouch',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI polyphonic aftertouch value.',
syntax: 'midipolyaftertouch(xpolyaftertouch, xkey [, ilow] [, ihigh])',
example: '--8<-- "examples/midipolyaftertouch.csd"',
parameters: [
{
name: 'xpolyaftertouch',
description: 'returns MIDI polyphonic aftertouch of the selected note during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
{
name: 'xkey',
description: 'specifies the MIDI key to read from. It normally should be set to the note number that the instrument instance is playing.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
{
name: 'midiprogramchange',
type: 'opcode',
category: 'Real-time MIDI:MIDI/Score Interoperability',
description: 'Gets a MIDI program change value.',
syntax: 'midiprogramchange(xprogram)',
example: '--8<-- "examples/midiprogramchange.csd"',
parameters: [
{
name: 'xprogram',
description: 'returns the MIDI program change value during MIDI activation, remains unchanged otherwise.',
type: 'performance'
},
],
seeAlso: ['MIDI/Score Interoperability']
},
]

View File

@ -0,0 +1,241 @@
import type { CsoundReference } from './types'
// Real-time MIDI:Note Output
export const realTimeMidiNoteOutput: CsoundReference[] = [
{
name: 'midiarp',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Generates arpeggios based on currently held MIDI notes.',
syntax: 'kMidiNoteNum, kTrigger = midiarp(kRate[, kMode])',
example: '--8<-- "examples/midiarp.csd"',
parameters: [
{
name: 'kRate',
description: 'sets the rate in cycles per second at which new notes will be generated.',
type: 'performance'
},
{
name: 'kMode',
description: 'Optional. Sets the mode of the arpeggio. 0 for up and down, 1, for up, 2 for down, and 3 for random. If left out, it will default to mode 0, up and down.',
type: 'performance'
},
{
name: 'kMideNoteNum',
description: 'the current note number in the arpeggio pattern.',
type: 'performance'
},
{
name: 'kTrigger',
description: 'a metronomic pulse that can be used to trigger playback of the notes in the arpeggio. This signal will output a 1 followed by 0s on each cycle. The frequency is set using the _kRate_ input parameter.',
type: 'performance'
},
],
seeAlso: ['Note-on/Note-off Output']
},
{
name: 'midion',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Generates MIDI note messages at k-rate.',
syntax: 'midion(kchn, knum, kvel)',
example: '--8<-- "examples/midion_simple.csd"',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'knum',
description: 'note number (0-127)',
type: 'performance'
},
{
name: 'kvel',
description: 'velocity (0-127)',
type: 'performance'
},
],
seeAlso: ['Note-on/Note-off Output']
},
{
name: 'midion2',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Sends noteon and noteoff messages to the MIDI OUT port when triggered by a value different than zero.',
syntax: 'midion2(kchn, knum, kvel, ktrig)',
example: '--8<-- "examples/midion2.csd"',
parameters: [
{
name: 'kchn',
description: 'MIDI channel (1-16)',
type: 'performance'
},
{
name: 'knum',
description: 'MIDI note number (0-127)',
type: 'performance'
},
{
name: 'kvel',
description: 'note velocity (0-127)',
type: 'performance'
},
{
name: 'ktrig',
description: 'trigger input signal (normally 0)',
type: 'performance'
},
],
seeAlso: ['Note-on/Note-off Output']
},
{
name: 'moscil',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Sends a stream of the MIDI notes.',
syntax: 'moscil(kchn, knum, kvel, kdur, kpause)',
example: '--8<-- "examples/moscil.csd"',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'knum',
description: 'note number (0-127)',
type: 'performance'
},
{
name: 'kvel',
description: 'velocity (0-127)',
type: 'performance'
},
{
name: 'kdur',
description: 'note duration in seconds',
type: 'performance'
},
{
name: 'kpause',
description: 'pause duration after each noteoff and before new note in seconds',
type: 'performance'
},
],
seeAlso: ['Note-on/Note-off Output']
},
{
name: 'noteoff',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Send a noteoff message to the MIDI OUT port.',
syntax: 'noteoff(ichn, inum, ivel)',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'inum',
description: 'note number (0-127)',
type: 'initialization'
},
{
name: 'ivel',
description: 'velocity (0-127)',
type: 'initialization'
},
],
seeAlso: ['Note-on/Note-off Output']
},
{
name: 'noteon',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Send a noteon message to the MIDI OUT port.',
syntax: 'noteon(ichn, inum, ivel)',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'inum',
description: 'note number (0-127)',
type: 'initialization'
},
{
name: 'ivel',
description: 'velocity (0-127)',
type: 'initialization'
},
],
seeAlso: ['Note-on/Note-off Output']
},
{
name: 'noteondur',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Sends a noteon and a noteoff MIDI message both with the same channel, number and velocity.',
syntax: 'noteondur(ichn, inum, ivel, idur)',
example: '--8<-- "examples/noteondur.csd"',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'inum',
description: 'note number (0-127)',
type: 'initialization'
},
{
name: 'ivel',
description: 'velocity (0-127)',
type: 'initialization'
},
{
name: 'idur',
description: 'how long, in seconds, this note should last.',
type: 'initialization'
},
],
seeAlso: ['Note-on/Note-off Output']
},
{
name: 'noteondur2',
type: 'opcode',
category: 'Real-time MIDI:Note Output',
description: 'Sends a noteon and a noteoff MIDI message both with the same channel, number and velocity.',
syntax: 'noteondur2(ichn, inum, ivel, idur)',
example: '--8<-- "examples/noteondur2.csd"',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'inum',
description: 'note number (0-127)',
type: 'initialization'
},
{
name: 'ivel',
description: 'velocity (0-127)',
type: 'initialization'
},
{
name: 'idur',
description: 'how long, in seconds, this note should last.',
type: 'initialization'
},
],
seeAlso: ['Note-on/Note-off Output']
},
]

View File

@ -0,0 +1,439 @@
import type { CsoundReference } from './types'
// Real-time MIDI:Output
export const realTimeMidiOutput: CsoundReference[] = [
{
name: 'nrpn',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends a NPRN (Non-Registered Parameter Number) message to the MIDI OUT port each time one of the input arguments changes.',
syntax: 'nrpn(kchan, kparmnum, kparmvalue)',
example: '--8<-- "examples/nrpn.csd"',
parameters: [
{
name: 'kchan',
description: 'MIDI channel (1-16)',
type: 'performance'
},
{
name: 'kparmnum',
description: 'number of NRPN parameter',
type: 'performance'
},
{
name: 'kparmvalue',
description: 'value of NRPN parameter',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outiat',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI aftertouch messages at i-rate.',
syntax: 'outiat(ichn, ivalue, imin, imax)',
example: '--8<-- "examples/outiat.csd"',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'initialization'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outic',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI controller output at i-rate.',
syntax: 'outic(ichn, inum, ivalue, imin, imax)',
example: '--8<-- "examples/outic.csd"',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'inum',
description: 'controller number (0-127 for example 1 = ModWheel; 2 = BreathControl etc.)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'initialization'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outic14',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends 14-bit MIDI controller output at i-rate.',
syntax: 'outic14(ichn, imsb, ilsb, ivalue, imin, imax)',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'imsb',
description: 'most significant byte controller number when using 14-bit parameters (0-127)',
type: 'initialization'
},
{
name: 'ilsb',
description: 'least significant byte controller number when using 14-bit parameters (0-127)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum floating point value (converted in MIDI integer value 16383 (14-bit))',
type: 'initialization'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outipat',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends polyphonic MIDI aftertouch messages at i-rate.',
syntax: 'outipat(ichn, inotenum, ivalue, imin, imax)',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'inotenum',
description: 'MIDI note number (used in polyphonic aftertouch messages)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'initialization'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outipb',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI pitch-bend messages at i-rate.',
syntax: 'outipb(ichn, ivalue, imin, imax)',
example: '--8<-- "examples/outipb.csd"',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'ivalue',
description: 'floating point value',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'initialization'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outipc',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI program change messages at i-rate.',
syntax: 'outipc(ichn, iprog, imin, imax)',
example: '--8<-- "examples/outipc.csd"',
parameters: [
{
name: 'ichn',
description: 'MIDI channel number (1-16)',
type: 'initialization'
},
{
name: 'iprog',
description: 'program change number in floating point',
type: 'initialization'
},
{
name: 'imin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'initialization'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outkat',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI aftertouch messages at k-rate.',
syntax: 'outkat(kchn, kvalue, kmin, kmax)',
example: '--8<-- "examples/outkat.csd"',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'kvalue',
description: 'floating point value',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum floating point value (converted in MIDI integer value 127)',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outkc',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI controller messages at k-rate.',
syntax: 'outkc(kchn, knum, kvalue, kmin, kmax)',
example: '--8<-- "examples/outkc.csd"',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'knum',
description: 'controller number (0-127 for example 1 = ModWheel; 2 = BreathControl etc.)',
type: 'performance'
},
{
name: 'kvalue',
description: 'floating point value',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outkc14',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends 14-bit MIDI controller output at k-rate.',
syntax: 'outkc14(kchn, kmsb, klsb, kvalue, kmin, kmax)',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'kmsb',
description: 'most significant byte controller number when using 14-bit parameters (0-127)',
type: 'performance'
},
{
name: 'klsb',
description: 'least significant byte controller number when using 14-bit parameters (0-127)',
type: 'performance'
},
{
name: 'kvalue',
description: 'floating point value',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum floating point value (converted in MIDI integer value 16383 (14-bit))',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outkpat',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends polyphonic MIDI aftertouch messages at k-rate.',
syntax: 'outkpat(kchn, knotenum, kvalue, kmin, kmax)',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'knotenum',
description: 'MIDI note number (used in polyphonic aftertouch messages)',
type: 'performance'
},
{
name: 'kvalue',
description: 'floating point value',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outkpb',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI pitch-bend messages at k-rate.',
syntax: 'outkpb(kchn, kvalue, kmin, kmax)',
example: '--8<-- "examples/outkpb.csd"',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'kvalue',
description: 'floating point value',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'outkpc',
type: 'opcode',
category: 'Real-time MIDI:Output',
description: 'Sends MIDI program change messages at k-rate.',
syntax: 'outkpc(kchn, kprog, kmin, kmax)',
example: '--8<-- "examples/outkpc.csd"',
parameters: [
{
name: 'kchn',
description: 'MIDI channel number (1-16)',
type: 'performance'
},
{
name: 'kprog',
description: 'program change number in floating point',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum floating point value (converted in MIDI integer value 0)',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum floating point value (converted in MIDI integer value 127 (7 bit))',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
]

View File

@ -0,0 +1,423 @@
import type { CsoundReference } from './types'
// Real-time MIDI:Slider Banks
export const realTimeMidiSliderBanks: CsoundReference[] = [
{
name: 's16b14',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 16 different 14-bit MIDI control message numbers.',
syntax: 'i1, ..., i16 = s16b14(ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, \\\n initvalue1, ifn1, ..., ictlno_msb16, ictlno_lsb16, \\\n imin16, imax16, initvalue16, ifn16)\n k1, ..., k16 = s16b14(ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, \\\n initvalue1, ifn1, ..., ictlno_msb16, ictlno_lsb16, \\\n imin16, imax16, initvalue16, ifn16)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'msb32',
description: 'MIDI control number, most significant byte (0-127)',
type: 'initialization'
},
{
name: 'lsb32',
description: 'MIDI control number, least significant byte (0-127)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 's32b14',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 32 different 14-bit MIDI control message numbers.',
syntax: 'i1, ..., i32 = s32b14(ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, \\\n initvalue1, ifn1, ..., ictlno_msb32, ictlno_lsb32, \\\n imin32, imax32, initvalue32, ifn32)\n k1, ..., k32 = s32b14(ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, \\\n initvalue1, ifn1, ..., ictlno_msb32, ictlno_lsb32, \\\n imin32, imax32, initvalue32, ifn32)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'msb32',
description: 'MIDI control number, most significant byte (0-127)',
type: 'initialization'
},
{
name: 'lsb32',
description: 'MIDI control number, least significant byte (0-127)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider16',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 16 different MIDI control message numbers.',
syntax: 'i1, ..., i16 = slider16(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum16, imin16, imax16, init16, ifn16)\n k1, ..., k16 = slider16(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum16, imin16, imax16, init16, ifn16)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider16f',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 16 different MIDI control message numbers, filtered before output.',
syntax: 'k1, ..., k16 = slider16f(ichan, ictlnum1, imin1, imax1, init1, ifn1, icutoff1, \\\n ..., ictlnum16, imin16, imax16, init16, ifn16, icutoff16)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider16table',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 16 different MIDI control messages to a table.',
syntax: 'kflag = slider16table(ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, \\\n init1, ifn1, ...., \\\n ictlnum16, imin16, imax16, init16, ifn16)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider16tablef',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 16 different MIDI control messages to a table, filtered before output.',
syntax: 'kflag = slider16tablef(ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, \\\n init1, ifn1, icutoff1, ...., \\\n ictlnum16, imin16, imax16, init16, ifn16, icutoff16)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider32',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 32 different MIDI control message numbers.',
syntax: 'i1, ..., i32 = slider32(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum32, imin32, imax32, init32, ifn32)\n k1, ..., k32 = slider32(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum32, imin32, imax32, init32, ifn32)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider32f',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 32 different MIDI control message numbers, filtered before output.',
syntax: 'k1, ..., k32 = slider32f(ichan, ictlnum1, imin1, imax1, init1, ifn1, icutoff1, \\\n ..., ictlnum32, imin32, imax32, init32, ifn32, icutoff32)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider32table',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 32 different MIDI control messages to a table.',
syntax: 'kflag = slider32table(ichan, ioutTable, ioffset, ictlnum1, imin1, \\\n imax1, init1, ifn1, ...., \\\n ictlnum32, imin32, imax32, init32, ifn32)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider32tablef',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 32 different MIDI control messages to a table, filtered before output.',
syntax: 'kflag = slider32tablef(ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, \\\n init1, ifn1, icutoff1, ...., \\\n ictlnum32, imin32, imax32, init32, ifn32, icutoff32)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider64',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 64 different MIDI control message numbers.',
syntax: 'i1, ..., i64 = slider64(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum64, imin64, imax64, init64, ifn64)\n k1, ..., k64 = slider64(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum64, imin64, imax64, init64, ifn64)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider64f',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 64 different MIDI control message numbers, filtered before output.',
syntax: 'k1, ..., k64 = slider64f(ichan, ictlnum1, imin1, imax1, init1, ifn1, icutoff1, \\\n ..., ictlnum64, imin64, imax64, init64, ifn64, icutoff64)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider64table',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 64 different MIDI control messages to a table.',
syntax: 'kflag = slider64table(ichan, ioutTable, ioffset, ictlnum1, imin1, \\\n imax1, init1, ifn1, ...., \\\n ictlnum64, imin64, imax64, init64, ifn64)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider64tablef',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 64 different MIDI control messages to a table, filtered before output.',
syntax: 'kflag = slider64tablef(ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, \\\n init1, ifn1, icutoff1, ...., \\\n ictlnum64, imin64, imax64, init64, ifn64, icutoff64)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider8',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 8 different MIDI control message numbers.',
syntax: 'i1, ..., i8 = slider8(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum8, imin8, imax8, init8, ifn8)\n k1, ..., k8 = slider8(ichan, ictlnum1, imin1, imax1, init1, ifn1, ..., \\\n ictlnum8, imin8, imax8, init8, ifn8)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider8f',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 8 different MIDI control message numbers, filtered before output.',
syntax: 'k1, ..., k8 = slider8f(ichan, ictlnum1, imin1, imax1, init1, ifn1, icutoff1, \\\n ..., ictlnum8, imin8, imax8, init8, ifn8, icutoff8)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider8table',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 8 different MIDI control messages to a table.',
syntax: 'kflag = slider8table(ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, \\\n init1, ifn1, ..., ictlnum8, imin8, imax8, init8, ifn8)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'slider8tablef',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Stores a bank of 8 different MIDI control messages to a table, filtered before output.',
syntax: 'kflag = slider8tablef(ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, \\\n init1, ifn1, icutoff1, ...., \\\n ictlnum8, imin8, imax8, init8, ifn8, icutoff8)',
parameters: [
{
name: 'ichan',
description: 'MIDI channel (1-16)',
type: 'initialization'
},
{
name: 'ioutTable',
description: 'number of the table that will contain the output',
type: 'initialization'
},
{
name: 'ioffset',
description: 'output table offset. A zero means that the output of the first slider will affect the first table element. A 10 means that the output of the first slider will affect the 11th table element.',
type: 'initialization'
},
{
name: 'kflag',
description: 'a flag that informs if any control-change message in the bank has been received. In this case _kflag_ is set to 1. Otherwise is set to zero.',
type: 'performance'
},
],
seeAlso: ['Slider Banks']
},
{
name: 'sliderKawai',
type: 'opcode',
category: 'Real-time MIDI:Slider Banks',
description: 'Creates a bank of 16 different MIDI control message numbers from a KAWAI MM-16 midi mixer.',
syntax: 'k1, k2, ...., k16 = sliderKawai(imin1, imax1, init1, ifn1, imin2, imax2, \\\n init2, ifn2, ..., imin16, imax16, init16, ifn16)',
seeAlso: ['Slider Banks']
},
]

View File

@ -0,0 +1,36 @@
import type { CsoundReference } from './types'
// Real-time MIDI:System Realtime
export const realTimeMidiSystemRealtime: CsoundReference[] = [
{
name: 'mclock',
type: 'opcode',
category: 'Real-time MIDI:System Realtime',
description: 'Sends a MIDI CLOCK message.',
syntax: 'mclock(ifreq)',
example: '--8<-- "examples/mclock.csd"',
parameters: [
{
name: 'ifreq',
description: 'clock message frequency rate in Hz',
type: 'initialization'
},
],
seeAlso: ['mrtmsg', 'System Realtime Messages']
},
{
name: 'mrtmsg',
type: 'opcode',
category: 'Real-time MIDI:System Realtime',
description: 'Send system real-time messages to the MIDI OUT port.',
syntax: 'mrtmsg(imsgtype)',
parameters: [
{
name: 'imsgtype',
description: 'type of real-time message:',
type: 'initialization'
},
],
seeAlso: ['mclock', 'System Realtime Messages']
},
]

View File

@ -0,0 +1,97 @@
import type { CsoundReference } from './types'
// Remote Opcodes
export const remoteOpcodes: CsoundReference[] = [
{
name: 'insglobal',
type: 'opcode',
category: 'Remote Opcodes',
description: 'An opcode which can be used to implement a remote orchestra. This opcode will send note events from a source machine to many destinations.',
syntax: 'insglobal(isource, instrnum [,instrnum...])',
parameters: [
{
name: 'isource',
description: 'a string that is the intended server computer (e.g. 192.168.0.100). This is the source host which generates the events of the given instrument(s) and sends it to all the machines involved in the remote concert.',
type: 'initialization'
},
{
name: 'instrnum',
description: 'a list of instrument numbers which will be played on the destination machines',
type: 'initialization'
},
],
seeAlso: ['Remote Opcodes']
},
{
name: 'insremot',
type: 'opcode',
category: 'Remote Opcodes',
description: 'An opcode which can be used to implement a remote orchestra. This opcode will send note events from a source machine to one destination.',
syntax: 'insremot(idestination, isource, instrnum [, instrnum...])',
example: '--8<-- "examples/insremot.csd"',
parameters: [
{
name: 'idestination',
description: 'a string that is the intended client computer (e.g. 192.168.0.100). This is the destination host which receives the events from the given instrument.',
type: 'initialization'
},
{
name: 'isource',
description: 'a string that is the intended server computer (e.g. 192.168.0.100). This is the source host which generates the events of the given instrument and sends it to the address given by idestination.',
type: 'initialization'
},
{
name: 'instrnum',
description: 'a list of instrument numbers which will be played on the destination machine',
type: 'initialization'
},
],
seeAlso: ['Remote Opcodes']
},
{
name: 'midglobal',
type: 'opcode',
category: 'Remote Opcodes',
description: 'An opcode which can be used to implement a remote midi orchestra. This opcode will broadcast the midi events to all the machines involved in the remote concert.',
syntax: 'midglobal(isource, instrnum [, instrnum...])',
parameters: [
{
name: 'isource',
description: 'a string that is the intended host computer (e.g. 192.168.0.100). This is the source host which generates the events of the given instrument(s) and sends it to all the machines involved in the remote concert.',
type: 'initialization'
},
{
name: 'instrnum',
description: 'a list of instrument numbers which will be played on the destination machines',
type: 'initialization'
},
],
seeAlso: ['Remote Opcodes']
},
{
name: 'midremot',
type: 'opcode',
category: 'Remote Opcodes',
description: 'An opcode which can be used to implement a remote midi orchestra. This opcode will send midi events from a source machine to one destination.',
syntax: 'midremot(idestination, isource, instrnum [, instrnum...])',
example: '--8<-- "examples/midremot.csd"',
parameters: [
{
name: 'idestination',
description: 'a string that is the intended host computer (e.g. 192.168.0.100). This is the destination host which receives the events from the given instrument.',
type: 'initialization'
},
{
name: 'isource',
description: 'a string that is the intended host computer (e.g. 192.168.0.100). This is the source host which generates the events of the given instrument and sends it to the address given by idestination.',
type: 'initialization'
},
{
name: 'instrnum',
description: 'a list of instrument numbers which will be played on the destination machine',
type: 'initialization'
},
],
seeAlso: ['Remote Opcodes']
},
]

View File

@ -0,0 +1,235 @@
import type { CsoundReference } from './types'
// Serial I/O
export const serialIO: CsoundReference[] = [
{
name: 'arduinoRead',
type: 'opcode',
category: 'Serial I/O',
description: 'Read integer data from an arduino port using the Csound-Arduino protocol.',
syntax: 'kval = arduinoRead(iPort, iStream [, iSmooth])',
example: '--8<-- "examples/arduinoRead.csd"',
parameters: [
{
name: 'iPort',
description: 'port number obtained from a _arduinoStart_ opcode.',
type: 'performance'
},
{
name: 'iStream',
description: 'Number of the data stream in range 0 to 30.',
type: 'performance'
},
{
name: 'iSmooth',
description: 'halftime of a portamento filter to smooth the stream of data. Defaults to 0 meaning no filtering.',
type: 'performance'
},
{
name: 'kval',
description: 'data to read in range [0, 1023].',
type: 'performance'
},
],
seeAlso: ['non-MIDI Devices', 'New Arduino Opcodes to Simplify the Streaming of Sensor and Controller Data to Csound']
},
{
name: 'arduinoReadF',
type: 'opcode',
category: 'Serial I/O',
description: 'Read integer data from an arduino port using the Csound-Arduino protocol.',
syntax: 'kval = arduinoReadF(iPort, iStream1, iStream2, iStream3)',
example: '--8<-- "examples/arduinoReadF.csd"',
parameters: [
{
name: 'iPort',
description: 'port number obtained from a _arduinoStart_ opcode.',
type: 'performance'
},
{
name: 'iStream1',
description: 'Numbers of the three data streams in the range 0 to 30. Each stream carries 10 bits of the 30 bits floating point result. The division is created in the Arduino sketch encapsulated in the put_float function.',
type: 'performance'
},
{
name: 'iStream2',
description: 'Numbers of the three data streams in the range 0 to 30. Each stream carries 10 bits of the 30 bits floating point result. The division is created in the Arduino sketch encapsulated in the put_float function.',
type: 'performance'
},
{
name: 'iStream3',
description: 'Numbers of the three data streams in the range 0 to 30. Each stream carries 10 bits of the 30 bits floating point result. The division is created in the Arduino sketch encapsulated in the put_float function.',
type: 'performance'
},
{
name: 'kval',
description: 'floating point value read.',
type: 'performance'
},
],
seeAlso: ['non-MIDI Devices', 'New Arduino Opcodes to Simplify the Streaming of Sensor and Controller Data to Csound']
},
{
name: 'arduinoStart',
type: 'opcode',
category: 'Serial I/O',
description: 'Open a serial port for use with the Arduino protocol.',
syntax: 'iPort = arduinoStart(SPortName [, ibaudRate])',
parameters: [
{
name: 'SPortName',
description: 'port name number',
type: 'initialization'
},
{
name: 'ibaudrate',
description: 'serial speed, defaulting to 9600 bps.',
type: 'initialization'
},
],
seeAlso: ['non-MIDI Devices', 'New Arduino Opcodes to Simplify the Streaming of Sensor and Controller Data to Csound']
},
{
name: 'arduinoStop',
type: 'opcode',
category: 'Serial I/O',
description: 'Close a serial port using Arduino protocol.',
syntax: 'arduinoStop(iPort)',
parameters: [
{
name: 'iPort',
description: 'port number obtained from a _arduinoStart_opcode.',
type: 'initialization'
},
],
seeAlso: ['non-MIDI Devices', 'New Arduino Opcodes to Simplify the Streaming of Sensor and Controller Data to Csound']
},
{
name: 'serialBegin',
type: 'opcode',
category: 'Serial I/O',
description: 'Open a serial port for arduino.',
syntax: 'iPort = serialBegin(SPortName [, ibaudRate])',
example: '--8<-- "examples/serialBegin.csd"',
parameters: [
{
name: 'SPortName',
description: 'port name number',
type: 'initialization'
},
{
name: 'ibaudrate',
description: 'serial speed, defaulting to 9600 bps.',
type: 'initialization'
},
],
seeAlso: ['non-MIDI Devices']
},
{
name: 'serialEnd',
type: 'opcode',
category: 'Serial I/O',
description: 'Close a serial port for arduino.',
syntax: 'serialEnd(iPort)',
parameters: [
{
name: 'iPort',
description: 'port number optained from a _serialBegin_opcode.',
type: 'initialization'
},
],
seeAlso: ['non-MIDI Devices']
},
{
name: 'serialFlush',
type: 'opcode',
category: 'Serial I/O',
description: 'Flush data from a serial port.',
syntax: 'serialFlush(iPort)',
parameters: [
{
name: 'iPort',
description: 'port number optained from a _serialBegin_ opcode.',
type: 'performance'
},
],
seeAlso: ['non-MIDI Devices']
},
{
name: 'serialPrint',
type: 'opcode',
category: 'Serial I/O',
description: 'Print data from a serial port.',
syntax: 'serialPrint(iPort)',
parameters: [
{
name: 'iPort',
description: 'port number optained from a _serialBegin_ opcode.',
type: 'performance'
},
],
seeAlso: ['non-MIDI Devices']
},
{
name: 'serialRead',
type: 'opcode',
category: 'Serial I/O',
description: 'Read data from a serial port for arduino.',
syntax: 'kByte = serialRead(iPort)',
example: '--8<-- "examples/serialRead.csd"',
parameters: [
{
name: 'iPort',
description: 'port number optained from a _serialBegin_ opcode.',
type: 'performance'
},
{
name: 'kByte',
description: 'a byte of data to read.',
type: 'performance'
},
],
seeAlso: ['non-MIDI Devices']
},
{
name: 'serialWrite',
type: 'opcode',
category: 'Serial I/O',
description: 'Write data to a serial port for arduino.',
syntax: 'serialWrite(iPort, iByte)\n serialWrite(iPort, kByte)\n serialWrite(iPort, SBytes)',
example: '--8<-- "examples/serialWrite.csd"',
parameters: [
{
name: 'iPort',
description: 'port number optained from a _serialBegin_ opcode.',
type: 'performance'
},
{
name: 'iByte',
description: 'a byte of data to write.',
type: 'performance'
},
],
seeAlso: ['non-MIDI Devices']
},
{
name: 'serialWrite_i',
type: 'opcode',
category: 'Serial I/O',
description: 'Write data to a serial port for arduino.',
syntax: 'serialWrite_i(iPort, iByte)\n serialWrite_i(iPort, SBytes)',
parameters: [
{
name: 'iPort',
description: 'port number optained from a _serialBegin_ opcode.',
type: 'initialization'
},
{
name: 'iByte',
description: 'a byte of data to write.',
type: 'initialization'
},
],
seeAlso: ['non-MIDI Devices']
},
]

View File

@ -0,0 +1,296 @@
import type { CsoundReference } from './types'
// Signal Flow Graph Opcodes
export const signalFlowGraphOpcodes: CsoundReference[] = [
{
name: 'alwayson',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Activates the indicated instrument in the orchestra header, without need for an i statement.',
syntax: 'alwayson(Tinstrument [, p4, ..., pn])',
example: '--8<-- "examples/alwayson-modern.csd"',
parameters: [
{
name: 'Tinstrument',
description: 'String name of the instrument definition to be turned on.',
type: 'initialization'
},
],
seeAlso: ['Signal Flow Graph Opcodes']
},
{
name: 'connect',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Connects a source outlet to a sink inlet.',
syntax: 'connect(Tsource1, Soutlet1, Tsink1, Sinlet1)',
example: '--8<-- "examples/connect-modern.csd"',
parameters: [
{
name: 'Tsource1',
description: 'String name of the source instrument definition.',
type: 'initialization'
},
{
name: 'Soutlet1',
description: 'String name of the source outlet in the source instrument.',
type: 'initialization'
},
{
name: 'Tsink1',
description: 'String name of the sink instrument definition.',
type: 'initialization'
},
{
name: 'Sinlet1',
description: 'String name of the sink inlet in the sink instrument.',
type: 'initialization'
},
],
seeAlso: ['Signal Flow Graph Opcodes', 'http://www.csoundjournal.com/issue13/signalFlowGraphOpcodes.html']
},
{
name: 'ftgenonce',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Generate a function table from within an instrument definition, without duplication of data.',
syntax: 'ifno = ftgenonce(ip1, ip2dummy, isize, igen, iarga, iargb, ...)',
example: '--8<-- "examples/ftgenonce.csd"',
parameters: [
{
name: 'ifno',
description: 'an automatically assigned table number.',
type: 'initialization'
},
{
name: 'ip1',
description: 'the number of the table to be generated or 0 if the number is to be assigned.',
type: 'initialization'
},
{
name: 'ip2dummy',
description: 'ignored.',
type: 'initialization'
},
{
name: 'isize',
description: 'table size. Corresponds to p3 of the score _f statement_.',
type: 'initialization'
},
{
name: 'igen',
description: 'function table _GEN_ routine. Corresponds to p4 of the score _f statement_.',
type: 'initialization'
},
],
seeAlso: ['Signal Flow Graph Opcodes']
},
{
name: 'inleta',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Receives an arate signal into an instrument through a named port.',
syntax: 'asignal = inleta(Sname)',
example: '--8<-- "examples/inleta.csd"',
parameters: [
{
name: 'Sname',
description: 'String name of the inlet port. The name of the inlet is implicitly qualified by the instrument name or number, so it is valid to use the same inlet name in more than one instrument (but not to use the same inlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'asignal',
description: 'audio input signal',
type: 'performance'
},
],
seeAlso: ['Signal Flow Graph Opcodes', 'http://www.csoundjournal.com/issue13/signalFlowGraphOpcodes.html']
},
{
name: 'inletf',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Receives an frate signal (fsig) into an instrument from a named port.',
syntax: 'fsignal = inletf(Sname)',
parameters: [
{
name: 'Sname',
description: 'String name of the inlet port. The name of the inlet is implicitly qualified by the instrument name or number, so it is valid to use the same inlet name in more than one instrument (but not to use the same inlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'ksignal',
description: 'frate input signal',
type: 'performance'
},
],
},
{
name: 'inletk',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Receives a krate signal into an instrument from a named port.',
syntax: 'ksignal = inletk(Sname)',
example: '--8<-- "examples/inletk.csd"',
parameters: [
{
name: 'Sname',
description: 'String name of the inlet port. The name of the inlet is implicitly qualified by the instrument name or number, so it is valid to use the same inlet name in more than one instrument (but not to use the same inlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'ksignal',
description: 'krate input signal',
type: 'performance'
},
],
seeAlso: ['Signal Flow Graph Opcodes', 'http://www.csoundjournal.com/issue13/signalFlowGraphOpcodes.html']
},
{
name: 'inletkid',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Receives a krate signal into an instrument from a named port.',
syntax: 'ksignal = inletkid(Sname, SinstanceID)',
parameters: [
{
name: 'Sname',
description: 'String name of the inlet port. The name of the inlet is implicitly qualified by the instrument name or number, so it is valid to use the same inlet name in more than one instrument (but not to use the same inlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'SinstanceID',
description: 'String name of the outlet port\'s instance ID. This enables the inlet to discriminate between different instances of the outlet, e,g. one instance of the outlet might be created by a note specifying one instance ID, and another instance might be created by a note specifying another ID. This might be used, e.g., to situate difference instances of an instrument at different points in an Ambisonic space in a spatializing effects processor.',
type: 'initialization'
},
{
name: 'ksignal',
description: 'krate input signal',
type: 'performance'
},
],
},
{
name: 'inletv',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Receives an arate array signal into an instrument through a named port.',
syntax: 'array = inletv(Sname)',
parameters: [
{
name: 'Sname',
description: 'String name of the inlet port. The name of the inlet is implicitly qualified by the instrument name or number, so it is valid to use the same inlet name in more than one instrument (but not to use the same inlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'array',
description: 'audio rate array inlet signal',
type: 'performance'
},
],
},
{
name: 'outleta',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Sends an arate signal out from an instrument to a named port.',
syntax: 'outleta(Sname, asignal)',
example: '--8<-- "examples/outleta.csd"',
parameters: [
{
name: 'Sname',
description: 'String name of the outlet port. The name of the outlet is implicitly qualified by the instrument name or number, so it is valid to use the same outlet name in more than one instrument (but not to use the same outlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'asignal',
description: 'audio output signal',
type: 'performance'
},
],
seeAlso: ['Signal Flow Graph Opcodes', 'http://www.csoundjournal.com/issue13/signalFlowGraphOpcodes.html']
},
{
name: 'outletf',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Sends a frate signal (fsig) out from an instrument to a named port.',
syntax: 'outletf(Sname, fsignal)',
parameters: [
{
name: 'Sname',
description: 'String name of the outlet port. The name of the outlet is implicitly qualified by the instrument name or number, so it is valid to use the same outlet name in more than one instrument (but not to use the same outlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'fsignal',
description: 'frate output signal (fsig)',
type: 'performance'
},
],
},
{
name: 'outletk',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Sends a krate signal out from an instrument to a named port.',
syntax: 'outletk(Sname, ksignal)',
example: '--8<-- "examples/outletk.csd"',
parameters: [
{
name: 'Sname',
description: 'String name of the outlet port. The name of the outlet is implicitly qualified by the instrument name or number, so it is valid to use the same outlet name in more than one instrument (but not to use the same outlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'ksignal',
description: 'krate output signal',
type: 'performance'
},
],
seeAlso: ['Signal Flow Graph Opcodes', 'http://www.csoundjournal.com/issue13/signalFlowGraphOpcodes.html']
},
{
name: 'outletkid',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Sends a krate signal out from an instrument to a named port.',
syntax: 'outletkid(Sname, SinstanceID, ksignal)',
parameters: [
{
name: 'Sname',
description: 'String name of the outlet port. The name of the outlet is implicitly qualified by the instrument name or number, so it is valid to use the same outlet name in more than one instrument (but not to use the same outlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'SinstanceID',
description: 'String name of the outlet port\'s instance ID. This enables the inlet to discriminate between different instances of the outlet, e,g. one instance of the outlet might be created by a note specifying one instance ID, and another instance might be created by a note specifying another ID. This might be used, e.g., to situate difference instances of an instrument at different points in an Ambisonic space in a spatializing effects processor.',
type: 'initialization'
},
{
name: 'ksignal',
description: 'krate output signal',
type: 'performance'
},
],
},
{
name: 'outletv',
type: 'opcode',
category: 'Signal Flow Graph Opcodes',
description: 'Sends an arate array signal out from an instrument to a named port.',
syntax: 'outletv(Sname, array)',
parameters: [
{
name: 'Sname',
description: 'String name of the outlet port. The name of the outlet is implicitly qualified by the instrument name or number, so it is valid to use the same outlet name in more than one instrument (but not to use the same outlet name twice in one instrument).',
type: 'initialization'
},
{
name: 'array',
description: 'arate array output signal',
type: 'performance'
},
],
},
]

View File

@ -0,0 +1,173 @@
import type { CsoundReference } from './types'
// Signal Generators:Additive Synthesis/Resynthesis
export const signalGeneratorsAdditiveSynthesisResynthesis: CsoundReference[] = [
{
name: 'adsyn',
type: 'opcode',
category: 'Signal Generators:Additive Synthesis/Resynthesis',
description: 'Output is an additive set of individually controlled sinusoids, using an oscillator bank.',
syntax: 'ares = adsyn(kamod, kfmod, ksmod, ifilcod)',
example: '--8<-- "examples/adsyn-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting a control-file derived from analysis of an audio signal. An integer denotes the suffix of a file _adsyn.m_ or _pvoc.m_; a character-string (in double quotes) gives a filename, optionally a full pathname. If not fullpath, the file is sought first in the current directory, then in the one given by the environment variable [SADIR](../invoke/environment-variables.md) (if defined). _adsyn_ control contains breakpoint amplitude- and frequency-envelope values organized for oscillator resynthesis, while _pvoc_ control contains similar data organized for fft resynthesis. Memory usage depends on the size of the files involved, which are read and held entirely in memory during computation but are shared by multiple calls (see also [lpread](../opcodes/lpread.md)).',
type: 'initialization'
},
{
name: 'kamod',
description: 'amplitude factor of the contributing partials.',
type: 'performance'
},
{
name: 'kfmod',
description: 'frequency factor of the contributing partials. It is a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and .5 down an octave.',
type: 'performance'
},
{
name: 'ksmod',
description: 'speed factor of the contributing partials.',
type: 'performance'
},
],
seeAlso: ['Additive Synthesis/Resynthesis']
},
{
name: 'adsynt',
type: 'opcode',
category: 'Signal Generators:Additive Synthesis/Resynthesis',
description: 'Performs additive synthesis with an arbitrary number of partials, not necessarily harmonic.',
syntax: 'ares = adsynt(kamp, kcps, iwfn, ifreqfn, iampfn, icnt [, iphs])',
example: '--8<-- "examples/adsynt-modern.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'iwfn',
description: 'table containing a waveform, usually a sine. Table values are not interpolated for performance reasons, so larger tables provide better quality.',
type: 'initialization'
},
{
name: 'ifreqfn',
description: 'table containing frequency values for each partial. _ifreqfn_ may contain beginning frequency values for each partial, but is usually used for generating parameters at runtime with _tablew_. Frequencies must be relative to _kcps_. Size must be at least _icnt_.',
type: 'initialization'
},
{
name: 'iampfn',
description: 'table containing amplitude values for each partial. _iampfn_ may contain beginning amplitude values for each partial, but is usually used for generating parameters at runtime with _tablew_. Amplitudes must be relative to _kamp_. Size must be at least _icnt_.',
type: 'initialization'
},
{
name: 'icnt',
description: 'number of partials to be generated',
type: 'initialization'
},
{
name: 'iphs',
description: 'initial phase of each oscillator, if _iphs_ = -1, initialization is skipped. If _iphs_ &gt; 1, all phases will be initialized with a random value.',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude of note',
type: 'performance'
},
{
name: 'kcps',
description: 'base frequency of note. Partial frequencies will be relative to _kcps_.',
type: 'performance'
},
],
seeAlso: ['Additive Synthesis/Resynthesis']
},
{
name: 'adsynt2',
type: 'opcode',
category: 'Signal Generators:Additive Synthesis/Resynthesis',
description: 'Performs additive synthesis with an arbitrary number of partials, not necessarily harmonic. (see [adsynt](../opcodes/adsynt.md) for detailed manual)',
syntax: 'ar = adsynt2(kamp, kcps, iwfn, ifreqfn, iampfn, icnt [, iphs])',
example: '--8<-- "examples/adsynt2-modern.csd"',
rates: ['k-rate', 'i-rate'],
parameters: [
{
name: 'iwfn',
description: 'table containing a waveform, usually a sine. Table values are not interpolated for performance reasons, so larger tables provide better quality.',
type: 'initialization'
},
{
name: 'ifreqfn',
description: 'table containing frequency values for each partial. _ifreqfn_ may contain beginning frequency values for each partial, but is usually used for generating parameters at runtime with _tablew_. Frequencies must be relative to _kcps_. Size must be at least _icnt_.',
type: 'initialization'
},
{
name: 'iampfn',
description: 'table containing amplitude values for each partial. _iampfn_ may contain beginning amplitude values for each partial, but is usually used for generating parameters at runtime with _tablew_. Amplitudes must be relative to _kamp_. Size must be at least _icnt_.',
type: 'initialization'
},
{
name: 'icnt',
description: 'number of partials to be generated',
type: 'initialization'
},
{
name: 'iphs',
description: 'initial phase of each oscillator, if _iphs_ = -1, initialization is skipped. If _iphs_ &gt; 1, all phases will be initialized with a random value.',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude of note',
type: 'performance'
},
{
name: 'kcps',
description: 'base frequency of note. Partial frequencies will be relative to _kcps_.',
type: 'performance'
},
],
seeAlso: ['Additive Synthesis/Resynthesis']
},
{
name: 'hsboscil',
type: 'opcode',
category: 'Signal Generators:Additive Synthesis/Resynthesis',
description: 'An oscillator which takes tonality and brightness as arguments, relative to a base frequency.',
syntax: 'ares = hsboscil(kamp, ktone, kbrite, ibasfreq, iwfn, ioctfn \\\n [, ioctcnt] [, iphs])',
example: '--8<-- "examples/hsboscil.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ibasfreq',
description: 'base frequency to which tonality and brighness are relative',
type: 'initialization'
},
{
name: 'iwfn',
description: 'function table of the waveform, usually a sine',
type: 'initialization'
},
{
name: 'ioctfn',
description: 'function table used for weighting the octaves, usually something like:',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude of note',
type: 'performance'
},
{
name: 'ktone',
description: 'cyclic tonality parameter relative to _ibasfreq_ in logarithmic octave, range 0 to 1, values >&gt; 1 can be used, and are internally reduced to _frac_(_ktone_).',
type: 'performance'
},
{
name: 'kbrite',
description: 'brightness parameter relative to _ibasfreq_, achieved by weighting _ioctcnt_ octaves. It is scaled in such a way, that a value of 0 corresponds to the orignal value of _ibasfreq_, 1 corresponds to one octave above _ibasfreq_, -2 corresponds to two octaves below _ibasfreq_, etc. _kbrite_ may be fractional.',
type: 'performance'
},
],
seeAlso: ['Additive Synthesis/Resynthesis']
},
]

View File

@ -0,0 +1,505 @@
import type { CsoundReference } from './types'
// Signal Generators:Basic Oscillators
export const signalGeneratorsBasicOscillators: CsoundReference[] = [
{
name: 'lfo',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A low frequency oscillator of various shapes.',
syntax: 'kres = lfo(kamp, kcps [, itype])\n ares = lfo(kamp, kcps [, itype])',
example: '--8<-- "examples/lfo.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude of output',
type: 'performance'
},
{
name: 'kcps',
description: 'frequency of oscillator',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'oscbnk',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'Mixes the output of any number of oscillators.',
syntax: 'ares = oscbnk(kcps, kamd, kfmd, kpmd, iovrlap, iseed, kl1minf, kl1maxf, \\\n kl2minf, kl2maxf, ilfomode, keqminf, keqmaxf, keqminl, keqmaxl, \\\n keqminq, keqmaxq, ieqmode, kfn [, il1fn] [, il2fn] [, ieqffn] \\\n [, ieqlfn] [, ieqqfn] [, itabl] [, ioutfn])',
example: '--8<-- "examples/oscbnk.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'iovrlap',
description: 'Number of oscillator units.',
type: 'initialization'
},
{
name: 'iseed',
description: 'Seed value for random number generator (positive integer in the range 1 to 2147483646 (2 ^ 31 - 2)). _iseed_ &lt;= 0 seeds from the current time.',
type: 'initialization'
},
{
name: 'ieqmode',
description: 'Parametric equalizer mode',
type: 'initialization'
},
{
name: 'ilfomode',
description: 'LFO modulation mode, sum of:',
type: 'initialization'
},
{
name: 'ares',
description: 'Output signal.',
type: 'performance'
},
{
name: 'kcps',
description: 'Oscillator frequency in Hz.',
type: 'performance'
},
{
name: 'kamd',
description: 'AM depth (0 - 1).',
type: 'performance'
},
{
name: 'kfmd',
description: 'FM depth (in Hz).',
type: 'performance'
},
{
name: 'kpmd',
description: 'Phase modulation depth.',
type: 'performance'
},
{
name: 'kl1minf',
description: 'LFO1 minimum and maximum frequency in Hz.',
type: 'performance'
},
{
name: 'kl1maxf',
description: 'LFO1 minimum and maximum frequency in Hz.',
type: 'performance'
},
{
name: 'kl2minf',
description: 'LFO2 minimum and maximum frequency in Hz. (Note: oscillator and LFO frequencies are allowed to be zero or negative.)',
type: 'performance'
},
{
name: 'kl2maxf',
description: 'LFO2 minimum and maximum frequency in Hz. (Note: oscillator and LFO frequencies are allowed to be zero or negative.)',
type: 'performance'
},
{
name: 'keqminf',
description: 'Parametric equalizer minimum and maximum frequency in Hz.',
type: 'performance'
},
{
name: 'keqmaxf',
description: 'Parametric equalizer minimum and maximum frequency in Hz.',
type: 'performance'
},
{
name: 'keqminl',
description: 'Parametric equalizer minimum and maximum level.',
type: 'performance'
},
{
name: 'keqmaxl',
description: 'Parametric equalizer minimum and maximum level.',
type: 'performance'
},
{
name: 'keqminq',
description: 'Parametric equalizer minimum and maximum Q.',
type: 'performance'
},
{
name: 'keqmaxq',
description: 'Parametric equalizer minimum and maximum Q.',
type: 'performance'
},
{
name: 'kfn',
description: 'Oscillator waveform table. Table number can be changed at k-rate (this is useful to select from a set of band-limited tables generated by GEN30, to avoid aliasing). The table is read with linear interpolation.',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'oscil',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A simple oscillator without any interpolation.',
syntax: 'ares = oscil(xamp, xcps [, ifn, iphs])\n kres = oscil(kamp, kcps [, ifn, iphs])',
example: '--8<-- "examples/oscil.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: '(optional) function table number. Requires a wrap-around guard point. The table number defaults to -1 which indicates a sinewave.',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude',
type: 'performance'
},
{
name: 'xamp',
description: 'amplitude',
type: 'performance'
},
{
name: 'kcps',
description: 'frequency in cycles per second.',
type: 'performance'
},
{
name: 'xcps',
description: 'frequency in cycles per second.',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'oscil3',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A simple oscillator with cubic interpolation.',
syntax: 'ares = oscil3(xamp, xcps [, ifn, iphs])\n kres = oscil3(kamp, kcps [, ifn, iphs])',
example: '--8<-- "examples/oscil3.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude',
type: 'performance'
},
{
name: 'xamp',
description: 'amplitude',
type: 'performance'
},
{
name: 'kcps',
description: 'frequency in cycles per second.',
type: 'performance'
},
{
name: 'xcps',
description: 'frequency in cycles per second.',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'oscili',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A simple oscillator with linear interpolation.',
syntax: 'ares = oscili(xamp, xcps[, ifn, iphs])\n kres = oscili(kamp, kcps[, ifn, iphs])',
example: '--8<-- "examples/oscili.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude',
type: 'performance'
},
{
name: 'xamp',
description: 'amplitude',
type: 'performance'
},
{
name: 'kcps',
description: 'frequency in cycles per second.',
type: 'performance'
},
{
name: 'xcps',
description: 'frequency in cycles per second.',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'oscilikt',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A linearly interpolated oscillator that allows changing the table number at k-rate.',
syntax: 'ares = oscilikt(xamp, xcps, kfn [, iphs] [, istor])\n kres = oscilikt(kamp, kcps, kfn [, iphs] [, istor])',
example: '--8<-- "examples/oscilikt.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude.',
type: 'performance'
},
{
name: 'xamp',
description: 'amplitude.',
type: 'performance'
},
{
name: 'kcps',
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
type: 'performance'
},
{
name: 'xcps',
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
type: 'performance'
},
{
name: 'kfn',
description: 'function table number. Can be varied at control rate (useful to <quote>morph</quote> waveforms, or select from a set of band-limited tables generated by [GEN30](../scoregens/gen30.md)).',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'osciliktp',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A linearly interpolated oscillator that allows allows phase modulation.',
syntax: 'ares = osciliktp(kcps, kfn, kphs [, istor])',
example: '--8<-- "examples/osciliktp.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ares',
description: 'audio-rate ouptut signal.',
type: 'performance'
},
{
name: 'kcps',
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
type: 'performance'
},
{
name: 'kfn',
description: 'function table number. Can be varied at control rate (useful to <quote>morph</quote> waveforms, or select from a set of band-limited tables generated by [GEN30](../scoregens/gen30.md)).',
type: 'performance'
},
{
name: 'kphs',
description: 'phase (k-rate), the expected range is 0 to 1. The absolute value of the difference of the current and previous value of _kphs_ must be less than [ksmps](../opcodes/ksmps.md).',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'oscilikts',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A linearly interpolated oscillator with sync status that allows changing the table number at k-rate.',
syntax: 'ares = oscilikts(xamp, xcps, kfn, async, kphs [, istor])',
example: '--8<-- "examples/oscilikts.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'xamp',
description: 'amplitude.',
type: 'performance'
},
{
name: 'xcps',
description: 'frequency in Hz. Zero and negative values are allowed. However, the absolute value must be less than [sr](../opcodes/sr.md) (and recommended to be less than _sr_/2).',
type: 'performance'
},
{
name: 'kfn',
description: 'function table number. Can be varied at control rate (useful to <quote>morph</quote> waveforms, or select from a set of band-limited tables generated by [GEN30](../scoregens/gen30.md)).',
type: 'performance'
},
{
name: 'async',
description: 'any positive value resets the phase of _oscilikts_ to _kphs_. Zero or negative values have no effect.',
type: 'performance'
},
{
name: 'kphs',
description: 'sets the phase, initially and when it is re-initialized with async.',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'osciln',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'Accesses table values at a user-defined frequency.',
syntax: 'ares = osciln(kamp, ifrq, ifn, itimes)',
example: '--8<-- "examples/osciln.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ifrq',
description: 'rate and number of times through the stored table.',
type: 'initialization'
},
{
name: 'itimes',
description: 'rate and number of times through the stored table.',
type: 'initialization'
},
{
name: 'ifn',
description: 'function table number.',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude factor',
type: 'performance'
},
],
seeAlso: ['Table Access']
},
{
name: 'oscils',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'A simple, fast sine oscillator.',
syntax: 'ares = oscils(iamp, icps, iphs [, iflg])',
example: '--8<-- "examples/oscils.csd"',
rates: ['a-rate', 'i-rate'],
parameters: [
{
name: 'iamp',
description: 'output amplitude.',
type: 'initialization'
},
{
name: 'icps',
description: 'frequency in Hz (may be zero or negative, however the absolute value must be less than _sr_/2).',
type: 'initialization'
},
{
name: 'iphs',
description: 'start phase between 0 and 1.',
type: 'initialization'
},
{
name: 'iflg',
description: 'sum of the following values:',
type: 'initialization'
},
{
name: 'ares',
description: 'audio output',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'oscilx',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'Same as the [osciln](../opcodes/osciln.md) opcode.',
},
{
name: 'poscil',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'High precision oscillator.',
syntax: 'ares = poscil(aamp, acps [, ifn, iphs])\n ares = poscil(aamp, kcps [, ifn, iphs])\n ares = poscil(kamp, acps [, ifn, iphs])\n ares = poscil(kamp, kcps [, ifn, iphs])\n ires = poscil(kamp, kcps [, ifn, iphs])\n kres = poscil(kamp, kcps [, ifn, iphs])',
example: '--8<-- "examples/poscil-modern.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: '(optional) function table number. This defaults to -1 which indicates a sinewave.',
type: 'initialization'
},
{
name: 'ares',
description: 'output signal',
type: 'performance'
},
{
name: 'kamp',
description: 'the amplitude of the output signal.',
type: 'performance'
},
{
name: 'aamp',
description: 'the amplitude of the output signal.',
type: 'performance'
},
{
name: 'kcps',
description: 'the frequency of the output signal in cycles per second.',
type: 'performance'
},
{
name: 'acps',
description: 'the frequency of the output signal in cycles per second.',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
{
name: 'poscil3',
type: 'opcode',
category: 'Signal Generators:Basic Oscillators',
description: 'High precision oscillator with cubic interpolation.',
syntax: 'ares = poscil3(aamp, acps [, ifn, iphs])\n ares = poscil3(aamp, kcps [, ifn, iphs])\n ares = poscil3(kamp, acps [, ifn, iphs])\n ares = poscil3(kamp, kcps [, ifn, iphs])\n ires = poscil3(kamp, kcps [, ifn, iphs])\n kres = poscil3(kamp, kcps [, ifn, iphs])',
example: '--8<-- "examples/poscil3.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: '(optional) function table number. This defaults to -1 which indicates a sinewave.',
type: 'initialization'
},
{
name: 'ares',
description: 'output signal',
type: 'performance'
},
{
name: 'kamp',
description: 'the amplitude of the output signal.',
type: 'performance'
},
{
name: 'aamp',
description: 'the amplitude of the output signal.',
type: 'performance'
},
{
name: 'kcps',
description: 'the frequency of the output signal in cycles per second.',
type: 'performance'
},
{
name: 'acps',
description: 'the frequency of the output signal in cycles per second.',
type: 'performance'
},
],
seeAlso: ['Basic Oscillators']
},
]

View File

@ -0,0 +1,137 @@
import type { CsoundReference } from './types'
// Signal Generators:Dynamic Spectrum Oscillators
export const signalGeneratorsDynamicSpectrumOscillators: CsoundReference[] = [
{
name: 'buzz',
type: 'opcode',
category: 'Signal Generators:Dynamic Spectrum Oscillators',
description: 'Output is a set of harmonically related sine partials.',
syntax: 'ares = buzz(xamp, xcps, knh, ifn [, iphs])',
example: '--8<-- "examples/buzz-modern.csd"',
rates: ['a-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: 'table number of a stored function containing a sine wave. A large table of at least 8192 points is recommended.',
type: 'initialization'
},
{
name: 'xamp',
description: 'amplitude',
type: 'performance'
},
{
name: 'xcps',
description: 'frequency in cycles per second',
type: 'performance'
},
{
name: 'knh',
description: 'total number of harmonics requested. New in Csound version 3.57, _knh_ defaults to one. If _knh_ is negative, the absolute value is used.',
type: 'performance'
},
],
seeAlso: ['Dynamic Spectrum Oscillators']
},
{
name: 'gbuzz',
type: 'opcode',
category: 'Signal Generators:Dynamic Spectrum Oscillators',
description: 'Output is a set of harmonically related cosine partials.',
syntax: 'ares = gbuzz(xamp, xcps, knh, klh, kmul, ifn [, iphs])',
example: '--8<-- "examples/gbuzz.csd"',
rates: ['a-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: 'table number of a stored function containing a cosine wave. A large table of at least 8192 points is recommended.',
type: 'initialization'
},
{
name: 'knh',
description: 'total number of harmonics requested. If _knh_ is negative, the absolute value is used. If _knh_ is zero, a value of 1 is used.',
type: 'performance'
},
{
name: 'klh',
description: 'lowest harmonic present. Can be positive, zero or negative. In _gbuzz_ the set of partials can begin at any partial number and proceeds upwards; if _klh_ is negative, all partials below zero will reflect as positive partials without phase change (since cosine is an even function), and will add constructively to any positive partials in the set.',
type: 'performance'
},
{
name: 'kmul',
description: 'specifies the multiplier in the series of amplitude coefficients. This is a power series: if the _klh_th partial has a strength coefficient of A, the (_klh_ + n)th partial will have a coefficient of A * (_kmul_ ** n), i.e. strength values trace an exponential curve. _kmul_ may be positive, zero or negative, and is not restricted to integers.',
type: 'performance'
},
],
seeAlso: ['Dynamic Spectrum Oscillators']
},
{
name: 'mpulse',
type: 'opcode',
category: 'Signal Generators:Dynamic Spectrum Oscillators',
description: 'Generates a set of impulses.',
syntax: 'ares = mpulse(kamp, kintvl [, ioffset])',
example: '--8<-- "examples/mpulse.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude of the impulses generated',
type: 'performance'
},
{
name: 'kintvl',
description: 'Interval of time in seconds (or samples if _kintvl_ is negative) to the next pulse.',
type: 'performance'
},
],
seeAlso: ['Dynamic Spectrum Oscillators']
},
{
name: 'squinewave',
type: 'opcode',
category: 'Signal Generators:Dynamic Spectrum Oscillators',
description: 'A mostly bandlimited shape-shifting square-pulse-saw-sinewave oscillator with hardsync.',
syntax: 'aout [, asyncout] = squinewave(acps, aClip, aSkew, asyncin [, iMinSweep] [, iphase])\n aout [, asyncout] = squinewave(acps, aClip, aSkew [, ksyncin] [, iMinSweep] [, iphase])',
example: '--8<-- "examples/squinewave.csd"',
parameters: [
{
name: 'aout',
description: 'audio output, normalized +/-1',
type: 'performance'
},
{
name: 'asyncout',
description: '(optional) - Sync signal: 1 at endpoint of each cycle, else 0.',
type: 'performance'
},
{
name: 'acps',
description: 'frequency. Range 0-anything; negative freq not implemented.',
type: 'performance'
},
{
name: 'aClip',
description: '"squareness" of waveform shape. Range 0-1. Clip 0 is sinewave (or saw), clip 1 is squarewave (or pulse).',
type: 'performance'
},
{
name: 'aSkew',
description: 'symmetry of waveform shape. Range -1 to +1. Skew = 0 is symmetric like sine or square. Skew +1 or -1 is right/left-facing saw or pulse.',
type: 'performance'
},
{
name: 'asyncin',
description: '(optional, ignored if not a-rate) - when &gt;= 1, waveform quickly sweeps to phase 0. Sweep length is 0 to about 1.5*iMinSweep samples depending on current phase.',
type: 'performance'
},
{
name: 'ksyncin',
description: '(optional, ignored if not a-rate) - when &gt;= 1, waveform quickly sweeps to phase 0. Sweep length is 0 to about 1.5*iMinSweep samples depending on current phase.',
type: 'performance'
},
],
seeAlso: ['Dynamic Spectrum Oscillators']
},
]

View File

@ -0,0 +1,341 @@
import type { CsoundReference } from './types'
// Signal Generators:Envelope Generators
export const signalGeneratorsEnvelopeGenerators: CsoundReference[] = [
{
name: 'adsr',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'Calculates the classical ADSR envelope using linear segments.',
syntax: 'ares = adsr(iatt, idec, islev, irel [, idel])\n kres = adsr(iatt, idec, islev, irel [, idel])',
example: '--8<-- "examples/adsr-modern.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'iatt',
description: 'duration of attack phase',
type: 'initialization'
},
{
name: 'idec',
description: 'duration of decay',
type: 'initialization'
},
{
name: 'islev',
description: 'level for sustain phase',
type: 'initialization'
},
{
name: 'irel',
description: 'duration of release phase',
type: 'initialization'
},
{
name: 'idel',
description: 'period of zero before the envelope starts',
type: 'initialization'
},
],
seeAlso: ['Envelope Generators']
},
{
name: 'envlpx',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'Applies an envelope consisting of 3 segments.',
syntax: 'ares = envlpx(xamp, irise, idur, idec, ifn, iatss, iatdec [, ixmod])\n kres = envlpx(kamp, irise, idur, idec, ifn, iatss, iatdec [, ixmod])',
example: '--8<-- "examples/envlpx.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'irise',
description: 'rise time in seconds. A zero or negative value signifies no rise modification.',
type: 'initialization'
},
{
name: 'idur',
description: 'overall duration in seconds. A zero or negative value will cause initialization to be skipped.',
type: 'initialization'
},
{
name: 'idec',
description: 'decay time in seconds. Zero means no decay. An _idec_ &gt; _idur_ will cause a truncated decay.',
type: 'initialization'
},
{
name: 'ifn',
description: 'function table number of stored rise shape with extended guard point.',
type: 'initialization'
},
{
name: 'iatss',
description: 'the ratio of the final value of the pseudo-steady-state period to the value at its beginning (i.e the attenuation from the end of the rise segment to the start of the decay). A ratio greater than 1 causes an exponential growth and a ratio less than 1 creates an exponential decay. A ratio of 1 will maintain a true steady state at the last rise value. Note that this attenuation is not at a fixed rate (as in a piano), but is sensitive to a note\'s duration. However, if _iatss_ is negative (or if steady state &lt; 4 k-periods) a fixed attenuation rate of _abs_(_iatss_) per second will be used. 0 is illegal.',
type: 'initialization'
},
{
name: 'iatdec',
description: 'the ratio of the value at the end of the decay period to the value at its beginning (the end of the steady-state segment) . It must be positive and is normally of the order of .01. A large or excessively small value is apt to produce a cutoff which is audible. A zero or negative value is illegal.',
type: 'initialization'
},
{
name: 'kamp',
description: 'input amplitude signal.',
type: 'performance'
},
{
name: 'xamp',
description: 'input amplitude signal.',
type: 'performance'
},
],
seeAlso: ['Envelope Generators']
},
{
name: 'envlpxr',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'The _envlpx_ opcode with a final release segment.',
syntax: 'ares = envlpxr(xamp, irise, idec, ifn, iatss, iatdec [, ixmod] [,irind])\n kres = envlpxr(kamp, irise, idec, ifn, iatss, iatdec [, ixmod] [,irind])',
example: '--8<-- "examples/envlpxr.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'irise',
description: 'rise time in seconds. A zero or negative value signifies no rise modification.',
type: 'initialization'
},
{
name: 'idec',
description: 'decay time in seconds. Zero means no decay.',
type: 'initialization'
},
{
name: 'ifn',
description: 'function table number of stored rise shape with extended guard point.',
type: 'initialization'
},
{
name: 'iatss',
description: 'attenuation factor determining the exponential change in value over time during the pseudo steady state period between the end of the rise and the beginning of the decay (at the note\'s release). A factor greater than 1 causes an exponential growth and a factor less than 1 creates an exponential decay. A factor of 1 will maintain a true steady state at the last rise value; 0 is illegal. The value will change by _abs_(_iatss_) per second.',
type: 'initialization'
},
{
name: 'iatdec',
description: 'the ratio of the value at the end of the decay period to the value at its beginning (when the note is released). It must be positive and is normally of the order of .01. A large or excessively small value is apt to produce a cutoff which is audible. A zero or negative value is illegal.',
type: 'initialization'
},
{
name: 'kamp',
description: 'input amplitude signal.',
type: 'performance'
},
{
name: 'xamp',
description: 'input amplitude signal.',
type: 'performance'
},
],
seeAlso: ['Envelope Generators']
},
{
name: 'gtadsr',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'A gated linear attack-decay-sustain with exponential release.',
syntax: 'ares = gtadsr(asig, katt, kdec, ksus, krel, kgate)\n xres = gtadsr(kamp, katt, kdec, ksus, krel, kgate)',
example: '--8<-- "examples/gtadsr.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'x',
description: 'output signal (k or a-rate)',
type: 'performance'
},
{
name: 'ares',
description: 'output signal (k or a-rate)',
type: 'performance'
},
{
name: 'asig',
description: 'input signal (envelope as an amplitude processor)',
type: 'performance'
},
{
name: 'kamp',
description: 'maximum amplitude (envelope as a signal generator)',
type: 'performance'
},
{
name: 'katt',
description: 'duration of attack phase',
type: 'performance'
},
{
name: 'kdec',
description: 'duration of decay',
type: 'performance'
},
{
name: 'ksus',
description: 'level for sustain phase (in the range 0 - 1)',
type: 'performance'
},
{
name: 'krel',
description: 'duration of release phase',
type: 'performance'
},
{
name: 'kgate',
description: 'gate signal (0 = low, > 0 high).',
type: 'performance'
},
],
seeAlso: ['Envelope Generators']
},
{
name: 'linen',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'Applies a straight line rise and decay pattern to an input amp signal.',
syntax: 'ares = linen(xamp, irise, idur, idec)\n kres = linen(kamp, irise, idur, idec)',
example: '--8<-- "examples/linen.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'irise',
description: 'rise time in seconds. A zero or negative value signifies no rise modification.',
type: 'initialization'
},
{
name: 'idur',
description: 'overall duration in seconds. A zero or negative value will cause initialization to be skipped.',
type: 'initialization'
},
{
name: 'idec',
description: 'decay time in seconds. Zero means no decay. An _idec_ &gt; _idur_ will cause a truncated decay.',
type: 'initialization'
},
{
name: 'kamp',
description: 'input amplitude signal.',
type: 'performance'
},
{
name: 'xamp',
description: 'input amplitude signal.',
type: 'performance'
},
],
seeAlso: ['Envelope Generators']
},
{
name: 'linenr',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'The _linen_ opcode extended with a final release segment.',
syntax: 'ares = linenr(xamp, irise, idec, iatdec)\n kres = linenr(kamp, irise, idec, iatdec)',
example: '--8<-- "examples/linenr.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'irise',
description: 'rise time in seconds. A zero or negative value signifies no rise modification.',
type: 'initialization'
},
{
name: 'idec',
description: 'decay time in seconds. Zero means no decay.',
type: 'initialization'
},
{
name: 'iatdec',
description: 'attenuation factor by which the closing steady state value is reduced exponentially over the decay period. This value must be positive and is normally of the order of .01. A large or excessively small value is apt to produce a cutoff which is audible. A zero or negative value is illegal.',
type: 'initialization'
},
{
name: 'kamp',
description: 'input amplitude signal.',
type: 'performance'
},
{
name: 'xamp',
description: 'input amplitude signal.',
type: 'performance'
},
],
seeAlso: ['Envelope Generators']
},
{
name: 'madsr',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'Calculates the classical ADSR envelope using the [linsegr](../opcodes/linsegr.md) mechanism.',
syntax: 'ares = madsr(iatt, idec, islev, irel [, idel] [, ireltim])\n kres = madsr(iatt, idec, islev, irel [, idel] [, ireltim])',
example: '--8<-- "examples/madsr.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'iatt',
description: 'duration of attack phase',
type: 'initialization'
},
{
name: 'idec',
description: 'duration of decay',
type: 'initialization'
},
{
name: 'islev',
description: 'level for sustain phase',
type: 'initialization'
},
{
name: 'irel',
description: 'duration of release phase.',
type: 'initialization'
},
{
name: 'idel',
description: 'period of zero before the envelope starts',
type: 'initialization'
},
],
seeAlso: ['Envelope Generators']
},
{
name: 'mxadsr',
type: 'opcode',
category: 'Signal Generators:Envelope Generators',
description: 'Calculates the classical ADSR envelope using the [expsegr](../opcodes/expsegr.md) mechanism.',
syntax: 'ares = mxadsr(iatt, idec, islev, irel [, idel] [, ireltim])\n kres = mxadsr(iatt, idec, islev, irel [, idel] [, ireltim])',
example: '--8<-- "examples/mxadsr.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'iatt',
description: 'duration of attack phase',
type: 'initialization'
},
{
name: 'idec',
description: 'duration of decay',
type: 'initialization'
},
{
name: 'islev',
description: 'level for sustain phase',
type: 'initialization'
},
{
name: 'irel',
description: 'duration of release phase',
type: 'initialization'
},
],
seeAlso: ['Envelope Generators']
},
]

View File

@ -0,0 +1,510 @@
import type { CsoundReference } from './types'
// Signal Generators:FM Synthesis
export const signalGeneratorsFmSynthesis: CsoundReference[] = [
{
name: 'crossfm',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Two oscillators, mutually frequency and/or phase modulated by each other.',
syntax: 'a1, a2 = crossfm(xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2])\n a1, a2 = crossfmi(xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2])\n a1, a2 = crosspm(xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2])\n a1, a2 = crosspmi(xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2])\n a1, a2 = crossfmpm(xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2])\n a1, a2 = crossfmpmi(xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2])',
example: '--8<-- "examples/crossfm.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'ifn1',
description: 'function table number for oscillator #1. Requires a wrap-around guard point.',
type: 'initialization'
},
{
name: 'ifn2',
description: 'function table number for oscillator #2. Requires a wrap-around guard point.',
type: 'initialization'
},
{
name: 'xfrq1',
description: 'a factor that, when multipled by the _kcps_ parameter, gives the frequency of oscillator #1.',
type: 'performance'
},
{
name: 'xfrq2',
description: 'a factor that, when multipled by the _kcps_ parameter, gives the frequency of oscillator #2.',
type: 'performance'
},
{
name: 'xndx1',
description: 'the index of the modulation of oscillator #2 by oscillator #1.',
type: 'performance'
},
{
name: 'xndx2',
description: 'the index of the modulation of oscillator #1 by oscillator #2.',
type: 'performance'
},
{
name: 'kcps',
description: 'a common denominator, in cycles per second, for both oscillators frequencies.',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis', 'http://www.csoundjournal.com/issue12/crossfm.html']
},
{
name: 'fmb3',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Uses FM synthesis to create a Hammond B3 organ sound.',
syntax: 'ares = fmb3(kamp, kfreq, kc1, kc2, kvdepth, kvrate[, ifn1, ifn2, ifn3, \\\n ifn4, ivfn])',
example: '--8<-- "examples/fmb3.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ifn1',
description: 'sine wave * _ifn2_ -- sine wave * _ifn3_ -- sine wave * _ifn4_ -- sine wave',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency of note played.',
type: 'performance'
},
{
name: 'kc1',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc2',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc1',
description: 'Total mod index * _kc2_ -- Crossfade of two modulators * _Algorithm_ -- 4',
type: 'performance'
},
{
name: 'kvdepth',
description: 'Vibrator depth',
type: 'performance'
},
{
name: 'kvrate',
description: 'Vibrator rate',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'fmbell',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Uses FM synthesis to create a tublar bell sound.',
syntax: 'ares = fmbell(kamp, kfreq, kc1, kc2, kvdepth, kvrate[, ifn1, ifn2, ifn3, \\\n ifn4, ivfn, isus])',
example: '--8<-- "examples/fmbell.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ifn1',
description: 'sine wave * _ifn2_ -- sine wave * _ifn3_ -- sine wave * _ifn4_ -- sine wave',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency of note played.',
type: 'performance'
},
{
name: 'kc1',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc2',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc1',
description: 'Mod index 1 * _kc2_ -- Crossfade of two outputs * _Algorithm_ -- 5',
type: 'performance'
},
{
name: 'kvdepth',
description: 'Vibrator depth',
type: 'performance'
},
{
name: 'kvrate',
description: 'Vibrator rate',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'fmmetal',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Uses FM synthesis to create a &#8220;Heavy Metal&#8221; sound.',
syntax: 'ares = fmmetal(kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, ifn3, \\\n ifn4, ivfn)',
example: '--8<-- "examples/fmmetal.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ifn1',
description: 'sine wave * _ifn2_ -- [twopeaks.aiff](../examples/twopeaks.aiff) * _ifn3_ -- [twopeaks.aiff](../examples/twopeaks.aiff) * _ifn4_ -- sine wave',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency of note played.',
type: 'performance'
},
{
name: 'kc1',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc2',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc1',
description: 'Total mod index * _kc2_ -- Crossfade of two modulators * _Algorithm_ -- 3',
type: 'performance'
},
{
name: 'kvdepth',
description: 'Vibrator depth',
type: 'performance'
},
{
name: 'kvrate',
description: 'Vibrator rate',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'fmpercfl',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Uses FM synthesis to create a percussive flute sound.',
syntax: 'ares = fmpercfl(kamp, kfreq, kc1, kc2, kvdepth, kvrate[, ifn1, ifn2, \\\n ifn3, ifn4, ivfn])',
example: '--8<-- "examples/fmpercfl.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ifn1',
description: 'sine wave * _ifn2_ -- sine wave * _ifn3_ -- sine wave * _ifn4_ -- sine wave',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency of note played.',
type: 'performance'
},
{
name: 'kc1',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc2',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc1',
description: 'Total mod index * _kc2_ -- Crossfade of two modulators * _Algorithm_ -- 4',
type: 'performance'
},
{
name: 'kvdepth',
description: 'Vibrator depth',
type: 'performance'
},
{
name: 'kvrate',
description: 'Vibrator rate',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'fmrhode',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Uses FM synthesis to create a Fender Rhodes electric piano sound.',
syntax: 'ares = fmrhode(kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, \\\n ifn3, ifn4, ivfn)',
example: '--8<-- "examples/fmrhode.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ifn1',
description: 'sine wave * _ifn2_ -- sine wave * _ifn3_ -- sine wave * _ifn4_ -- [fwavblnk.aiff](../examples/fwavblnk.aiff)',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency of note played.',
type: 'performance'
},
{
name: 'kc1',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc2',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc1',
description: 'Mod index 1 * _kc2_ -- Crossfade of two outputs * _Algorithm_ -- 5',
type: 'performance'
},
{
name: 'kvdepth',
description: 'Vibrator depth',
type: 'performance'
},
{
name: 'kvrate',
description: 'Vibrator rate',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'fmvoice',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'FM Singing Voice Synthesis.',
syntax: 'ares = fmvoice(kamp, kfreq, kvowel, ktilt, kvibamt, kvibrate[, ifn1, \\\n ifn2, ifn3, ifn4, ivibfn])',
example: '--8<-- "examples/fmvoice.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ifn1',
description: 'Tables, usually of sinewaves. The last is for vibrato',
type: 'initialization'
},
{
name: 'ifn2',
description: 'Tables, usually of sinewaves. The last is for vibrato',
type: 'initialization'
},
{
name: 'ifn3',
description: 'Tables, usually of sinewaves. The last is for vibrato',
type: 'initialization'
},
{
name: 'ifn3',
description: 'Tables, usually of sinewaves. The last is for vibrato',
type: 'initialization'
},
{
name: 'ivibfn',
description: 'Tables, usually of sinewaves. The last is for vibrato',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency of note played.',
type: 'performance'
},
{
name: 'kvowel',
description: 'the vowel being sung, in the range 0-64',
type: 'performance'
},
{
name: 'ktilt',
description: 'the spectral tilt of the sound in the range 0 to 99',
type: 'performance'
},
{
name: 'kvibamt',
description: 'Depth of vibrato',
type: 'performance'
},
{
name: 'kvibrate',
description: 'Rate of vibrato',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'fmwurlie',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Uses FM synthesis to create a Wurlitzer electric piano sound.',
syntax: 'ares = fmwurlie(kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, ifn3, \\\n ifn4, ivfn)',
example: '--8<-- "examples/fmwurlie.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ifn1',
description: 'sine wave * _ifn2_ -- sine wave * _ifn3_ -- sine wave * _ifn4_ -- [fwavblnk.aiff](../examples/fwavblnk.aiff)',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Frequency of note played.',
type: 'performance'
},
{
name: 'kc1',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc2',
description: 'Controls for the synthesizer:',
type: 'performance'
},
{
name: 'kc1',
description: 'Mod index 1 * _kc2_ -- Crossfade of two outputs * _Algorithm_ -- 5',
type: 'performance'
},
{
name: 'kvdepth',
description: 'Vibrator depth',
type: 'performance'
},
{
name: 'kvrate',
description: 'Vibrator rate',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'foscil',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'A basic frequency modulated oscillator.',
syntax: 'ares = foscil(xamp, kcps, xcar, xmod, kndx [, ifn , iphs])',
example: '--8<-- "examples/foscil.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'xamp',
description: 'the amplitude of the output signal.',
type: 'performance'
},
{
name: 'kcps',
description: 'a common denominator, in cycles per second, for the carrier and modulating frequencies.',
type: 'performance'
},
{
name: 'xcar',
description: 'a factor that, when multiplied by the _kcps_ parameter, gives the carrier frequency.',
type: 'performance'
},
{
name: 'xmod',
description: 'a factor that, when multiplied by the _kcps_ parameter, gives the modulating frequency.',
type: 'performance'
},
{
name: 'kndx',
description: 'the modulation index.',
type: 'performance'
},
{
name: 'xcar',
description: '_n_ * _xmod_), _n_ = 0,1,2,... The input _kndx_ is the index of modulation (usually time-varying and ranging 0 to 4 or so) which determines the spread of acoustic energy over the partial positions given by _n_ = 0,1,2,.., etc. _ifn_ should point to a stored sine wave. Previous to version 3.50, _xcar_ and _xmod_ could be k-rate only.',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
{
name: 'foscili',
type: 'opcode',
category: 'Signal Generators:FM Synthesis',
description: 'Basic frequency modulated oscillator with linear interpolation.',
syntax: 'ares = foscili(xamp, kcps, xcar, xmod, kndx [, ifn, iphs])',
example: '--8<-- "examples/foscili.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'xamp',
description: 'the amplitude of the output signal.',
type: 'performance'
},
{
name: 'kcps',
description: 'a common denominator, in cycles per second, for the carrier and modulating frequencies.',
type: 'performance'
},
{
name: 'xcar',
description: 'a factor that, when multiplied by the _kcps_ parameter, gives the carrier frequency.',
type: 'performance'
},
{
name: 'xmod',
description: 'a factor that, when multiplied by the _kcps_ parameter, gives the modulating frequency.',
type: 'performance'
},
{
name: 'kndx',
description: 'the modulation index.',
type: 'performance'
},
],
seeAlso: ['FM Synthesis', 'http://en.wikipedia.org/wiki/Frequency_modulation_synthesis']
},
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,172 @@
import type { CsoundReference } from './types'
// Signal Generators:Hyper Vectorial Synthesis
export const signalGeneratorsHyperVectorialSynthesis: CsoundReference[] = [
{
name: 'hvs1',
type: 'opcode',
category: 'Signal Generators:Hyper Vectorial Synthesis',
description: 'Allows one-dimensional Hyper Vectorial Synthesis (HVS) controlled by externally-updated k-variables.',
syntax: 'hvs1(kx, inumParms, inumPointsX, iOutTab, iPositionsTab, iSnapTab [, iConfigTab])',
example: '--8<-- "examples/hvs1.csd"',
parameters: [
{
name: 'inumParms',
description: 'number of parameters controlled by the HVS. Each HVS snapshot is made up of inumParms elements.',
type: 'initialization'
},
{
name: 'inumPointsX',
description: 'number of points that each dimension of the HVS cube (or square in case of two-dimensional HVS; or line in case of one-dimensional HVS) is made up.',
type: 'initialization'
},
{
name: 'iOutTab',
description: 'number of the table receiving the set of output-parameter instant values of the HVS. The total amount of parameters is defined by the _inumParms_ argument.',
type: 'initialization'
},
{
name: 'iPositionsTab',
description: 'a table filled with the individual positions of snapshots in the HVS matrix (see below for more information).',
type: 'initialization'
},
{
name: 'iSnapTab',
description: 'a table filled with all the snapshots. Each snapshot is made up of a set of parameter values. The amount of elements contained in each snapshots is specified by the _inumParms_ argument. The set of elements of each snapshot follows (and is adjacent) to the previous one in this table. So the total size of this table should be >= to _inumParms_ multiplied the number of snapshots you intend to store for the HVS.',
type: 'initialization'
},
{
name: 'iConfigTab',
description: '(optional) a table containing the behavior of the HVS for each parameter. If the value of _iConfigTab_ is zero (default), this argument is ignored, meaning that each parameter is treated with linear interpolation by the HVS. If _iConfigTab_ is different than zero, then it must refer to an existing table whose contents are in its turn referring to a particolar kind of interpolation. In this table, a value of -1 indicates that corresponding parameter is leaved unchanged (ignored) by the HVS; a value of zero indicates that corresponding parameter is treated with linear-interpolation; each other values must be integer numbers indicating an existing table filled with a shape which will determine the kind of special interpolation to be used (table-based interpolation).',
type: 'initialization'
},
{
name: 'kx',
description: 'these are externally-modified variables which controls the motion of the pointer in the HVS matrix cube (or square or line in case of HVS matrices made up of less than 3 dimensions). The range of these input arguments must be 0 to 1.',
type: 'performance'
},
],
seeAlso: ['Hyper Vectorial Synthesis']
},
{
name: 'hvs2',
type: 'opcode',
category: 'Signal Generators:Hyper Vectorial Synthesis',
description: 'Allows two-dimensional Hyper Vectorial Synthesis (HVS) controlled by externally-updated k-variables.',
syntax: 'hvs2(kx, ky, inumParms, inumPointsX, inumPointsY, iOutTab, iPositionsTab, \\\n iSnapTab [, iConfigTab])',
example: '--8<-- "examples/hvs2.csd"',
parameters: [
{
name: 'inumParms',
description: 'number of parameters controlled by the HVS. Each HVS snapshot is made up of _inumParms_ elements.',
type: 'initialization'
},
{
name: 'inumPointsX',
description: 'number of points that each dimension of the HVS cube (or square in case of two-dimensional HVS; or line in case of one-dimensional HVS) is made up.',
type: 'initialization'
},
{
name: 'inumPointsY',
description: 'number of points that each dimension of the HVS cube (or square in case of two-dimensional HVS; or line in case of one-dimensional HVS) is made up.',
type: 'initialization'
},
{
name: 'iOutTab',
description: 'number of the table receiving the set of output-parameter instant values of the HVS. The total amount of parameters is defined by the _inumParms_ argument.',
type: 'initialization'
},
{
name: 'iPositionsTab',
description: 'a table filled with the individual positions of snapshots in the HVS matrix (see below for more information).',
type: 'initialization'
},
{
name: 'iSnapTab',
description: 'a table filled with all the snapshots. Each snapshot is made up of a set of parameter values. The amount of elements contained in each snapshots is specified by the _inumParms_ argument. The set of elements of each snapshot follows (and is adjacent) to the previous one in this table. So the total size of this table should be >= to _inumParms_ multiplied the number of snapshots you intend to store for the HVS.',
type: 'initialization'
},
{
name: 'iConfigTab',
description: '(optional) a table containing the behavior of the HVS for each parameter. If the value of _iConfigTab_ is zero (default), this argument is ignored, meaning that each parameter is treated with linear interpolation by the HVS. If _iConfigTab_ is different than zero, then it must refer to an existing table whose contents are in its turn referring to a particolar kind of interpolation. In this table, a value of -1 indicates that corresponding parameter is leaved unchanged (ignored) by the HVS; a value of zero indicates that corresponding parameter is treated with linear-interpolation; each other values must be integer numbers indicating an existing table filled with a shape which will determine the kind of special interpolation to be used (table-based interpolation).',
type: 'initialization'
},
{
name: 'kx',
description: 'these are externally-modified variables which controls the motion of the pointer in the HVS matrix cube (or square or line in case of HVS matrices made up of less than 3 dimensions). The range of these input arguments must be 0 to 1.',
type: 'performance'
},
{
name: 'ky',
description: 'these are externally-modified variables which controls the motion of the pointer in the HVS matrix cube (or square or line in case of HVS matrices made up of less than 3 dimensions). The range of these input arguments must be 0 to 1.',
type: 'performance'
},
],
seeAlso: ['Hyper Vectorial Synthesis']
},
{
name: 'hvs3',
type: 'opcode',
category: 'Signal Generators:Hyper Vectorial Synthesis',
description: 'Allows three-dimensional Hyper Vectorial Synthesis (HVS) controlled by externally-updated k-variables.',
syntax: 'hvs3(kx, ky, kz, inumParms, inumPointsX, inumPointsY, inumPointsZ, iOutTab, \\\n iPositionsTab, iSnapTab [, iConfigTab])',
parameters: [
{
name: 'inumParms',
description: 'number of parameters controlled by the HVS. Each HVS snapshot is made up of _inumParms_ elements.',
type: 'initialization'
},
{
name: 'inumPointsX',
description: 'number of points that each dimension of the HVS cube (or square in case of two-dimensional HVS; or line in case of one-dimensional HVS) is made up.',
type: 'initialization'
},
{
name: 'inumPointsY',
description: 'number of points that each dimension of the HVS cube (or square in case of two-dimensional HVS; or line in case of one-dimensional HVS) is made up.',
type: 'initialization'
},
{
name: 'inumPointsZ',
description: 'number of points that each dimension of the HVS cube (or square in case of two-dimensional HVS; or line in case of one-dimensional HVS) is made up.',
type: 'initialization'
},
{
name: 'iOutTab',
description: 'number of the table receiving the set of output-parameter instant values of the HVS. The total amount of parameters is defined by the _inumParms_ argument.',
type: 'initialization'
},
{
name: 'iPositionsTab',
description: 'a table filled with the individual positions of snapshots in the HVS matrix (see below for more information).',
type: 'initialization'
},
{
name: 'iSnapTab',
description: 'a table filled with all the snapshots. Each snapshot is made up of a set of parameter values. The amount of elements contained in each snapshots is specified by the _inumParms_ argument. The set of elements of each snapshot follows (and is adjacent) to the previous one in this table. So the total size of this table should be >= to _inumParms_ multiplied the number of snapshots you intend to store for the HVS.',
type: 'initialization'
},
{
name: 'iConfigTab',
description: '(optional) a table containing the behavior of the HVS for each parameter. If the value of _iConfigTab_ is zero (default), this argument is ignored, meaning that each parameter is treated with linear interpolation by the HVS. If _iConfigTab_ is different than zero, then it must refer to an existing table whose contents are in its turn referring to a particolar kind of interpolation. In this table, a value of -1 indicates that corresponding parameter is leaved unchanged (ignored) by the HVS; a value of zero indicates that corresponding parameter is treated with linear-interpolation; each other values must be integer numbers indicating an existing table filled with a shape which will determine the kind of special interpolation to be used (table-based interpolation).',
type: 'initialization'
},
{
name: 'kx',
description: 'these are externally-modified variables which controls the motion of the pointer in the HVS matrix cube (or square or line in case of HVS matrices made up of less than 3 dimensions). The range of these input arguments must be 0 to 1.',
type: 'performance'
},
{
name: 'ky',
description: 'these are externally-modified variables which controls the motion of the pointer in the HVS matrix cube (or square or line in case of HVS matrices made up of less than 3 dimensions). The range of these input arguments must be 0 to 1.',
type: 'performance'
},
{
name: 'kz',
description: 'these are externally-modified variables which controls the motion of the pointer in the HVS matrix cube (or square or line in case of HVS matrices made up of less than 3 dimensions). The range of these input arguments must be 0 to 1.',
type: 'performance'
},
],
seeAlso: ['Hyper Vectorial Synthesis']
},
]

View File

@ -0,0 +1,771 @@
import type { CsoundReference } from './types'
// Signal Generators:Linear and Exponential Generators
export const signalGeneratorsLinearAndExponentialGenerators: CsoundReference[] = [
{
name: 'bpf',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Break point function with linear interpolation.',
syntax: 'ky = bpf(kx, kx1, ky1, kx2, ..., kxn, kyn)\n iy = bpf(ix, ix1, iy1, ix2, ..., ixn, iyn)\n kys[] = bpf(kxs[], kx1, ky1, kx2, ..., kxn, kyn)\n iys[] = bpf(ixs[], ix1, iy1, ix2, ..., ixn, iyn)\n ky = bpf(kx, kxs[], kys[])\n iy = bpf(ix, ixs[], iys[])\n ay = bpf(ax, kx1, ky1, kx2, ..., kxn, kyn)\n ay = bpf(ax, kxs[], kys[])\n ky, kw = bpf(kx, kxs[], kys[], kws[])',
example: '--8<-- "examples/bpf.csd"',
parameters: [
{
name: 'kx',
description: 'Input value',
type: 'performance'
},
{
name: 'kxn',
description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted.',
type: 'performance'
},
{
name: 'kyn',
description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'bpfcos',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Break point function with cosine (easy-in/easy-out) interpolation.',
syntax: 'ky = bpfcos(kx, kx1, ky1, kx2, ..., kxn, kyn)\n kys[] = bpfcos(kxs[], kx1, ky1, kx2, ..., kxn, kyn)\n ky = bpfcos(kx, kxs[], kys[])\n ky = bpfcos(kx, ixs[], iys[])\n ky, kz = bpfcos(kx, kxs[], kys[], kzs[])\n ky, kz = bpfcos(kx, ixs[], iys[], izs[])',
example: '--8<-- "examples/bpfcos.csd"',
parameters: [
{
name: 'kx',
description: 'Input value. Can also be an array',
type: 'performance'
},
{
name: 'kxn',
description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted',
type: 'performance'
},
{
name: 'kyn',
description: 'Defines a breakpoint. Can be changed at krate, but all _kx_s must be sorted',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'cosseg',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of line segments between specified points with cosine interpolation.',
syntax: 'ares = cosseg(ia, idur1, ib [, idur2] [, ic] [...])\n kres = cosseg(ia, idur1, ib [, idur2] [, ic] [...])',
example: '--8<-- "examples/cosseg.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value.',
type: 'initialization'
},
{
name: 'idur1',
description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'cossegb',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of line segments between specified absolute points with cosine interpolation.',
syntax: 'ares = cossegb(ia, itim1, ib [, itim2] [, ic] [...])\n kres = cossegb(ia, itim1, ib [, itim2] [, ic] [...])',
example: '--8<-- "examples/cossegb.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value.',
type: 'initialization'
},
{
name: 'itim1',
description: 'time in seconds of end of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'cossegr',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of line segments between specified points with cosine interpolation, including a release segment.',
syntax: 'ares = cossegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)\n kres = cossegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)',
example: '--8<-- "examples/cossegr.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value.',
type: 'initialization'
},
{
name: 'idur1',
description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
{
name: 'irel',
description: 'duration in seconds and final value of a note releasing segment.',
type: 'initialization'
},
{
name: 'iz',
description: 'duration in seconds and final value of a note releasing segment.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'expcurve',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Generates a normalised exponential curve in range 0 to 1 of arbitrary steepness.',
syntax: 'kout = expcurve(kindex, ksteepness)',
example: '--8<-- "examples/expcurve.csd"',
parameters: [
{
name: 'kindex',
description: 'Index value. Expected range 0 to 1.',
type: 'performance'
},
{
name: 'ksteepness',
description: 'Steepness of the generated curve. Values closer to 1.0 result in a straighter line while larger values steepen the curve.',
type: 'performance'
},
{
name: 'kout',
description: 'Scaled output.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'expon',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace an exponential curve between specified points.',
syntax: 'ares = expon(ia, idur, ib)\n kres = expon(ia, idur, ib)',
example: '--8<-- "examples/expon.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value. Zero is illegal for exponentials.',
type: 'initialization'
},
{
name: 'ib',
description: 'value after _idur_ seconds. For exponentials, must be non-zero and must agree in sign with _ia_.',
type: 'initialization'
},
{
name: 'idur',
description: 'duration in seconds of the segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'expseg',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of exponential segments between specified points.',
syntax: 'ares = expseg(ia, idur1, ib [, idur2] [, ic] [...])\n kres = expseg(ia, idur1, ib [, idur2] [, ic] [...])',
example: '--8<-- "examples/expseg.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value. Zero is illegal for exponentials.',
type: 'initialization'
},
{
name: 'idur1',
description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'expsega',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'An exponential segment generator operating at a-rate.',
syntax: 'ares = expsega(ia, idur1, ib [, idur2] [, ic] [...])',
example: '--8<-- "examples/expsega.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ia',
description: 'starting value. Zero is illegal.',
type: 'initialization'
},
{
name: 'idur1',
description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'expsegb',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of exponential segments between specified absolute points.',
syntax: 'ares = expsegb(ia, itim1, ib [, itim2] [, ic] [...])\n kres = expsegb(ia, itim1, ib [, itim2] [, ic] [...])',
example: '--8<-- "examples/expsegb.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value. Zero is illegal for exponentials.',
type: 'initialization'
},
{
name: 'itim1',
description: 'time in seconds of end of first segment.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'expsegba',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'An exponential segment generator operating at a-rate with absolute times.',
syntax: 'ares = expsegba(ia, itim1, ib [, itim2] [, ic] [...])',
example: '--8<-- "examples/expsegba.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ia',
description: 'starting value. Zero is illegal.',
type: 'initialization'
},
{
name: 'itim1',
description: 'time in seconds at end of first segment.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'expsegr',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of exponential segments between specified points including a release segment.',
syntax: 'ares = expsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)\n kres = expsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)',
example: '--8<-- "examples/expsegr.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value. Zero is illegal for exponentials.',
type: 'initialization'
},
{
name: 'idur1',
description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
{
name: 'irel',
description: 'duration in seconds and final value of a note releasing segment.',
type: 'initialization'
},
{
name: 'iz',
description: 'duration in seconds and final value of a note releasing segment.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'gainslider',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'An implementation of a logarithmic gain curve which is similar to the gainslider~ object from Cycling 74 Max / MSP.',
syntax: 'kout = gainslider(kindex)',
example: '--8<-- "examples/gainslider.csd"',
parameters: [
{
name: 'kindex',
description: 'Index value. Nominal range from 0-127. For example a range of 0-152 will give you a range from -&#8734; to +18.0 dB.',
type: 'performance'
},
{
name: 'kout',
description: 'Scaled output.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'lincos',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Linear to cosine interpolation.',
syntax: 'ky = lincos(kx, ky0, ky1 [, kx0, kx1 ])\n iy = lincos(ix, iy0, iy1 [, ix0, ix1 ])',
example: '--8<-- "examples/lincos.csd"',
parameters: [
{
name: 'kx',
description: 'Input signal',
type: 'performance'
},
{
name: 'ky0',
description: 'Lower limit of output range',
type: 'performance'
},
{
name: 'ky1',
description: 'Higher limit of output range',
type: 'performance'
},
{
name: 'kx0',
description: 'Lower limit of input range (default = 0)',
type: 'performance'
},
{
name: 'kx1',
description: 'Higher limit of input range (default = 1)',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'line',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a straight line between specified points.',
syntax: 'ares = line(ia, idur, ib)\n kres = line(ia, idur, ib)',
example: '--8<-- "examples/line.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value.',
type: 'initialization'
},
{
name: 'ib',
description: 'value after _idur_ seconds.',
type: 'initialization'
},
{
name: 'idur',
description: 'duration in seconds of segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'linlin',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Linear to linear interpolation.',
syntax: 'ky = linlin(kx, ky0, ky1 [, kx0, kx1 ])\n iy = linlin(ix, iy0, iy1 [, ix0, ix1 ])\n kys[] = linlin(kxs[], ky0, ky1 [, kx0, kx1 ])\n iys[] = linlin(ixs[], ky0, ky1, [ kx0, kx1 ])\n kC[] = linlin(kx, kA[], kB[] [, kx0, kx1 ])',
example: '--8<-- "examples/linlin.csd"',
parameters: [
{
name: 'kx',
description: 'Input signal',
type: 'performance'
},
{
name: 'kx0',
description: 'Lower limit of input range. _Defaults to 0_',
type: 'performance'
},
{
name: 'kx1',
description: 'Higher limit of input range. _Defaults to 1_',
type: 'performance'
},
{
name: 'ky0',
description: 'Lower limit of output range',
type: 'performance'
},
{
name: 'ky1',
description: 'Higher limit of output range',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'linseg',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of line segments between specified points.',
syntax: 'ares = linseg(ia, idur1, ib [, idur2] [, ic] [...])\n kres = linseg(ia, idur1, ib [, idur2] [, ic] [...])',
example: '--8<-- "examples/linseg.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value.',
type: 'initialization'
},
{
name: 'idur1',
description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'linsegb',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of line segments between specified absolute points.',
syntax: 'ares = linsegb(ia, itim1, ib [, itim2] [, ic] [...])\n kres = linsegb(ia, itim1, ib [, itim2] [, ic] [...])',
example: '--8<-- "examples/linsegb.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value.',
type: 'initialization'
},
{
name: 'itim1',
description: 'time in seconds of end of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'linsegr',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Trace a series of line segments between specified points including a release segment.',
syntax: 'ares = linsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)\n kres = linsegr(ia, idur1, ib [, idur2] [, ic] [...], irel, iz)',
example: '--8<-- "examples/linsegr.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'ia',
description: 'starting value.',
type: 'initialization'
},
{
name: 'idur1',
description: 'duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.',
type: 'initialization'
},
{
name: 'irel',
description: 'duration in seconds and final value of a note releasing segment.',
type: 'initialization'
},
{
name: 'iz',
description: 'duration in seconds and final value of a note releasing segment.',
type: 'initialization'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'logcurve',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'This opcode implements a formula for generating a normalised logarithmic curve in range 0 - 1. It is based on the Max / MSP work of Eric Singer (c) 1994.',
syntax: 'kout = logcurve(kindex, ksteepness)',
example: '--8<-- "examples/logcurve.csd"',
parameters: [
{
name: 'kindex',
description: 'Index value. Expected range 0 to 1.',
type: 'performance'
},
{
name: 'ksteepness',
description: 'Steepness of the generated curve. Values closer to 1.0 result in a straighter line while larger values steepen the curve.',
type: 'performance'
},
{
name: 'kout',
description: 'Scaled output.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'loopseg',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Generate control signal consisting of linear segments delimited by two or more specified points.',
syntax: 'ksig = loopseg(kfreq, ktrig, iphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2][...])',
example: '--8<-- "examples/loopseg.csd"',
parameters: [
{
name: 'iphase',
description: 'A value between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.',
type: 'initialization'
},
{
name: 'ksig',
description: 'Output signal.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Repeat rate in Hz or fraction of Hz.',
type: 'performance'
},
{
name: 'ktrig',
description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'loopsegp',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Control signals based on linear segments.',
syntax: 'ksig = loopsegp(kphase, kvalue0, kdur0, kvalue1 \\\n [, kdur1, ... , kdurN-1, kvalueN])',
example: '--8<-- "examples/loopsegp.csd"',
parameters: [
{
name: 'ksig',
description: 'output signal',
type: 'performance'
},
{
name: 'kphase',
description: 'point of the sequence read, expressed as a fraction of a cycle (0 to 1)',
type: 'performance'
},
{
name: 'kvalueN',
description: 'values of points',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'looptseg',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Generate control signal consisting of exponential or linear segments delimited by two or more specified points.',
syntax: 'ksig = looptseg(kfreq, ktrig, iphase, kvalue0, ktype0, ktime0, [, kvalue1] \\\n [,ktype1] [, ktime1] [, kvalue2] [,ktype2] [, ktime2] [...] \\\n [, kvalueN] [,ktypeN] [, ktimeN])',
example: '--8<-- "examples/looptseg.csd"',
parameters: [
{
name: 'iphase',
description: 'A value between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.',
type: 'initialization'
},
{
name: 'ksig',
description: 'Output signal.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Repeat rate in Hz or fraction of Hz.',
type: 'performance'
},
{
name: 'ktrig',
description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'loopxseg',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Generate control signal consisting of exponential segments delimited by two or more specified points.',
syntax: 'ksig = loopxseg(kfreq, ktrig, iphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2] [...])',
example: '--8<-- "examples/loopxseg.csd"',
parameters: [
{
name: 'ksig',
description: 'Output signal.',
type: 'performance'
},
{
name: 'kfreq',
description: 'Repeat rate in Hz or fraction of Hz.',
type: 'performance'
},
{
name: 'ktrig',
description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.',
type: 'performance'
},
{
name: 'iphase',
description: 'A value between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'lpshold',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Generate control signal consisting of held segments.',
syntax: 'ksig = lpshold(kfreq, ktrig, iphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2] [...])',
example: '--8<-- "examples/lpshold.csd"',
parameters: [
{
name: 'ksig',
description: 'Output signal',
type: 'performance'
},
{
name: 'kfreq',
description: 'Repeat rate in Hz or fraction of Hz',
type: 'performance'
},
{
name: 'ktrig',
description: 'If non-zero, retriggers the envelope from start (see [trigger opcode](../opcodes/trigger.md)), before the envelope cycle is completed.',
type: 'performance'
},
{
name: 'iphase',
description: 'A vaue between 0 and 1 to say where to start the loop. Zero, the commonest value, indicates the beginning.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'lpsholdp',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Control signals based on held segments.',
syntax: 'ksig = lpsholdp(kphase, kvalue0, ktime0 [, kvalue1] [, ktime1] \\\n [, kvalue2] [, ktime2] [...])',
example: '--8<-- "examples/lpsholdp.csd"',
parameters: [
{
name: 'ksig',
description: 'output signal',
type: 'performance'
},
{
name: 'kphase',
description: 'point of the sequence read, expressed as a fraction of a cycle (0 to 1)',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'scale',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Arbitrary signal scaling.',
syntax: 'kscl = scale(kinput, kmax, kmin[, kimax, kimin])',
example: '--8<-- "examples/scale.csd"',
parameters: [
{
name: 'kin',
description: 'Input value. Can originate from any k-rate source as long as that source\'s output is in range',
type: 'performance'
},
{
name: 'kmin',
description: 'Minimum value of the resultant scale operation.',
type: 'performance'
},
{
name: 'kmax',
description: 'Maximum value of the resultant scale operation.',
type: 'performance'
},
{
name: 'kimin',
description: 'Optional; Minimum of the incoming value range, defaulting to zero.',
type: 'performance'
},
{
name: 'kimax',
description: 'Optional; Maximum of the incoming value range, defaulting to one.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'scale2',
type: 'opcode',
category: 'Signal Generators:Linear and Exponential Generators',
description: 'Arbitrary signal scaling with optional smoothing.',
syntax: 'kscl = scale2(kinput, kmin, kmax[, kimin, kimax][ihtime])',
example: '--8<-- "examples/scale2.csd"',
parameters: [
{
name: 'kin',
description: 'Input value. Can originate from any k-rate source and should be in the range _kimin_ to _kimax_. If it is larger than kimax it is treated as kimax, and if less than kimin then it is treated as kimin.',
type: 'performance'
},
{
name: 'kmin',
description: 'Minimum value of the resultant scale operation.',
type: 'performance'
},
{
name: 'kmax',
description: 'Maximum value of the resultant scale operation.',
type: 'performance'
},
{
name: 'kimin',
description: 'Optional; Minimum of the incoming value range, defaulting to zero.',
type: 'performance'
},
{
name: 'kimax',
description: 'Optional; Maximum of the incoming value range, defaulting to one.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,63 @@
import type { CsoundReference } from './types'
// Signal Generators:Phasors
export const signalGeneratorsPhasors: CsoundReference[] = [
{
name: 'ephasor',
type: 'opcode',
category: 'Signal Generators:Phasors',
description: 'Produces two outputs: a periodic phase signal and a periodic exponential decaying signal.',
syntax: 'aexp,aph = ephasor(kfreq, kR)',
example: '--8<-- "examples/ephasor.csd"',
parameters: [
{
name: 'kfreq',
description: 'the rate at which the phase and exponential signals are generated',
type: 'performance'
},
{
name: 'kR',
description: 'a parameter controlling the decay rate of the exponential signal, 0 &lt; kR &lt; 1. Lower values produce faster decays.',
type: 'performance'
},
],
seeAlso: ['Phasors']
},
{
name: 'phasor',
type: 'opcode',
category: 'Signal Generators:Phasors',
description: 'Produce a normalized moving phase value.',
syntax: 'ares = phasor(xcps [, iphs])\n kres = phasor(kcps [, iphs])',
example: '--8<-- "examples/phasor.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
seeAlso: ['Phasors']
},
{
name: 'phasorbnk',
type: 'opcode',
category: 'Signal Generators:Phasors',
description: 'Produce an arbitrary number of normalized moving phase values, accessable by an index.',
syntax: 'ares = phasorbnk(xcps, kndx, icnt [, iphs])\n kres = phasorbnk(kcps, kndx, icnt [, iphs])',
example: '--8<-- "examples/phasorbnk.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'icnt',
description: 'maximum number of phasors to be used.',
type: 'initialization'
},
{
name: 'iphs',
description: 'initial phase, expressed as a fraction of a cycle (0 to 1). If -1 initialization is skipped. If _iphas_&gt;1 each phasor will be initialized with a random value.',
type: 'initialization'
},
{
name: 'kndx',
description: 'index value to access individual phasors',
type: 'performance'
},
],
seeAlso: ['Phasors']
},
]

View File

@ -0,0 +1,956 @@
import type { CsoundReference } from './types'
// Signal Generators:Random (Noise) Generators
export const signalGeneratorsRandomNoiseGenerators: CsoundReference[] = [
{
name: 'betarand',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Beta distribution random number generator (positive values only).',
syntax: 'ares = betarand(krange, kalpha, kbeta)\n ires = betarand(krange, kalpha, kbeta)\n kres = betarand(krange, kalpha, kbeta)',
example: '--8<-- "examples/betarand-modern.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'krange',
description: 'range of the random numbers (0 - _krange_).',
type: 'performance'
},
{
name: 'kalpha',
description: 'alpha value. If _kalpha_ is smaller than one, smaller values favor values near 0.',
type: 'performance'
},
{
name: 'kbeta',
description: 'beta value. If _kbeta_ is smaller than one, smaller values favor values near _krange_.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'bexprnd',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Exponential distribution random number generator.',
syntax: 'ares = bexprnd(krange)\n ires = bexprnd(krange)\n kres = bexprnd(krange)',
example: '--8<-- "examples/bexprnd-modern.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'krange',
description: 'the range of the random numbers (-_krange_ to +_krange_)',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'cauchy',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Cauchy distribution random number generator.',
syntax: 'ares = cauchy(kalpha)\n ires = cauchy(kalpha)\n kres = cauchy(kalpha)',
example: '--8<-- "examples/cauchy-modern.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'kalpha',
description: 'controls the spread from zero (big _kalpha_ = big spread). Outputs both positive and negative numbers.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'cauchyi',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Cauchy distribution random number generator with interpolation between values.',
syntax: 'ares = cauchyi(klambda, xamp, xcps)\n ires = cauchyi(klambda, xamp, xcps)\n kres = cauchyi(klambda, xamp, xcps)',
example: '--8<-- "examples/cauchyi-modern.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'kalpha',
description: 'controls the spread from zero (big _kalpha_ = big spread). Outputs both positive and negative numbers.',
type: 'performance'
},
{
name: 'xamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'xcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'cuserrnd',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Continuous USER-defined-distribution RaNDom generator.',
syntax: 'aout = cuserrnd(kmin, kmax, ktableNum)\n iout = cuserrnd(imin, imax, itableNum)\n kout = cuserrnd(kmin, kmax, ktableNum)',
example: '--8<-- "examples/cuserrnd.csd"',
parameters: [
{
name: 'imin',
description: 'minimum range limit',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum range limit',
type: 'initialization'
},
{
name: 'itableNum',
description: 'number of table containing the random-distribution function. Such table is generated by the user. See [GEN40](../scoregens/gen40.md), [GEN41](../scoregens/gen41.md), and [GEN42](../scoregens/gen42.md). The table length does not need to be a power of 2.',
type: 'initialization'
},
{
name: 'ktableNum',
description: 'number of table containing the random-distribution function. Such table is generated by the user. See [GEN40](../scoregens/gen40.md), [GEN41](../scoregens/gen41.md), and [GEN42](../scoregens/gen42.md). The table length does not need to be a power of 2.',
type: 'performance'
},
{
name: 'kmin',
description: 'minimum range limit',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum range limit',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'duserrnd',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Discrete USER-defined-distribution RaNDom generator.',
syntax: 'aout = duserrnd(ktableNum)\n iout = duserrnd(itableNum)\n kout = duserrnd(ktableNum)',
example: '--8<-- "examples/duserrnd.csd"',
parameters: [
{
name: 'itableNum',
description: 'number of table containing the random-distribution function. Such table is generated by the user. See [GEN40](../scoregens/gen40.md), [GEN41](../scoregens/gen41.md), and [GEN42](../scoregens/gen42.md). The table length does not need to be a power of 2',
type: 'initialization'
},
{
name: 'ktableNum',
description: 'number of table containing the random-distribution function. Such table is generated by the user. See [GEN40](../scoregens/gen40.md), [GEN41](../scoregens/gen41.md), and [GEN42](../scoregens/gen42.md). The table length does not need to be a power of 2',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'dust',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates random impulses from 0 to 1.',
syntax: 'ares = dust(kamp, kdensity)\n kres = dust(kamp, kdensity)',
example: '--8<-- "examples/dust.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude.',
type: 'performance'
},
{
name: 'kdensity',
description: 'average number of impulses per second.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'dust2',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates random impulses from -1 to 1.',
syntax: 'ares = dust2(kamp, kdensity)\n kres = dust2(kamp, kdensity)',
example: '--8<-- "examples/dust2.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude.',
type: 'performance'
},
{
name: 'kdensity',
description: 'average number of impulses per second.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'exprand',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Exponential distribution random number generator (positive values only).',
syntax: 'ares = exprand(klambda)\n ires = exprand(klambda)\n kres = exprand(klambda)',
example: '--8<-- "examples/exprand.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'klambda',
description: 'reciprocal of lambda parameter for the exponential distribution.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'exprandi',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Exponential distribution random number generator with interpolation (positive values only).',
syntax: 'ares = exprandi(klambda, xamp, xcps)\n ires = exprandi(klambda, xamp, xcps)\n kres = exprandi(klambda, xamp, xcps)',
example: '--8<-- "examples/exprandi.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'klambda',
description: 'lambda parameter for the exponential distribution.',
type: 'performance'
},
{
name: 'xamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'xcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'fractalnoise',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'A fractal noise generator.',
syntax: 'ares = fractalnoise(kamp, kbeta)',
example: '--8<-- "examples/fractalnoise.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude.',
type: 'performance'
},
{
name: 'kbeta',
description: 'spectral parameter related to the fractal dimension',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'gauss',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Gaussian distribution random number generator.',
syntax: 'ares = gauss(krange)\n ires = gauss(irange)\n kres = gauss(krange)\n ares = gauss(kmean, ksdev)\n ires = gauss(imean, isdev)\n kres = gauss(kmean, ksdev)',
example: '--8<-- "examples/gauss.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'krange',
description: 'the range of the random numbers (-_krange_ to +_krange_). Outputs both positive and negative numbers.',
type: 'performance'
},
{
name: 'kmean',
description: 'normal distribution mean.',
type: 'performance'
},
{
name: 'ksdev',
description: 'normal distribution standard deviation.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'gaussi',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Gaussian distribution random number generator with controlled interpolation between values.',
syntax: 'ares = gaussi(krange, xamp, xcps)\n ires = gaussi(krange, xamp, xcps)\n kres = gaussi(krange, xamp, xcps)',
example: '--8<-- "examples/gaussi.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'krange',
description: 'the range of the random numbers (-_krange_ to +_krange_). Outputs both positive and negative numbers.',
type: 'performance'
},
{
name: 'xamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'xcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'gausstrig',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Random impulses around a certain frequency.',
syntax: 'ares = gausstrig(kamp, kcps, kdev [, imode] [, ifrst1])\n kres = gausstrig(kamp, kcps, kdev [, imode] [, ifrst1])',
example: '--8<-- "examples/gausstrig.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'amplitude.',
type: 'performance'
},
{
name: 'kcps',
description: 'the mean frequency over which random impulses are distributed.',
type: 'performance'
},
{
name: 'kdev',
description: 'random deviation from mean (0 &lt;= dev &lt; 1).',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'getseed',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Reads the global seed value.',
syntax: 'ians = getseed()\n kans = getseed()',
example: '--8<-- "examples/getseed.csd"',
seeAlso: ['Random (Noise) Generators']
},
{
name: 'jitter',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates a segmented line whose segments are randomly generated.',
syntax: 'kout = jitter(kamp, kcpsMin, kcpsMax)',
example: '--8<-- "examples/jitter.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'kamp',
description: 'Amplitude of jitter deviation',
type: 'performance'
},
{
name: 'kcpsMin',
description: 'Minimum speed of random frequency variations (expressed in cps)',
type: 'performance'
},
{
name: 'kcpsMax',
description: 'Maximum speed of random frequency variations (expressed in cps)',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'jitter2',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates a segmented line with user-controllable random segments.',
syntax: 'kout = jitter2(ktotamp, kamp1, kcps1, kamp2, kcps2, kamp3, kcps3[ , iopt])',
example: '--8<-- "examples/jitter2.csd"',
parameters: [
{
name: 'ktotamp',
description: 'Resulting amplitude of jitter2',
type: 'performance'
},
{
name: 'kamp1',
description: 'Amplitude of the first jitter component',
type: 'performance'
},
{
name: 'kcps1',
description: 'Speed of random variation of the first jitter component (expressed in cps)',
type: 'performance'
},
{
name: 'kamp2',
description: 'Amplitude of the second jitter component',
type: 'performance'
},
{
name: 'kcps2',
description: 'Speed of random variation of the second jitter component (expressed in cps)',
type: 'performance'
},
{
name: 'kamp3',
description: 'Amplitude of the third jitter component',
type: 'performance'
},
{
name: 'kcps3',
description: 'Speed of random variation of the third jitter component (expressed in cps)',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'jspline',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'A jitter-spline generator.',
syntax: 'ares = jspline(xamp, kcpsMin, kcpsMax)\n kres = jspline(kamp, kcpsMin, kcpsMax)',
example: '--8<-- "examples/jspline.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kres',
description: 'Output signal',
type: 'performance'
},
{
name: 'ares',
description: 'Output signal',
type: 'performance'
},
{
name: 'xamp',
description: 'Amplitude factor',
type: 'performance'
},
{
name: 'kcpsMin',
description: 'Range of point-generation rate. Min and max limits are expressed in cps.',
type: 'performance'
},
{
name: 'kcpsMax',
description: 'Range of point-generation rate. Min and max limits are expressed in cps.',
type: 'performance'
},
{
name: 'cpsMin',
description: '_cpsMax_ interval is big, some little discontinuity could occurr, but it should not be a problem, in most cases. Maybe the algorithm will be improved in next versions.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'lfsr',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Linear Feedback Shift Register (LFSR).',
syntax: 'knum = lfsr(ilen, iprob [, iseed])',
example: '--8<-- "examples/lfsr.csd"',
parameters: [
{
name: 'ilen',
description: 'length of shift register, valid values are 1-31 (inclusive). The larger the length, the larger the resulting integers in the output. You can use this to constrain the output to a suitable range.',
type: 'initialization'
},
{
name: 'iprob',
description: 'probability, valid values 1-255 (inclusive). Controls the spread of the output; larger values result in a wider spread of values.',
type: 'initialization'
},
{
name: 'knum',
description: 'integer output',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'linrand',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Linear distribution random number generator (positive values only).',
syntax: 'ares = linrand(krange)\n ires = linrand(krange)\n kres = linrand(krange)',
example: '--8<-- "examples/linrand.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'krange',
description: 'the range of the random numbers (0 - _krange_). Outputs only positive numbers.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'noise',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'A white noise generator with an IIR lowpass filter.',
syntax: 'ares = noise(xamp, kbeta)',
example: '--8<-- "examples/noise.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'xamp',
description: 'amplitude of final output',
type: 'performance'
},
{
name: 'kbeta',
description: 'beta of the lowpass filter. Should be in the range of -1 to 1, exclusive of the end-points.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'pcauchy',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Cauchy distribution random number generator (positive values only).',
syntax: 'ares = pcauchy(kalpha)\n ires = pcauchy(kalpha)\n kres = pcauchy(kalpha)',
example: '--8<-- "examples/pcauchy.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'pcauchy_ _kalpha',
description: 'controls the spread from zero (big kalpha = big spread). Outputs positive numbers only.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'pinker',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates pink noise (-3dB/oct response) by the _NewShade of Pink_ algorithm of Stefan Stenzel.',
syntax: 'ares = pinker()',
example: '--8<-- "examples/pinker.csd"',
rates: ['a-rate'],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'pinkish',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates approximate pink noise (-3dB/oct response).',
syntax: 'ares = pinkish(xin [, imethod] [, inumbands] [, iseed] [, iskip])',
example: '--8<-- "examples/pinkish.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'xin',
description: 'for Gardner method: k- or a-rate amplitude. For Kellet filters: normally a-rate uniform random noise from rand (31-bit) or unirand, but can be any a-rate signal. The output peak value varies widely (&plusmn;15%) even over long runs, and will usually be well below the input amplitude. Peak values may also occasionally overshoot input amplitude or noise.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'poisson',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Poisson distribution random number generator (positive values only).',
syntax: 'ares = poisson(klambda)\n ires = poisson(klambda)\n kres = poisson(klambda)',
example: '--8<-- "examples/poisson.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ares',
description: 'number of events occuring (always an integer).',
type: 'performance'
},
{
name: 'kres',
description: 'number of events occuring (always an integer).',
type: 'performance'
},
{
name: 'ires',
description: 'number of events occuring (always an integer).',
type: 'performance'
},
{
name: 'klambda',
description: 'the expected number of occurrences that occur during the rate interval.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'rand',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Output is a controlled random number series between -*amp* and +*amp*.',
syntax: 'ares = rand(xamp [, iseed] [, isel] [, ioffset])\n kres = rand(xamp [, iseed] [, isel] [, ioffset])',
example: '--8<-- "examples/rand.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'xamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'ares',
description: 'Random number produced.',
type: 'performance'
},
{
name: 'kres',
description: 'Random number produced.',
type: 'performance'
},
{
name: 'kamp_ to',
description: 'kamp_. _rand_ will thus generate uniform white noise with an R.M.S value of _kamp / root 2_.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators', 'randh', 'randi']
},
{
name: 'randc',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates a controlled random number series with cubic interpolation between each new number.',
syntax: 'ares = randc(xamp, xcps [, iseed] [, isize] [, ioffset])\n kres = randc(kamp, kcps [, iseed] [, isize] [, ioffset])',
example: '--8<-- "examples/randc.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'xamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'kcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
{
name: 'xcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
{
name: 'kamp_ to',
description: 'kamp_. _rand_ will thus generate uniform white noise with an R.M.S value of _kamp / root 2_.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators', 'randh', 'rand']
},
{
name: 'randh',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates random numbers and holds them for a period of time.',
syntax: 'ares = randh(xamp, xcps [, iseed] [, isize] [, ioffset])\n kres = randh(kamp, kcps [, iseed] [, isize] [, ioffset])',
example: '--8<-- "examples/randh.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'xamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'kcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
{
name: 'xcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators', 'rand', 'randi']
},
{
name: 'randi',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates a controlled random number series with interpolation between each new number.',
syntax: 'ares = randi(xamp, xcps [, iseed] [, isize] [, ioffset])\n kres = randi(kamp, kcps [, iseed] [, isize] [, ioffset])',
example: '--8<-- "examples/randi.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'xamp',
description: 'range over which random numbers are distributed.',
type: 'performance'
},
{
name: 'kcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
{
name: 'xcps',
description: 'the frequency which new random numbers are generated.',
type: 'performance'
},
{
name: 'kamp_ to',
description: 'kamp_. _rand_ will thus generate uniform white noise with an R.M.S value of _kamp / root 2_.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators', 'randh', 'rand']
},
{
name: 'random',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates a controlled pseudo-random number series between min and max values.',
syntax: 'ares = random(kmin, kmax)\n ires = random(imin, imax)\n kres = random(kmin, kmax)',
example: '--8<-- "examples/random.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'imin',
description: 'minimum range limit',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum range limit',
type: 'initialization'
},
{
name: 'kmin',
description: 'minimum range limit',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum range limit',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'randomh',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates random numbers with a user-defined limit and holds them for a period of time.',
syntax: 'ares = randomh(kmin, kmax, xcps [,imode] [,ifirstval])\n kres = randomh(kmin, kmax, kcps [,imode] [,ifirstval])',
example: '--8<-- "examples/randomh.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kmin',
description: 'minimum range limit',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum range limit',
type: 'performance'
},
{
name: 'kcps',
description: 'rate of random break-point generation',
type: 'performance'
},
{
name: 'xcps',
description: 'rate of random break-point generation',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'randomi',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generates a user-controlled random number series with interpolation between each new number.',
syntax: 'ares = randomi(kmin, kmax, xcps [,imode] [,ifirstval])\n kres = randomi(kmin, kmax, kcps [,imode] [,ifirstval])',
example: '--8<-- "examples/randomi.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kmin',
description: 'minimum range limit',
type: 'performance'
},
{
name: 'kmax',
description: 'maximum range limit',
type: 'performance'
},
{
name: 'kcps',
description: 'rate of random break-point generation',
type: 'performance'
},
{
name: 'xcps',
description: 'rate of random break-point generation',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'rnd31',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: '31-bit bipolar random opcodes with controllable distribution.',
syntax: 'ax = rnd31(kscl, krpow [, iseed])\n ix = rnd31(iscl, irpow [, iseed])\n kx = rnd31(kscl, krpow [, iseed])',
example: '--8<-- "examples/rnd31.csd"',
parameters: [
{
name: 'ix',
description: 'i-rate output value.',
type: 'initialization'
},
{
name: 'iscl',
description: 'output scale. The generated random numbers are in the range -iscl to iscl.',
type: 'initialization'
},
{
name: 'irpow',
description: 'controls the distribution of random numbers. If irpow is positive, the random distribution (x is in the range -1 to 1) is _abs(x) &circ; ((1 / irpow) - 1)_; for negative irpow values, it is _(1 - abs(x)) &circ; ((-1 / irpow) - 1)_. Setting _irpow_ to -1, 0, or 1 will result in uniform distribution (this is also faster to calculate).',
type: 'initialization'
},
{
name: 'ax',
description: 'a-rate output value.',
type: 'performance'
},
{
name: 'kx',
description: 'k-rate output value.',
type: 'performance'
},
{
name: 'kscl',
description: 'output scale. The generated random numbers are in the range -kscl to kscl. It is the same as _iscl_, but can be varied at k-rate.',
type: 'performance'
},
{
name: 'krpow',
description: 'controls the distribution of random numbers. It is the same as _irpow_, but can be varied at k-rate.',
type: 'performance'
},
],
seeAlso: ['Random (Noise) Generators']
},
{
name: 'rndseed',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Sets the global seed value for [rnd](../opcodes/rnd.md) and [birnd](../opcodes/birnd.md).',
syntax: 'rndseed(ival)',
example: '--8<-- "examples/rndseed.csd"',
seeAlso: ['Random (Noise) Generators']
},
{
name: 'rspline',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Generate random spline curves.',
syntax: 'ares = rspline(xrangeMin, xrangeMax, kcpsMin, kcpsMax)\n kres = rspline(krangeMin, krangeMax, kcpsMin, kcpsMax)',
example: '--8<-- "examples/rspline.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kres',
description: 'Output signal',
type: 'performance'
},
{
name: 'ares',
description: 'Output signal',
type: 'performance'
},
{
name: 'xrangeMin',
description: 'Range of values of random-generated points',
type: 'performance'
},
{
name: 'xrangeMax',
description: 'Range of values of random-generated points',
type: 'performance'
},
{
name: 'kcpsMin',
description: 'Range of point-generation rate. Min and max limits are expressed in cps.',
type: 'performance'
},
{
name: 'kcpsMax',
description: 'Range of point-generation rate. Min and max limits are expressed in cps.',
type: 'performance'
},
],
seeAlso: ['Linear and Exponential Generators']
},
{
name: 'seed',
type: 'opcode',
category: 'Signal Generators:Random (Noise) Generators',
description: 'Sets the global seed value for all _x-class noise generators_, as well as other opcodes that use a random call, such as [grain](../opcodes/grain.md).',
syntax: 'seed(ival)',
example: '--8<-- "examples/seed.csd"',
seeAlso: ['Random (Noise) Generators', 'Orchestra Header Statements']
},
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,381 @@
import type { CsoundReference } from './types'
// Signal Generators:Scanned Synthesis
export const signalGeneratorsScannedSynthesis: CsoundReference[] = [
{
name: 'scanhammer',
type: 'opcode',
category: 'Signal Generators:Scanned Synthesis',
description: 'Copies from one table to another with a gain control.',
syntax: 'scanhammer(isrc, idst, ipos, imult)',
example: '--8<-- "examples/scanhammer.csd"',
parameters: [
{
name: 'isrc',
description: 'source function table.',
type: 'initialization'
},
{
name: 'idst',
description: 'destination function table.',
type: 'initialization'
},
{
name: 'ipos',
description: 'starting position (in points).',
type: 'initialization'
},
{
name: 'imult',
description: 'gain multiplier. A value of 0 will leave values unchanged.',
type: 'initialization'
},
],
seeAlso: ['Scanned Synthesis', 'Working with Scanned Synthesis', 'tutorials']
},
{
name: 'scanmap',
type: 'opcode',
category: 'Signal Generators:Scanned Synthesis',
description: 'Allows the position and velocity of a node in a scanned process to be read.',
syntax: 'kpos, kvel = scanmap(iscan, kamp, kvamp [, iwhich])',
example: '--8<-- "examples/scanmap.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'iscan',
description: 'which scan process to read',
type: 'initialization'
},
{
name: 'kamp',
description: 'amount to amplify the _kpos_ value.',
type: 'performance'
},
{
name: 'kvamp',
description: 'amount to amplify the _kvel_ value.',
type: 'performance'
},
],
seeAlso: ['Scanned Synthesis', 'Working with Scanned Synthesis', 'tutorials']
},
{
name: 'scans',
type: 'opcode',
category: 'Signal Generators:Scanned Synthesis',
description: 'Generate audio output using scanned synthesis.',
syntax: 'ares = scans(kamp, kfreq, ifn, id [, iorder])',
example: '--8<-- "examples/scans.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: 'ftable containing the scanning trajectory. This is a series of numbers that contains addresses of masses. The order of these addresses is used as the scan path. It should not contain values greater than the number of masses, or negative numbers. See the [introduction to the scanned synthesis section](../siggen/scantop.md).',
type: 'initialization'
},
{
name: 'id',
description: 'ID number of the [scanu](../opcodes/scanu.md) opcode\'s waveform to use',
type: 'initialization'
},
{
name: 'kamp',
description: 'output amplitude. Note that the resulting amplitude is also dependent on instantaneous value in the wavetable. This number is effectively the scaling factor of the wavetable.',
type: 'performance'
},
{
name: 'kfreq',
description: 'frequency of the scan rate',
type: 'performance'
},
],
seeAlso: ['Scanned Synthesis', 'Working with Scanned Synthesis', 'tutorials']
},
{
name: 'scansmap',
type: 'opcode',
category: 'Signal Generators:Scanned Synthesis',
description: 'Allows the position and velocity of a node in a scanned process to be written.',
syntax: 'scansmap(kpos, kvel, iscan, kamp, kvamp [, iwhich])',
example: '--8<-- "examples/scansmap.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'iscan',
description: 'which scan process to write',
type: 'initialization'
},
{
name: 'kpos',
description: 'the node\'s position.',
type: 'performance'
},
{
name: 'kvel',
description: 'the node\'s velocity.',
type: 'performance'
},
{
name: 'kamp',
description: 'amount to amplify the _kpos_ value.',
type: 'performance'
},
{
name: 'kvamp',
description: 'amount to amplify the _kvel_ value.',
type: 'performance'
},
],
seeAlso: ['Scanned Synthesis', 'Working with Scanned Synthesis', 'tutorials']
},
{
name: 'scantable',
type: 'opcode',
category: 'Signal Generators:Scanned Synthesis',
description: 'A simpler scanned synthesis implementation.',
syntax: 'aout = scantable(kamp, kpch, ipos, imass, istiff, idamp, ivel)',
example: '--8<-- "examples/scantable.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'ipos',
description: 'table containing position array.',
type: 'initialization'
},
{
name: 'imass',
description: 'table containing the mass of the string.',
type: 'initialization'
},
{
name: 'istiff',
description: 'table containing the stiffness of the string.',
type: 'initialization'
},
{
name: 'idamp',
description: 'table containing the damping factors of the string.',
type: 'initialization'
},
{
name: 'ivel',
description: 'table containing the velocities.',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude (gain) of the string.',
type: 'performance'
},
{
name: 'kpch',
description: 'the string\'s scanned frequency.',
type: 'performance'
},
],
seeAlso: ['Scanned Synthesis', 'Working with Scanned Synthesis', 'tutorials']
},
{
name: 'scanu',
type: 'opcode',
category: 'Signal Generators:Scanned Synthesis',
description: 'Compute the waveform and the wavetable for use in scanned synthesis.',
syntax: 'scanu(init, irate, ifndisplace, ifnmass, ifnmatrix, ifncentr, ifndamp, \\\n kmass, kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, \\\n ain, idisp, id)',
example: '--8<-- "examples/scanu.csd"',
parameters: [
{
name: 'init',
description: 'the initial position of the masses. If this is a negative number, then the absolute of _init_ signifies the table to use as a hammer shape. If _init_ &gt; 0, the length of it should be the same as the intended mass number, otherwise it can be anything.',
type: 'initialization'
},
{
name: 'irate',
description: 'the amount of time between successive updates of the mass state. Kind of like the sample period of the system. If the number is big, the string will update at a slow rate showing little timbral variability; otherwise it will change rapidly resulting in a more dynamic sound.',
type: 'initialization'
},
{
name: 'ifndisplace',
description: 'the ftable that contains the initial velocity for each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ifnmass',
description: 'ftable that contains the mass of each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ifnmatrix',
description: 'ftable that contains the spring stiffness of each connection. It should have the same size as the square of the intended mass number. The data ordering is a row after row dump of the connection matrix of the system.',
type: 'initialization'
},
{
name: 'ifncentr',
description: 'ftable that contains the centering force of each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ifndamp',
description: 'the ftable that contains the damping factor of each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ileft',
description: 'If _init_ &lt; 0, the position of the left hammer (_ileft_ = 0 is hit at leftmost, _ileft_ = 1 is hit at rightmost). Ignored when _init_ &gt; 0.',
type: 'initialization'
},
{
name: 'iright',
description: 'If _init_ &lt; 0, the position of the right hammer (_iright_ = 0 is hit at leftmost, _iright_ = 1 is hit at rightmost). Ignored when _init_ &gt; 0.',
type: 'initialization'
},
{
name: 'idisp',
description: 'If 0, no display of the masses is provided.',
type: 'initialization'
},
{
name: 'id',
description: 'If positive, the ID of the opcode. This will be used to point the scanning opcode to the proper waveform maker. If this value is negative, the absolute of this value is the wavetable on which to write the waveshape. That wavetable can be used later from an other opcode to generate sound. The initial contents of this table will be destroyed.',
type: 'initialization'
},
{
name: 'kmass',
description: 'scales the masses',
type: 'performance'
},
{
name: 'kmtrxstiff',
description: 'scales the spring stiffness.',
type: 'performance'
},
{
name: 'kcentr',
description: 'scales the centering force',
type: 'performance'
},
{
name: 'kdamp',
description: 'scales the damping',
type: 'performance'
},
{
name: 'kpos',
description: 'position of an active hammer along the string (_kpos_ = 0 is leftmost, _kpos_ = 1 is rightmost). The shape of the hammer is determined by _init_ and the power it pushes with is _kdisplace_.',
type: 'performance'
},
{
name: 'kdisplace',
description: 'power that the active hammer uses.',
type: 'performance'
},
{
name: 'ain',
description: 'audio input that adds to the velocity of the masses. Amplitude should not be too great.',
type: 'performance'
},
],
seeAlso: ['Scanned Synthesis', 'Working with Scanned Synthesis', 'tutorials']
},
{
name: 'scanu2',
type: 'opcode',
category: 'Signal Generators:Scanned Synthesis',
description: 'Compute the waveform and the wavetable for use in scanned synthesis.',
syntax: 'scanu2(init, irate, ifndisplace,ifnmass, ifnmatrix, ifncentr, ifndamp, \\\n kmass, kmtrxstiff, kcentr, kdamp, ileft, iright, kpos, kdisplace, \\\n ain, idisp, id)',
example: '--8<-- "examples/scanu2.csd"',
parameters: [
{
name: 'init',
description: 'the initial position of the masses. If this is a negative number, then the absolute of _init_ signifies the table to use as a hammer shape. If _init_ &gt; 0, the length of it should be the same as the intended mass number, otherwise it can be anything. If _init_ is not an integer the initial state is white noise with the fractional part being a scaling..',
type: 'initialization'
},
{
name: 'irate',
description: 'the amount of time between successive updates of the mass state. Kind of like the sample period of the system. If the number is big, the string will update at a slow rate showing little timbral variability; otherwise it will change rapidly resulting in a more dynamic sound.',
type: 'initialization'
},
{
name: 'ifndisplace',
description: 'the ftable that contains the initial velocity for each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ifnmass',
description: 'ftable that contains the mass of each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ifnmatrix',
description: 'ftable that contains the spring stiffness of each connection. It should have the same size as the square of the intended mass number. The data ordering is a row after row dump of the connection matrix of the system.',
type: 'initialization'
},
{
name: 'ifncentr',
description: 'ftable that contains the centering force of each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ifndamp',
description: 'the ftable that contains the damping factor of each mass. It should have the same size as the intended mass number.',
type: 'initialization'
},
{
name: 'ileft',
description: 'If _init_ &lt; 0, the position of the positive pluck in the range 0 to 1. Ignored when _init_ &gt; 0.',
type: 'initialization'
},
{
name: 'iright',
description: 'If _init_ &lt; 0, the position of the negative pluck in the range 0 to 1. Ignored when _init_ &gt; 0.',
type: 'initialization'
},
{
name: 'idisp',
description: 'If 0, no display of the masses is provided.',
type: 'initialization'
},
{
name: 'id',
description: 'If positive, the ID of the opcode. This will be used to point the scanning opcode to the proper waveform maker. If this value is negative, the absolute of this value is the wavetable on which to write the waveshape. That wavetable can be used later from an other opcode to generate sound. The initial contents of this table will be destroyed.',
type: 'initialization'
},
{
name: 'kmass',
description: 'scales the masses',
type: 'performance'
},
{
name: 'kmtrxstiff',
description: 'scales the spring stiffness. Note that larger numbers slow the evolution of the vibration, which is the reciprocal of the coresponding parameter in scanu.',
type: 'performance'
},
{
name: 'kcentr',
description: 'scales the centering force',
type: 'performance'
},
{
name: 'kdamp',
description: 'scales the damping',
type: 'performance'
},
{
name: 'kpos',
description: 'position of an active hammer along the string (_kpos_ = 0 is leftmost, _kpos_ = 1 is rightmost). The shape of the hammer is determined by _init_ and the power it pushes with is _kdisplace_.',
type: 'performance'
},
{
name: 'kdisplace',
description: 'power that the active hammer uses.',
type: 'performance'
},
{
name: 'ain',
description: 'audio input that adds to the velocity of the masses. Amplitude should not be too great.',
type: 'performance'
},
],
seeAlso: ['Scanned Synthesis', 'Working with Scanned Synthesis', 'tutorials']
},
]

View File

@ -0,0 +1,69 @@
import type { CsoundReference } from './types'
// Signal Generators:Table Access
export const signalGeneratorsTableAccess: CsoundReference[] = [
{
name: 'oscil1',
type: 'opcode',
category: 'Signal Generators:Table Access',
description: 'Accesses table values by incremental sampling.',
syntax: 'kres = oscil1(idel, kamp, idur [, ifn])',
example: '--8<-- "examples/oscil1.csd"',
rates: ['k-rate', 'i-rate'],
parameters: [
{
name: 'idel',
description: 'delay in seconds before _oscil1_ incremental sampling begins.',
type: 'initialization'
},
{
name: 'idur',
description: 'duration in seconds to sample through the _oscil1_ table just once. A negative value will make the table be read from the end to the beginning.',
type: 'initialization'
},
{
name: 'ifn',
description: '(optional) function table number. _tablei, oscil1i_ require the extended guard point. The number defaults to -1 which indicates a sinewave.',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude factor.',
type: 'performance'
},
],
seeAlso: ['Table Access']
},
{
name: 'oscil1i',
type: 'opcode',
category: 'Signal Generators:Table Access',
description: 'Accesses table values by incremental sampling with linear interpolation.',
syntax: 'kres = oscil1i(idel, kamp, idur [, ifn])',
example: '--8<-- "examples/oscil1i.csd"',
rates: ['k-rate', 'i-rate'],
parameters: [
{
name: 'idel',
description: 'delay in seconds before _oscil1i_ incremental sampling begins.',
type: 'initialization'
},
{
name: 'idur',
description: 'duration in seconds to sample through the _oscil1i_ table just once. A negative value will make the table be read from the end to the beginning.',
type: 'initialization'
},
{
name: 'ifn',
description: '(optional) function table number. _oscil1i_ requires the extended guard point. The default value is -1 indicating a sine wave.',
type: 'initialization'
},
{
name: 'kamp',
description: 'amplitude factor',
type: 'performance'
},
],
seeAlso: ['Table Access']
},
]

View File

@ -0,0 +1,67 @@
import type { CsoundReference } from './types'
// Signal Generators:Wave Terrain Synthesis
export const signalGeneratorsWaveTerrainSynthesis: CsoundReference[] = [
{
name: 'sterrain',
type: 'opcode',
category: 'Signal Generators:Wave Terrain Synthesis',
description: 'A wave-terrain synthesis opcode using curves computed with the superformula.',
syntax: 'aout = sterrain(kamp, kcps, kx, ky, krx, kry, krot, ktab0, ktab1, km1, km2, \\\n kn1, kn2, kn3, ka, kb, kperiod)',
example: '--8<-- "examples/sterrain.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'ktabx',
description: 'The two tables that define the terrain - they can be changed at krate.',
type: 'performance'
},
{
name: 'ktaby',
description: 'The two tables that define the terrain - they can be changed at krate.',
type: 'performance'
},
{
name: 'kn1',
description: '!=0 and continous.',
type: 'performance'
},
{
name: 'ka',
description: '!=0 and continous.',
type: 'performance'
},
{
name: 'kb',
description: '!=0 and continous.',
type: 'performance'
},
{
name: 'kn2',
description: 'continous.',
type: 'performance'
},
{
name: 'kn3',
description: 'continous.',
type: 'performance'
},
{
name: 'km1',
description: 'positive integer > 0: note that the curves are not on all combinations of km1,km2 closed and have poles (closed in infinity) for example if kn1>0 and there exists an n,m in Z with 2*km1/km2 = 2m+1/n i.e curves with (3,2) (5,2) (7,2) etc and (5,4) (6,4) (7,4) (9,4) etc. have a pole which is noticeable when listening. If kn1 &lt; 0 then the curve is reversed and the poles go towards zero in this case. If km1 and km2 are zero silence is produced (a plain circ - same effect occurs with the tuple 2,2,2,2,2,1,1).',
type: 'performance'
},
{
name: 'km2',
description: 'positive integer > 0: note that the curves are not on all combinations of km1,km2 closed and have poles (closed in infinity) for example if kn1>0 and there exists an n,m in Z with 2*km1/km2 = 2m+1/n i.e curves with (3,2) (5,2) (7,2) etc and (5,4) (6,4) (7,4) (9,4) etc. have a pole which is noticeable when listening. If kn1 &lt; 0 then the curve is reversed and the poles go towards zero in this case. If km1 and km2 are zero silence is produced (a plain circ - same effect occurs with the tuple 2,2,2,2,2,1,1).',
type: 'performance'
},
{
name: 'kperiod',
description: 'some km1 and km2 ratios may cause pitch shifts. With the kperiod parameter this can be fixed. If the ratio is 1 then the kperiod value should also be set to km1 to get the incoming pitch out.',
type: 'performance'
},
],
seeAlso: ['Wave Terrain Synthesis']
},
]

View File

@ -0,0 +1,106 @@
import type { CsoundReference } from './types'
// Signal Generators:Waveguide Physical Modeling
export const signalGeneratorsWaveguidePhysicalModeling: CsoundReference[] = [
{
name: 'pluck',
type: 'opcode',
category: 'Signal Generators:Waveguide Physical Modeling',
description: 'Produces a naturally decaying plucked string or drum sound.',
syntax: 'ares = pluck(kamp, kcps, icps, ifn, imeth [, iparm1] [, iparm2])',
example: '--8<-- "examples/pluck.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'icps',
description: 'intended pitch value in Hz, used to set up a buffer of 1 cycle of audio samples which will be smoothed over time by a chosen decay method. _icps_ normally anticipates the value of _kcps_, but may be set artificially high or low to influence the size of the sample buffer.',
type: 'initialization'
},
{
name: 'ifn',
description: 'table number of a stored function used to initialize the cyclic decay buffer. If _ifn_ = 0, a random sequence will be used instead.',
type: 'initialization'
},
{
name: 'imeth',
description: 'method of natural decay. There are six, some of which use parameters values that follow.',
type: 'initialization'
},
{
name: 'kamp',
description: 'the output amplitude.',
type: 'performance'
},
{
name: 'kcps',
description: 'the resampling frequency in cycles-per-second.',
type: 'performance'
},
],
seeAlso: ['Waveguide Physical Modeling']
},
{
name: 'repluck',
type: 'opcode',
category: 'Signal Generators:Waveguide Physical Modeling',
description: 'Physical model of the plucked string.',
syntax: 'ares = repluck(iplk, kamp, icps, kpick, krefl, axcite)',
example: '--8<-- "examples/repluck.csd"',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'iplk',
description: 'The point of pluck is _iplk_, which is a fraction of the way up the string (0 to 1). A pluck point of zero means no initial pluck.',
type: 'initialization'
},
{
name: 'icps',
description: 'The string plays at _icps_ pitch.',
type: 'initialization'
},
{
name: 'kamp',
description: 'Amplitude of note.',
type: 'performance'
},
{
name: 'kpick',
description: 'Proportion of the way along the string to sample the output.',
type: 'performance'
},
{
name: 'krefl',
description: 'the coefficient of reflection, indicating the lossiness and the rate of decay. It must be strictly between 0 and 1 (it will complain about both 0 and 1).',
type: 'performance'
},
],
seeAlso: ['Waveguide Physical Modeling']
},
{
name: 'streson',
type: 'opcode',
category: 'Signal Generators:Waveguide Physical Modeling',
description: 'A string resonator with variable fundamental frequency.',
syntax: 'ares = streson(asig, kfr, kfdbgain)',
example: '--8<-- "examples/streson.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'asig',
description: 'the input audio signal.',
type: 'performance'
},
{
name: 'kfr',
description: 'the fundamental frequency of the string.',
type: 'performance'
},
{
name: 'kfdbgain',
description: 'feedback gain, typically between 0 and 1, of the internal delay line. A value close to 1 creates a slower decay and a more pronounced resonance. Small values may leave the input signal unaffected. Depending on the filter frequency, typical values are &gt; 0.9. Values down to -1 are also useful.',
type: 'performance'
},
],
seeAlso: ['Waveguides']
},
]

View File

@ -0,0 +1,603 @@
import type { CsoundReference } from './types'
// Signal I/O:File I/O
export const signalIOFileIO: CsoundReference[] = [
{
name: 'dumpk',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically writes an orchestra control-signal value to a named external file in a specific format.',
syntax: 'dumpk(ksig, ifilname, iformat, iprd)',
example: '--8<-- "examples/dumpk.csd"',
parameters: [
{
name: 'ifilname',
description: 'character string (in double quotes, spaces permitted) denoting the external file name. May either be a full path name with target directory specified or a simple filename to be created within the current directory',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the output data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the period of _ksig_ output in seconds, rounded to the nearest orchestra control period. A value of 0 implies one control period (the enforced minimum), which will create an output file sampled at the orchestra control rate.',
type: 'initialization'
},
{
name: 'ksig',
description: 'a control-rate signal',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'dumpk2',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically writes two orchestra control-signal values to a named external file in a specific format.',
syntax: 'dumpk2(ksig1, ksig2, ifilname, iformat, iprd)',
example: '--8<-- "examples/dumpk2.csd"',
parameters: [
{
name: 'ifilname',
description: 'character string (in double quotes, spaces permitted) denoting the external file name. May either be a full path name with target directory specified or a simple filename to be created within the current directory',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the output data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the period of _ksig_ output in seconds, rounded to the nearest orchestra control period. A value of 0 implies one control period (the enforced minimum), which will create an output file sampled at the orchestra control rate.',
type: 'initialization'
},
{
name: 'ksig1',
description: 'control-rate signals.',
type: 'performance'
},
{
name: 'ksig2',
description: 'control-rate signals.',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'dumpk3',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically writes three orchestra control-signal values to a named external file in a specific format.',
syntax: 'dumpk3(ksig1, ksig2, ksig3, ifilname, iformat, iprd)',
example: '--8<-- "examples/dumpk3.csd"',
parameters: [
{
name: 'ifilname',
description: 'character string (in double quotes, spaces permitted) denoting the external file name. May either be a full path name with target directory specified or a simple filename to be created within the current directory',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the output data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the period of _ksig_ output in seconds, rounded to the nearest orchestra control period. A value of 0 implies one control period (the enforced minimum), which will create an output file sampled at the orchestra control rate.',
type: 'initialization'
},
{
name: 'ksig1',
description: 'control-rate signals',
type: 'performance'
},
{
name: 'ksig2',
description: 'control-rate signals',
type: 'performance'
},
{
name: 'ksig3',
description: 'control-rate signals',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'dumpk4',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically writes four orchestra control-signal values to a named external file in a specific format.',
syntax: 'dumpk4(ksig1, ksig2, ksig3, ksig4, ifilname, iformat, iprd)',
example: '--8<-- "examples/dumpk4.csd"',
parameters: [
{
name: 'ifilname',
description: 'character string (in double quotes, spaces permitted) denoting the external file name. May either be a full path name with target directory specified or a simple filename to be created within the current directory',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the output data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the period of _ksig_ output in seconds, rounded to the nearest orchestra control period. A value of 0 implies one control period (the enforced minimum), which will create an output file sampled at the orchestra control rate.',
type: 'initialization'
},
{
name: 'ksig1',
description: 'control-rate signals',
type: 'performance'
},
{
name: 'ksig2',
description: 'control-rate signals',
type: 'performance'
},
{
name: 'ksig3',
description: 'control-rate signals',
type: 'performance'
},
{
name: 'ksig4',
description: 'control-rate signals',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'ficlose',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Closes a previously opened file.',
syntax: 'ficlose(ihandle)\n ficlose(Sfilename)',
example: '--8<-- "examples/ficlose.csd"',
parameters: [
{
name: 'ihandle',
description: 'a number which identifies this file (generated by a previous [fiopen](../opcodes/fiopen.md)).',
type: 'initialization'
},
{
name: 'Sfilename',
description: 'A string in double quotes or string variable with the filename. The full path must be given if the file directory is not in the system PATH and is not present in the current directory.',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'fin',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Read signals from a file at a-rate.',
syntax: 'fin(ifilename, iskipframes, iformat, ain1 [, ain2] [, ain3] [,...])\n fin(ifilename, iskipframes, iformat, arr[])',
example: '--8<-- "examples/fin.csd"',
parameters: [
{
name: 'ifilename',
description: 'input file name (can be a string or a handle number generated by [fiopen](../opcodes/fiopen.md)).',
type: 'initialization'
},
{
name: 'iskipframes',
description: 'number of frames to skip at the start (every frame contains a sample of each channel)',
type: 'initialization'
},
{
name: 'iformat',
description: 'a number specifying the input file format for headerless files.',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'fini',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Read signals from a file at i-rate.',
syntax: 'fini(ifilename, iskipframes, iformat, in1 [, in2] [, in3] [, ...])',
example: '--8<-- "examples/fini.csd"',
parameters: [
{
name: 'ifilename',
description: 'input file name (can be a string or a handle number generated by [fiopen](../opcodes/fiopen.md))',
type: 'initialization'
},
{
name: 'iskipframes',
description: 'number of frames to skip at the start (every frame contains a sample of each channel)',
type: 'initialization'
},
{
name: 'iformat',
description: 'a number specifying the input file format. If a header is found, this argument is ignored.',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'fink',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Read signals from a file at k-rate.',
syntax: 'fink(ifilename, iskipframes, iformat, kin1 [, kin2] [, kin3] [,...])',
example: '--8<-- "examples/fink.csd"',
parameters: [
{
name: 'ifilename',
description: 'input file name (can be a string or a handle number generated by [fiopen](../opcodes/fiopen.md))',
type: 'initialization'
},
{
name: 'iskipframes',
description: 'number of frames to skip at the start (every frame contains a sample of each channel)',
type: 'initialization'
},
{
name: 'iformat',
description: 'a number specifying the input file format. If a header is found, this argument is ignored.',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'fiopen',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Opens a file in a specific mode.',
syntax: 'ihandle = fiopen(ifilename, imode)',
example: '--8<-- "examples/fiopen.csd"',
parameters: [
{
name: 'ihandle',
description: 'a number which specifies this file.',
type: 'initialization'
},
{
name: 'ifilename',
description: 'the target file\'s name (in double-quotes).',
type: 'initialization'
},
{
name: 'imode',
description: 'choose the mode of opening the file. _imode_ can be a value chosen among the following:',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'fout',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Outputs a-rate signals to a specified file of an arbitrary number of channels.',
syntax: 'fout(ifilename, iformat, aout1 [, aout2, aout3,...,aoutN])\n fout(ifilename, iformat, array[])',
example: '--8<-- "examples/fout.csd"',
parameters: [
{
name: 'ifilename',
description: 'the output file\'s name (in double-quotes).',
type: 'initialization'
},
{
name: 'iformat',
description: 'a flag to choose output file format (note: Csound versions older than 5.0 may only support formats 0, 1, and 2):',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'fouti',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Outputs i-rate signals of an arbitrary number of channels to a specified file.',
syntax: 'fouti(ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN])',
example: '--8<-- "examples/fouti.csd"',
parameters: [
{
name: 'ihandle',
description: 'a number which specifies this file.',
type: 'initialization'
},
{
name: 'iformat',
description: 'a flag to choose output file format:',
type: 'initialization'
},
{
name: 'iflag',
description: 'choose the mode of writing to the ASCII file (valid only in ASCII mode; in binary mode _iflag_ has no meaning, but it must be present anyway). _iflag_ can be a value chosen among the following:',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'foutir',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Outputs i-rate signals from an arbitrary number of channels to a specified file.',
syntax: 'foutir(ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN])',
example: '--8<-- "examples/foutir.csd"',
parameters: [
{
name: 'ihandle',
description: 'a number which specifies this file.',
type: 'initialization'
},
{
name: 'iformat',
description: 'a flag to choose output file format:',
type: 'initialization'
},
{
name: 'iflag',
description: 'choose the mode of writing to the ASCII file (valid only in ASCII mode; in binary mode _iflag_ has no meaning, but it must be present anyway). _iflag_ can be a value chosen among the following:',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'foutk',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Outputs k-rate signals of an arbitrary number of channels to a specified file, in raw (headerless) format.',
syntax: 'foutk(ifilename, iformat, kout1 [, kout2, kout3,....,koutN])',
example: '--8<-- "examples/foutk.csd"',
parameters: [
{
name: 'ifilename',
description: 'the output file\'s name (in double-quotes).',
type: 'initialization'
},
{
name: 'iformat',
description: 'a flag to choose output file format (note: Csound versions older than 5.0 may only support formats 0 and 1):',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'fprintks',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Similar to [printks](../opcodes/printks.md) but prints to a file.',
syntax: 'fprintks("filename", "string", [, kval1] [, kval2] [...])',
example: '--8<-- "examples/fprintks.csd"',
seeAlso: ['File Input and Output']
},
{
name: 'fprints',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Similar to [prints](../opcodes/prints.md) but prints to a file.',
syntax: 'fprints("filename", "string" [, ival1] [, ival2] [...])',
example: '--8<-- "examples/fprints.csd"',
seeAlso: ['File Input and Output']
},
{
name: 'readf',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Read a line of text from an external file once each k-cycle.',
syntax: 'Sres, kline = readf(ifilname)',
example: '--8<-- "examples/readf.csd"',
parameters: [
{
name: 'ifilname',
description: 'an integer N denoting a file named "input.N" or a character string (in double quotes, spaces permitted) denoting the external file name. For a string, it may either be a full path name with directory specified or a simple filename. In the later case, the file is sought first in the current directory, then in SSDIR, and finally in SFDIR.',
type: 'initialization'
},
{
name: 'Sres',
description: 'output of the line read from _ifilname_.',
type: 'performance'
},
{
name: 'kline',
description: 'line number, or -1 when end of file has been reached.',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'readfi',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Read a line of text from an external file once on initialisation.',
syntax: 'Sres, iline = readfi(ifilname)',
example: '--8<-- "examples/readfi.csd"',
parameters: [
{
name: 'ifilname',
description: 'an integer N denoting a file named "input.N" or a character string (in double quotes, spaces permitted) denoting the external file name. For a string, it may either be a full path name with directory specified or a simple filename. In the later case, the file is sought first in the current directory, then in SSDIR, and finally in SFDIR.',
type: 'initialization'
},
{
name: 'iline',
description: 'line number, or -1 when end of file has been reached.',
type: 'initialization'
},
{
name: 'Sres',
description: 'output of the line read from _ifilname_.',
type: 'initialization'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'readk',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically reads an orchestra control-signal value from a named external file in a specific format.',
syntax: 'kres = readk(ifilname, iformat, iprd)',
example: '--8<-- "examples/readk.csd"',
rates: ['k-rate'],
parameters: [
{
name: 'ifilname',
description: 'an integer N denoting a file named "readk.N" or a character string (in double quotes, spaces permitted) denoting the external file name. For a string, it may either be a full path name with directory specified or a simple filename. In the later case, the file is sought first in the current directory, then in SSDIR, and finally in SFDIR.',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the input data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the rate (period) in seconds, rounded to the nearest orchestra control period, at which the signal is read from the input file. A value of 0 implies one control period (the enforced minimum), which will read new values at the orchestra control rate. Longer periods will cause the same values to repeat for more than one control period.',
type: 'initialization'
},
{
name: 'kres',
description: 'output of the signal read from _ifilname_.',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'readk2',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically reads two orchestra control-signal values from an external file.',
syntax: 'kr1, kr2 = readk2(ifilname, iformat, iprd)',
example: '--8<-- "examples/readk2.csd"',
parameters: [
{
name: 'ifilname',
description: 'an integer N denoting a file named "readk.N" or a character string (in double quotes, spaces permitted) denoting the external file name. For a string, it may either be a full path name with directory specified or a simple filename. In the later case, the file is sought first in the current directory, then in [SSDIR](../invoke/environment-variables.md), and finally in [SFDIR](../invoke/environment-variables.md).',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the input data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the rate (period) in seconds, rounded to the nearest orchestra control period, at which the signals are read from the input file. A value of 0 implies one control period (the enforced minimum), which will read new values at the orchestra control rate. Longer periods will cause the same values to repeat for more than one control period.',
type: 'initialization'
},
{
name: 'kr1',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
{
name: 'kr2',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'readk3',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically reads three orchestra control-signal values from an external file.',
syntax: 'kr1, kr2, kr3 = readk3(ifilname, iformat, iprd)',
example: '--8<-- "examples/readk3.csd"',
parameters: [
{
name: 'ifilname',
description: 'an integer N denoting a file named "readk.N" or a character string (in double quotes, spaces permitted) denoting the external file name. For a string, it may either be a full path name with directory specified or a simple filename. In the later case, the file is sought first in the current directory, then in [SSDIR](../invoke/environment-variables.md), and finally in [SFDIR](../invoke/environment-variables.md).',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the input data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the rate (period) in seconds, rounded to the nearest orchestra control period, at which the signals are read from the input file. A value of 0 implies one control period (the enforced minimum), which will read new values at the orchestra control rate. Longer periods will cause the same values to repeat for more than one control period.',
type: 'initialization'
},
{
name: 'kr1',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
{
name: 'kr2',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
{
name: 'kr3',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
{
name: 'readk4',
type: 'opcode',
category: 'Signal I/O:File I/O',
description: 'Periodically reads four orchestra control-signal values from an external file.',
syntax: 'kr1, kr2, kr3, kr4 = readk4(ifilname, iformat, iprd)',
example: '--8<-- "examples/readk4.csd"',
parameters: [
{
name: 'ifilname',
description: 'an integer N denoting a file named "readk.N" or a character string (in double quotes, spaces permitted) denoting the external file name. For a string, it may either be a full path name with directory specified or a simple filename. In the later case, the file is sought first in the current directory, then in [SSDIR](../invoke/environment-variables.md), and finally in [SFDIR](../invoke/environment-variables.md).',
type: 'initialization'
},
{
name: 'iformat',
description: 'specifies the input data format:',
type: 'initialization'
},
{
name: 'iprd',
description: 'the rate (period) in seconds, rounded to the nearest orchestra control period, at which the signals are read from the input file. A value of 0 implies one control period (the enforced minimum), which will read new values at the orchestra control rate. Longer periods will cause the same values to repeat for more than one control period.',
type: 'initialization'
},
{
name: 'kr1',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
{
name: 'kr2',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
{
name: 'kr3',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
{
name: 'kr4',
description: 'output of the signals read from _ifilname_.',
type: 'performance'
},
],
seeAlso: ['File Input and Output']
},
]

View File

@ -0,0 +1,221 @@
import type { CsoundReference } from './types'
// Signal I/O:Printing and Display
export const signalIOPrintingAndDisplay: CsoundReference[] = [
{
name: 'dispfft',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Displays the Fourier Transform of an audio or control signal.',
syntax: 'dispfft(xsig, iprd, iwsiz [, iwtyp] [, idbout] [, iwtflg] [,imin] [,imax])',
example: '--8<-- "examples/dispfft.csd"',
parameters: [
{
name: 'iprd',
description: 'the period of display in seconds.',
type: 'initialization'
},
{
name: 'iwsiz',
description: 'size of the input window in samples. A window of _iwsiz_ points will produce a Fourier transform of _iwsiz_/2 points, spread linearly in frequency from 0 to sr/2. _iwsiz_ must be a power of 2, with a minimum of 16 and a maximum of 4096. The windows are permitted to overlap.',
type: 'initialization'
},
{
name: 'dispfft',
description: 'displays the Fourier Transform of an audio or control signal (_asig_ or _ksig_) every _iprd_ seconds using the Fast Fourier Transform method.',
type: 'performance'
},
],
seeAlso: ['Printing and Display']
},
{
name: 'display',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Displays the audio or control signals as an amplitude vs. time graph.',
syntax: 'display(xsig, iprd [, inprds] [, iwtflg])',
example: '--8<-- "examples/display.csd"',
parameters: [
{
name: 'iprd',
description: 'the period of display in seconds.',
type: 'initialization'
},
{
name: 'inprds_ is a scaling factor for the displayed waveform',
description: 'sized frames of samples are drawn in the window (the default and minimum value is 1.0). Higher _inprds_ values are slower to draw (more points to draw) but will show the waveform scrolling through the window, which is useful with low _iprd_ values.',
type: 'initialization'
},
{
name: 'controlling how many _iprd',
description: 'sized frames of samples are drawn in the window (the default and minimum value is 1.0). Higher _inprds_ values are slower to draw (more points to draw) but will show the waveform scrolling through the window, which is useful with low _iprd_ values.',
type: 'initialization'
},
{
name: 'display',
description: 'displays the audio or control signal _xsig_ every _iprd_ seconds, as an amplitude vs. time graph.',
type: 'performance'
},
],
seeAlso: ['Printing and Display']
},
{
name: 'flashtxt',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Allows text to be displayed from instruments like sliders etc. (only on Unix and Windows at present)',
syntax: 'flashtxt( iwhich, String)',
example: '--8<-- "examples/flashtxt.csd"',
parameters: [
{
name: 'iwhich',
description: 'the number of the window.',
type: 'initialization'
},
{
name: 'String',
description: 'the string to be displayed.',
type: 'initialization'
},
],
seeAlso: ['Sensing and Control: TCL/TK widgets']
},
{
name: 'print',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Displays the values of init (i-rate) variables.',
syntax: 'print(iarg [, iarg1] [, iarg2] [...])',
example: '--8<-- "examples/print.csd"',
parameters: [
{
name: 'print',
description: 'print the current value of the i-time arguments (or expressions) _iarg_ at every i-pass through the instrument.',
type: 'performance'
},
],
seeAlso: ['Printing and Display']
},
{
name: 'printf',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'printf-style formatted output.',
syntax: 'printf_i(Sfmt, itrig, [iarg1[, iarg2[, ... ]]])\n printf(Sfmt, ktrig, [xarg1[, xarg2[, ... ]]])',
example: '--8<-- "examples/printf.csd"',
parameters: [
{
name: 'Sfmt',
description: 'format string, has the same format as in printf() and other similar C functions, except length modifiers (l, ll, h, etc.) are not supported. The following conversion specifiers are allowed:',
type: 'initialization'
},
{
name: 'itrig',
description: 'if greater than zero the opcode performs the printing; otherwise it is an null operation.',
type: 'initialization'
},
{
name: 'ktrig',
description: 'if greater than zero and different from the value on the previous control cycle the opcode performs the requested printing. Initially this previous value is taken as zero.',
type: 'performance'
},
],
seeAlso: ['Printing and Display', 'http://www.cplusplus.com/reference/clibrary/cstdio/printf/']
},
{
name: 'printk',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Prints one k-rate value at specified intervals.',
syntax: 'printk(itime, kval [, ispace] [, inamed])',
example: '--8<-- "examples/printk.csd"',
parameters: [
{
name: 'itime',
description: 'time in seconds between printings.',
type: 'initialization'
},
{
name: 'kval',
description: 'The k-rate values to be printed.',
type: 'performance'
},
],
seeAlso: ['Printing and Display']
},
{
name: 'printk2',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Prints a new value every time a control variable changes.',
syntax: 'printk2(kvar [, inumspaces] [, inamed])',
example: '--8<-- "examples/printk2.csd"',
parameters: [
{
name: 'kvar',
description: 'signal to be printed',
type: 'performance'
},
],
seeAlso: ['Printing and Display']
},
{
name: 'printks',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Prints at k-rate using a printf() style syntax.',
syntax: 'printks("string", itime [, xval1] [, xval2] [...])',
example: '--8<-- "examples/printks.csd"',
parameters: [
{
name: 'itime',
description: 'time in seconds between printings.',
type: 'initialization'
},
],
seeAlso: ['Printing and Display']
},
{
name: 'printks2',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Prints a new value every time a control variable changes using a printf() style syntax.',
syntax: 'printks2("string", kval)',
example: '--8<-- "examples/printks2.csd"',
parameters: [
{
name: 'kval',
description: 'signal to be printed. The style of printing is specified in _&#8220;string&#8221;_ with the standard C value specifier (%f, %d, etc.).',
type: 'performance'
},
],
seeAlso: ['Printing and Display']
},
{
name: 'println',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Prints at k-rate using a printf() style syntax like [printks](../opcodes/printks.md), appends a new line.',
syntax: 'println("string", [, xval1] [, xval2] [...])',
example: '--8<-- "examples/println.csd"',
seeAlso: ['Printing and Display']
},
{
name: 'prints',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Prints at init-time using a printf() style syntax.',
syntax: 'prints("string" [, xval1] [, xval2] [...])',
example: '--8<-- "examples/prints.csd"',
seeAlso: ['Printing and Display']
},
{
name: 'printsk',
type: 'opcode',
category: 'Signal I/O:Printing and Display',
description: 'Prints at k-rate using a printf() style syntax.',
syntax: 'printsk("string", [, xval1] [, xval2] [...])',
example: '--8<-- "examples/printsk.csd"',
seeAlso: ['Printing and Display']
},
]

View File

@ -0,0 +1,218 @@
import type { CsoundReference } from './types'
// Signal I/O:Signal Input
export const signalIOSignalInput: CsoundReference[] = [
{
name: 'diskin',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads audio data from an external device or stream and can alter its pitch.',
syntax: 'ar1 [, ar2 [, ar3 [, ... arN]]] = diskin(ifilcod[, kpitch[, iskiptim \\\n [, iwraparound[, iformat[, iskipinit]]]]])',
example: '--8<-- "examples/diskin.csd"',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting the source soundfile name. An integer denotes the file soundin.filcod ; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought first in the current directory, then in that given by the environment variable [SSDIR](../invoke/environment-variables.md) (if defined) then by [SFDIR](../invoke/environment-variables.md). See also [GEN01](../scoregens/gen01.md).',
type: 'initialization'
},
{
name: 'iwraparound',
description: '1 = on, 0 = off (wraps around to end of file either direction, enabling looping)',
type: 'initialization'
},
{
name: 'kpitch',
description: 'can be any real number. A negative number signifies backwards playback. The given number is a pitch ratio, where:',
type: 'performance'
},
],
seeAlso: ['Signal Input']
},
{
name: 'diskin2',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads audio data from a file, and can alter its pitch using one of several available interpolation types, as well as convert the sample rate to match the orchestra sr setting.',
syntax: 'a1[, a2[, ... aN]] = diskin2(ifilcod[, kpitch[, iskiptim \\\n [, iwrap[, iformat[, iwsize[, ibufsize[, iskipinit]]]]]]])\n ar1[] = diskin2(ifilcod[, kpitch[, iskiptim \\\n [, iwrap[, iformat[, iwsize[, ibufsize[, iskipinit]]]]]]])',
example: '--8<-- "examples/diskin2.csd"',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting the source soundfile name. An integer denotes the file soundin.ifilcod; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought first in the current directory, then in those given by the environment variable [SSDIR](../invoke/environment-variables.md) (if defined) then by [SFDIR](../invoke/environment-variables.md). See also [GEN01](../scoregens/gen01.md). Note: files longer than 2<sup>31</sup>-1 sample frames may not be played correctly on 32-bit platforms; this means a maximum length about 3 hours with a sample rate of 192000 Hz.',
type: 'initialization'
},
{
name: 'kpitch',
description: 'transpose the pitch of input sound by this factor (e.g. 0.5 means one octave lower, 2 is one octave higher, and 1 is the original pitch, which is the default value). Fractional and negative values are allowed (the latter results in playing the file backwards, however, in this case the skip time parameter should be set to some positive value, e.g. the length of the file, or _iwrap_ should be non-zero, otherwise nothing would be played). If interpolation is enabled, and the sample rate of the file differs from the orchestra sample rate, the transpose ratio is automatically adjusted to make sure that _kpitch_=1 plays at the original pitch. Using a high _iwsize_ setting (40 or more) can significantly improve sound quality when transposing up, although at the expense of high CPU usage.',
type: 'performance'
},
],
seeAlso: ['Signal Input']
},
{
name: 'in',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads mono audio data from an external device or stream.',
syntax: 'ar1 = in()\n aarray = in()',
example: '--8<-- "examples/in.csd"',
seeAlso: ['Signal Input']
},
{
name: 'in32',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads a 32-channel audio signal from an external device or stream.',
syntax: 'ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9, ar10, ar11, ar12, ar13, ar14, \\\n ar15, ar16, ar17, ar18, ar19, ar20, ar21, ar22, ar23, ar24, ar25, ar26, \\\n ar27, ar28, ar29, ar30, ar31, ar32 = in32()',
seeAlso: ['Signal Input']
},
{
name: 'inch',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads from numbered channels in an external audio signal or stream.',
syntax: 'ain1[, ...] = inch(kchan1[,...])',
example: '--8<-- "examples/inch.csd"',
parameters: [
{
name: 'inch_ can also be used to receive audio in realtime from the audio interface using',
description: 'iadc_.',
type: 'performance'
},
],
seeAlso: ['Signal Input']
},
{
name: 'inh',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads six-channel audio data from an external device or stream.',
syntax: 'ar1, ar2, ar3, ar4, ar5, ar6 = inh()',
seeAlso: ['Signal Input']
},
{
name: 'ino',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads eight-channel audio data from an external device or stream.',
syntax: 'ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8 = ino()',
seeAlso: ['Signal Input']
},
{
name: 'inq',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads quad audio data from an external device or stream.',
syntax: 'ar1, ar2, ar3, a4 = inq()',
example: '--8<-- "examples/inq.csd"',
seeAlso: ['Signal Input']
},
{
name: 'inrg',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads audio from a range of adjacent audio channels from the audio input device.',
syntax: 'inrg(kstart, ain1 [,ain2, ain3, ..., ainN])',
parameters: [
{
name: 'kstart',
description: 'the number of the first channel of the input device to be accessed (channel numbers starts with 1, which is the first channel)',
type: 'performance'
},
],
seeAlso: ['Signal Input']
},
{
name: 'ins',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads stereo audio data from an external device or stream.',
syntax: 'ar1, ar2 = ins()',
example: '--8<-- "examples/ins.csd"',
seeAlso: ['Signal Input']
},
{
name: 'invalue',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads a k-rate or i-rate signal or string from a user-defined channel.',
syntax: 'ivalue = invalue("channel name")\n kvalue = invalue("channel name")\n Sname = invalue("channel name")',
example: '--8<-- "examples/invalue.csd"',
parameters: [
{
name: 'ivalue',
description: 'The value that is read from the channel.',
type: 'performance'
},
{
name: 'kvalue',
description: 'The value that is read from the channel.',
type: 'performance'
},
{
name: 'Sname',
description: 'The string variable that is read from the channel.',
type: 'performance'
},
],
seeAlso: ['Signal Input']
},
{
name: 'inx',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads a 16-channel audio signal from an external device or stream.',
syntax: 'ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9, ar10, ar11, ar12, \\\n ar13, ar14, ar15, ar16 = inx()',
seeAlso: ['Signal Input']
},
{
name: 'inz',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads multi-channel audio samples into a ZAK array from an external device or stream.',
syntax: 'inz(ksig1)',
seeAlso: ['Signal Input']
},
{
name: 'mp3in',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads mono or stereo audio data from an external MP3 file.',
syntax: 'ar1, ar2 = mp3in(ifilcod[, iskptim, iformat, iskipinit, ibufsize])\n ar1 = mp3in(ifilcod[, iskptim, iformat, iskipinit, ibufsize])',
example: '--8<-- "examples/mp3in.csd"',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting the source soundfile name. An integer denotes the file soundin.filcod ; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought first in the current directory, then in that given by the environment variable [SSDIR](../invoke/environment-variables.md) (if defined) then by [SFDIR](../invoke/environment-variables.md).',
type: 'initialization'
},
],
seeAlso: ['Signal Input']
},
{
name: 'soundin',
type: 'opcode',
category: 'Signal I/O:Signal Input',
description: 'Reads audio data from an external device or stream.',
syntax: 'ar1[, ar2[, ar3[, ... a24]]] = soundin(ifilcod [, iskptim] [, iformat] \\\n [, iskipinit] [, ibufsize])',
example: '--8<-- "examples/soundin.csd"',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting the source soundfile name. An integer denotes the file soundin.filcod; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought first in the current directory, then in that given by the environment variable [SSDIR](../invoke/environment-variables.md) (if defined) then by [SFDIR](../invoke/environment-variables.md). See also [GEN01](../scoregens/gen01.md).',
type: 'initialization'
},
{
name: 'iskipinit',
description: 'switches off all initialisation if non zero (default=0). This was introduced in 4_23f13 and csound5.',
type: 'initialization'
},
{
name: 'ibufsize',
description: 'buffer size in mono samples (not sample frames). Not available in Csound versions older than 5.00. The default buffer size is 2048.',
type: 'initialization'
},
],
seeAlso: ['Signal Input']
},
]

View File

@ -0,0 +1,277 @@
import type { CsoundReference } from './types'
// Signal I/O:Signal Output
export const signalIOSignalOutput: CsoundReference[] = [
{
name: 'mdelay',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'A MIDI delay opcode.',
syntax: 'mdelay(kstatus, kchan, kd1, kd2, kdelay)',
example: '--8<-- "examples/mdelay.csd"',
parameters: [
{
name: 'kstatus',
description: 'status byte of MIDI message to be delayed',
type: 'performance'
},
{
name: 'kchan',
description: 'MIDI channel (1-16)',
type: 'performance'
},
{
name: 'kd1',
description: 'first MIDI data byte',
type: 'performance'
},
{
name: 'kd2',
description: 'second MIDI data byte',
type: 'performance'
},
{
name: 'kdelay',
description: 'delay time in seconds',
type: 'performance'
},
],
seeAlso: ['MIDI Message Output']
},
{
name: 'monitor',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Returns the audio spout frame (if active), otherwise it returns zero.',
syntax: 'aout1 [,aout2 ... aoutX] = monitor()\n aarra = monitor()',
example: '--8<-- "examples/monitor.csd"',
seeAlso: ['Signal Output']
},
{
name: 'out',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes audio data to an external device or stream, either from audio variables or from an audio array.',
syntax: 'out(asig1[, asig2,....])\n out(aarray)',
example: '--8<-- "examples/out.csd"',
seeAlso: ['Signal Output']
},
{
name: 'out32',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes 32-channel audio data to an external device or stream.',
syntax: 'out32(asig1, asig2, asig3, asig4, asig5, asig6, asig7, asig8, asig10, \\\n asig11, asig12, asig13, asig14, asig15, asig16, asig17, asig18, \\\n asig19, asig20, asig21, asig22, asig23, asig24, asig25, asig26, \\\n asig27, asig28, asig29, asig30, asig31, asig32)',
seeAlso: ['Signal Output']
},
{
name: 'outall',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes a single audio value to all available audio channels.',
syntax: 'outall(asig)',
example: '--8<-- "examples/outall.csd"',
rates: ['a-rate'],
seeAlso: ['Signal Output']
},
{
name: 'outc',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes audio data with an arbitrary number of channels to an external device or stream.',
syntax: 'outc(asig1 [, asig2] [...])',
example: '--8<-- "examples/outc.csd"',
seeAlso: ['Signal Output']
},
{
name: 'outch',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes multi-channel audio data, with user-controllable channels, to an external device or stream.',
syntax: 'outch(kchan1, asig1 [, kchan2] [, asig2] [...])',
example: '--8<-- "examples/outch.csd"',
seeAlso: ['Signal Output', 'http://www.csoundjournal.com/issue16/audiorouting.html']
},
{
name: 'outh',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes 6-channel audio data to an external device or stream.',
syntax: 'outh(asig1, asig2, asig3, asig4, asig5, asig6)',
seeAlso: ['Signal Output']
},
{
name: 'outo',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes 8-channel audio data to an external device or stream.',
syntax: 'outo(asig1, asig2, asig3, asig4, asig5, asig6, asig7, asig8)',
seeAlso: ['Signal Output']
},
{
name: 'outq',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes 4-channel audio data to an external device or stream.',
syntax: 'outq(asig1, asig2, asig3, asig4)',
example: '--8<-- "examples/outq.csd"',
seeAlso: ['Signal Output']
},
{
name: 'outq1',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes samples to quad channel 1 of an external device or stream.',
syntax: 'outq1(asig)',
example: '--8<-- "examples/outq1.csd"',
rates: ['a-rate'],
seeAlso: ['Signal Output']
},
{
name: 'outq2',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes samples to quad channel 2 of an external device or stream.',
syntax: 'outq2(asig)',
example: '--8<-- "examples/outq2.csd"',
rates: ['a-rate'],
seeAlso: ['Signal Output']
},
{
name: 'outq3',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes samples to quad channel 3 of an external device or stream.',
syntax: 'outq3(asig)',
example: '--8<-- "examples/outq3.csd"',
rates: ['a-rate'],
seeAlso: ['Signal Output']
},
{
name: 'outq4',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes samples to quad channel 4 of an external device or stream.',
syntax: 'outq4(asig)',
example: '--8<-- "examples/outq4.csd"',
rates: ['a-rate'],
seeAlso: ['Signal Output']
},
{
name: 'outrg',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Outputs audio to a range of adjacent audio channels on the audio output device.',
syntax: 'outrg(kstart, aout1 [,aout2, aout3, ..., aoutN])',
example: '--8<-- "examples/outrg.csd"',
parameters: [
{
name: 'kstart',
description: 'the number of the first channel of the output device to be accessed (channel numbers starts with 1, which is the first channel)',
type: 'performance'
},
],
seeAlso: ['Signal Output']
},
{
name: 'outs',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes stereo audio data to an external device or stream.',
syntax: 'outs(asig1, asig2)',
example: '--8<-- "examples/outs.csd"',
seeAlso: ['Signal Output']
},
{
name: 'outs1',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes samples to stereo channel 1 of an external device or stream.',
syntax: 'outs1(asig)',
example: '--8<-- "examples/outs1.csd"',
rates: ['a-rate'],
seeAlso: ['Signal Output']
},
{
name: 'outs2',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes samples to stereo channel 2 of an external device or stream.',
syntax: 'outs2(asig)',
example: '--8<-- "examples/outs2.csd"',
rates: ['a-rate'],
seeAlso: ['Signal Output']
},
{
name: 'outvalue',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Sends an i-rate or k-rate signal or string to a user-defined channel.',
syntax: 'outvalue("channel name", ivalue)\n outvalue("channel name", kvalue)\n outvalue("channel name", "string")',
example: '--8<-- "examples/outvalue.csd"',
parameters: [
{
name: 'ivalue',
description: 'The value that is sent to the channel.',
type: 'performance'
},
{
name: 'kvalue',
description: 'The value that is sent to the channel.',
type: 'performance'
},
{
name: 'string',
description: 'The string or string variable that is sent to the channel.',
type: 'performance'
},
],
seeAlso: ['Signal Output']
},
{
name: 'outx',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes 16-channel audio data to an external device or stream.',
syntax: 'outx(asig1, asig2, asig3, asig4, asig5, asig6, asig7, asig8, \\\n asig9, asig10, asig11, asig12, asig13, asig14, asig15, asig16)',
seeAlso: ['Signal Output']
},
{
name: 'outz',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Writes multi-channel audio data from a ZAK array to an external device or stream.',
syntax: 'outz(ksig1)',
seeAlso: ['Signal Output']
},
{
name: 'soundout',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Deprecated. Writes audio output to a disk file.',
syntax: 'soundout(asig1, ifilcod [, iformat])',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting the destination soundfile name. An integer denotes the file soundin.filcod; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought first in the current directory, then in that given by the environment variable [SSDIR](../invoke/environment-variables.md) (if defined) then by [SFDIR](../invoke/environment-variables.md). See also [GEN01](../scoregens/gen01.md).',
type: 'initialization'
},
],
seeAlso: ['Signal Output']
},
{
name: 'soundouts',
type: 'opcode',
category: 'Signal I/O:Signal Output',
description: 'Deprecated. Writes audio output to a disk file.',
syntax: 'soundouts(asigl, asigr, ifilcod [, iformat])',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting the destination soundfile name. An integer denotes the file soundout.ifilcod; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is written relative to the directory given by the SFDIR environment variable if defined, or the current directory. See also [GEN01](../scoregens/gen01.md).',
type: 'initialization'
},
],
seeAlso: ['Signal Output']
},
]

View File

@ -0,0 +1,306 @@
import type { CsoundReference } from './types'
// Signal I/O:Software Bus
export const signalIOSoftwareBus: CsoundReference[] = [
{
name: 'chani',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Reads data from a channel of the inward software bus.',
syntax: 'kval = chani(kchan)\n aval = chani(kchan)',
example: 'sr = 44100\nkr = 100\nksmps = 1\n\ninstr 1\n kc chani 1\n a1 oscil p4, p5, 100\n a2 lowpass2 a1, kc, 200\n out a2\nendin',
parameters: [
{
name: 'kchan',
description: 'a positive integer that indicates which channel of the software bus to read',
type: 'performance'
},
],
seeAlso: ['Software Bus']
},
{
name: 'chano',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Send data to a channel of the outward software bus.',
syntax: 'chano(kval, kchan)\n chano(aval, kchan)',
example: 'sr = 44100\nkr = 100\nksmps = 1\n\ninstr 1\n a1 oscil p4, p5, 100\n chano 1, a1\nendin',
parameters: [
{
name: 'xval',
description: 'value to transmit',
type: 'performance'
},
{
name: 'kchan',
description: 'a positive integer that indicates which channel of the software bus to write',
type: 'performance'
},
],
seeAlso: ['Software Bus']
},
{
name: 'chn',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Declare a channel of the named software bus.',
syntax: 'chn_k(Sname, imode[, itype, idflt, imin, ima, ix, iy, iwidth, iheight, Sattributes])\n chn_a(Sname, imode)\n chn_S(Sname, imode)\n chn_S(Sname, Smode)\n chn_array(Sname, imode, Stype, iSizes[])',
example: 'sr = 44100\nkr = 100\nksmps = 1\n\nchn_k "cutoff", 1, 3, 1000, 500, 2000\n\ninstr 1\n kc chnget "cutoff"\n a1 oscil p4, p5, 100\n a2 lowpass2 a1, kc, 200\n out a2\nendin',
parameters: [
{
name: 'imode',
description: 'sum of at least one of 1 for input and 2 for output.',
type: 'initialization'
},
{
name: 'Smode',
description: 'The mode can also be set with a string: "r" for input, "w" for output or "rw" for input/output',
type: 'initialization'
},
{
name: 'Stypes',
description: 'the array channel type ("k", "a", "S").',
type: 'initialization'
},
{
name: 'ix',
description: 'suggested x position for controller.',
type: 'initialization'
},
{
name: 'iy',
description: 'suggested y position for controller.',
type: 'initialization'
},
{
name: 'iwidth',
description: 'suggested width position for controller.',
type: 'initialization'
},
{
name: 'iheight',
description: 'suggested height position for controller.',
type: 'initialization'
},
{
name: 'Sattributes',
description: 'attributes for controller.',
type: 'initialization'
},
],
seeAlso: ['Software Bus']
},
{
name: 'chnclear',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Clears a number of audio output channel of the named software bus.',
syntax: 'chnclear(Sname1[, Sname2,...])',
example: '--8<-- "examples/chnclear-modern.csd"',
seeAlso: ['Software Bus']
},
{
name: 'chnexport',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Export a global variable as a channel of the bus.',
syntax: 'gival = chnexport(Sname, imode[, itype, idflt, imin, imax])\n gkval = chnexport(Sname, imode[, itype, idflt, imin, imax])\n gaval = chnexport(Sname, imode)\n gSval = chnexport(Sname, imode)',
example: 'sr = 44100\nkr = 100\nksmps = 1\n\ngkc init 1000 ; set default value\ngkc chnexport "cutoff", 1, 3, i(gkc), 500, 2000\n\ninstr 1\n a1 oscil p4, p5, 100\n a2 lowpass2 a1, gkc, 200\n out a2\nendin',
parameters: [
{
name: 'imode',
description: 'sum of at least one of 1 for input and 2 for output.',
type: 'initialization'
},
],
seeAlso: ['Software Bus']
},
{
name: 'chnget',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Reads data from a channel of the inward named software bus.',
syntax: 'ival = chnget(Sname)\n kval = chnget(Sname)\n aval = chnget(Sname)\n Sval = chnget(Sname)\n Sval = chngetks(Sname)\n ival[] = chngeti(Sname[])\n kval[] = chngetk(Sname[])\n aval[] = chngeta(Sname[])\n Sval[] = chngets(Sname[])',
example: 'sr = 44100\nkr = 100\nksmps = 1\n\ninstr 1\n kc chnget "cutoff"\n a1 oscil p4, p5, 100\n a2 lowpass2 a1, kc, 200\n out a2\nendin',
parameters: [
{
name: 'Sname',
description: 'a string that identifies a channel of the named software bus to read.',
type: 'initialization'
},
{
name: 'ival',
description: 'the control value read at i-time.',
type: 'initialization'
},
{
name: 'Sval',
description: 'the string value read at i-time.',
type: 'initialization'
},
{
name: 'kval',
description: 'the control value read at performance time.',
type: 'performance'
},
{
name: 'aval',
description: 'the audio signal read at performance time.',
type: 'performance'
},
{
name: 'Sval',
description: 'the string value read at k-rate. The chnget opcode works both at i-time and perf-time, whereas chngetks works only at perf-time. String variables are only updated if the channel has changed.',
type: 'performance'
},
],
seeAlso: ['Software Bus']
},
{
name: 'chnmix',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Writes audio data to the named software bus, mixing to the previous output.',
syntax: 'chnmix(aval, Sname)',
example: '--8<-- "examples/chnmix-modern.csd"',
parameters: [
{
name: 'Sname',
description: 'a string that indicates which named channel of the software bus to write.',
type: 'initialization'
},
{
name: 'aval',
description: 'the audio signal to write at performance time.',
type: 'performance'
},
],
seeAlso: ['Software Bus']
},
{
name: 'chnparams',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Query parameters of a channel (if it does not exist, all returned values are zero).',
syntax: 'itype, imode, ictltype, idflt, imin, imax = chnparams(Sname)',
parameters: [
{
name: 'itype',
description: 'channel data type (1: control, 2: audio, 3: string)',
type: 'initialization'
},
{
name: 'imode',
description: 'sum of 1 for input and 2 for output',
type: 'initialization'
},
{
name: 'ictltype',
description: 'special parameter for control channel only; if not available, set to zero.',
type: 'initialization'
},
{
name: 'idflt',
description: 'special parameter for control channel only; if not available, set to zero.',
type: 'initialization'
},
{
name: 'imin',
description: 'special parameter for control channel only; if not available, set to zero.',
type: 'initialization'
},
{
name: 'imax',
description: 'special parameter for control channel only; if not available, set to zero.',
type: 'initialization'
},
{
name: 'Sname',
description: 'string identifying the channel.',
type: 'initialization'
},
],
seeAlso: ['Software Bus']
},
{
name: 'chnset',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Writes data to a channel of the named software bus.',
syntax: 'chnset(ival, Sname)\n chnset(kval, Sname)\n chnset(aval, Sname)\n chnset(Sval, Sname)\n chnsetks(Sval, Sname)\n chnseti(ival[], []Sname)\n chnsetk(kval[], []Sname)\n chnseta(aval[], []Sname)\n chnsets(Sval[], []Sname)',
example: 'sr = 44100\nkr = 100\nksmps = 1\n\ninstr 1\n a1 in\n kp,ka pitchamdf a1\n chnset kp, "pitch"\nendin',
parameters: [
{
name: 'Sname',
description: 'a string that indicates which named channel of the software bus to write.',
type: 'initialization'
},
{
name: 'ival',
description: 'the control value to write at i-time.',
type: 'initialization'
},
{
name: 'Sval',
description: 'the string value to write at i-time.',
type: 'initialization'
},
{
name: 'kval',
description: 'the control value to write at performance time.',
type: 'performance'
},
{
name: 'aval',
description: 'the audio signal to write at performance time.',
type: 'performance'
},
{
name: 'Sval',
description: 'the string value to write at perf-time. The opcode chnset with strings works at both i- and perf-time, whereas chnsetks works only a perf-time. Channel contents are only updated if the string variable is modified.',
type: 'performance'
},
],
seeAlso: ['Software Bus']
},
{
name: 'oversample',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Sets the local sampling rate value in a user-defined opcode block.',
syntax: 'oversample(ifactor [,icvt_in, icvt_out])',
parameters: [
{
name: 'ifactor',
description: 'sets the oversampling factor. It needs to be a positive integer &gt; 1. A factor of 1 is a non-op, zero or negative factors are illegal. The local sampling rate is set as ifactor * sr. The value of the sr variable is then changed locally. Local kr is also changed accordingly, local ksmps remains unchanged.',
type: 'initialization'
},
{
name: 'icvt_in',
description: 'converter used for input: if Secret Rabbit Code is used, then 0 - best quality sync (default); 1 - medium quality sync; 2 - fast sync; 3 - zero-order hold; and 4 - linear.',
type: 'initialization'
},
{
name: 'icvt_out',
description: 'converter used for output, defaults to the input converter, but can be different.',
type: 'initialization'
},
],
seeAlso: ['User Defined Opcodes (UDO)']
},
{
name: 'setksmps',
type: 'opcode',
category: 'Signal I/O:Software Bus',
description: 'Sets the local ksmps value in an instrument or user-defined opcode block.',
syntax: 'setksmps(iksmps)',
parameters: [
{
name: 'iksmps',
description: 'sets the local ksmps value.',
type: 'initialization'
},
],
seeAlso: ['User Defined Opcodes (UDO)']
},
]

View File

@ -0,0 +1,147 @@
import type { CsoundReference } from './types'
// Signal I/O:Soundfile Queries
export const signalIOSoundfileQueries: CsoundReference[] = [
{
name: 'filebit',
type: 'opcode',
category: 'Signal I/O:Soundfile Queries',
description: 'Returns the number of bits in each sample in a sound file.',
syntax: 'ir = filebit(ifilcod [, iallowraw])',
example: '--8<-- "examples/filebit.csd"',
parameters: [
{
name: 'ifilcod',
description: 'sound file to be queried',
type: 'initialization'
},
{
name: 'iallowraw',
description: '(Optional) Allow raw sound files (default=1)',
type: 'initialization'
},
],
seeAlso: ['Sound File Queries']
},
{
name: 'filelen',
type: 'opcode',
category: 'Signal I/O:Soundfile Queries',
description: 'Returns the length of a sound file.',
syntax: 'ir = filelen(ifilcod, [iallowraw])',
example: '--8<-- "examples/filelen.csd"',
parameters: [
{
name: 'ifilcod',
description: 'sound file to be queried',
type: 'initialization'
},
{
name: 'iallowraw',
description: 'Allow raw sound files (default=1)',
type: 'initialization'
},
],
seeAlso: ['Sound File Queries']
},
{
name: 'filenchnls',
type: 'opcode',
category: 'Signal I/O:Soundfile Queries',
description: 'Returns the number of channels in a sound file.',
syntax: 'ir = filenchnls(ifilcod [, iallowraw])',
example: '--8<-- "examples/filenchnls.csd"',
parameters: [
{
name: 'ifilcod',
description: 'sound file to be queried',
type: 'initialization'
},
{
name: 'iallowraw',
description: '(Optional) Allow raw sound files (default=1)',
type: 'initialization'
},
],
seeAlso: ['Sound File Queries']
},
{
name: 'filepeak',
type: 'opcode',
category: 'Signal I/O:Soundfile Queries',
description: 'Returns the peak absolute value of a sound file.',
syntax: 'ir = filepeak(ifilcod [, ichnl])',
example: '--8<-- "examples/filepeak.csd"',
parameters: [
{
name: 'ifilcod',
description: 'sound file to be queried',
type: 'initialization'
},
],
seeAlso: ['Sound File Queries']
},
{
name: 'filesr',
type: 'opcode',
category: 'Signal I/O:Soundfile Queries',
description: 'Returns the sample rate of a sound file.',
syntax: 'ir = filesr(ifilcod [, iallowraw])',
example: '--8<-- "examples/filesr.csd"',
parameters: [
{
name: 'ifilcod',
description: 'sound file to be queried',
type: 'initialization'
},
{
name: 'iallowraw',
description: '(Optional) Allow raw sound files (default=1)',
type: 'initialization'
},
],
seeAlso: ['Sound File Queries']
},
{
name: 'filevalid',
type: 'opcode',
category: 'Signal I/O:Soundfile Queries',
description: 'Checks that a file can be read at initialisation or performance time.',
syntax: 'ir = filevalid(ifilcod)\n kr = filevalid(ifilcod)',
example: '--8<-- "examples/filevalid.csd"',
parameters: [
{
name: 'ifilcod',
description: 'sound file to be queried',
type: 'initialization'
},
{
name: 'ir',
description: 'return code (1 if the sound file _ifilcod_ can be read).',
type: 'initialization'
},
{
name: 'kr',
description: 'return code (1 if the sound file _ifilcod_ can be read).',
type: 'performance'
},
],
seeAlso: ['Sound File Queries']
},
{
name: 'mp3len',
type: 'opcode',
category: 'Signal I/O:Soundfile Queries',
description: 'Returns the length of an MP3 sound file.',
syntax: 'ir = mp3len(ifilcod)',
example: '--8<-- "examples/mp3len.csd"',
parameters: [
{
name: 'ifilcod',
description: 'sound file to be queried',
type: 'initialization'
},
],
seeAlso: ['Sound File Queries']
},
]

View File

@ -0,0 +1,207 @@
import type { CsoundReference } from './types'
// Signal Modifiers:Amplitude Modifiers
export const signalModifiersAmplitudeModifiers: CsoundReference[] = [
{
name: 'balance',
type: 'opcode',
category: 'Signal Modifiers:Amplitude Modifiers',
description: 'Adjust one audio signal according to the values of another.',
syntax: 'ares = balance(asig, acomp [, ihp] [, iskip])',
example: '--8<-- "examples/balance-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'asig',
description: 'input audio signal',
type: 'performance'
},
{
name: 'acomp',
description: 'the comparator signal',
type: 'performance'
},
],
seeAlso: ['Amplitude Modifiers and Dynamic processing']
},
{
name: 'balance2',
type: 'opcode',
category: 'Signal Modifiers:Amplitude Modifiers',
description: 'Adjust one audio signal according to the values of another.',
syntax: 'ares = balance2(asig, acomp [, ihp] [, iskip])',
example: '--8<-- "examples/balance2-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'asig',
description: 'input audio signal',
type: 'performance'
},
{
name: 'acomp',
description: 'the comparator signal',
type: 'performance'
},
],
seeAlso: ['Amplitude Modifiers and Dynamic processing']
},
{
name: 'clip',
type: 'opcode',
category: 'Signal Modifiers:Amplitude Modifiers',
description: 'Clips an a-rate signal to a predefined limit, in a &#8220;soft&#8221; manner, using one of three methods.',
syntax: 'ares = clip(asig, imeth, ilimit [, iarg])',
example: '--8<-- "examples/clip-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'imeth',
description: 'selects the clipping method. The default is 0. The methods are:',
type: 'initialization'
},
{
name: 'ilimit',
description: 'limiting value',
type: 'initialization'
},
{
name: 'asig',
description: 'a-rate input signal',
type: 'performance'
},
],
seeAlso: ['Amplitude Modifiers and Dynamic processing', 'Waveshaping']
},
{
name: 'compress',
type: 'opcode',
category: 'Signal Modifiers:Amplitude Modifiers',
description: 'Compress, limit, expand, duck or gate an audio signal.',
syntax: 'ar = compress(aasig, acsig, kthresh, kloknee, khiknee, kratio, katt, krel, ilook)',
example: '--8<-- "examples/compress-modern.csd"',
parameters: [
{
name: 'ilook',
description: 'lookahead time in seconds, by which an internal envelope release can sense what is coming. This induces a delay between input and output, but a small amount of lookahead improves the performance of the envelope detector. Typical value is .05 seconds, sufficient to sense the peaks of the lowest frequency in _acsig_.',
type: 'initialization'
},
{
name: 'kthresh',
description: 'sets the lowest decibel level that will be allowed through. This is a threshold of a separate noise gate, normally 0 or less, but if higher the threshold will begin removing low-level signal energy such as background noise.',
type: 'performance'
},
{
name: 'kloknee',
description: 'decibel break-points denoting where compression or expansion will begin. These set the boundaries of a soft-knee curve joining the low-amplitude 1:1 line and the higher-amplitude compression ratio line. Typical values are 48 and 60 db. If the two breakpoints are equal, a hard-knee (angled) map will result.',
type: 'performance'
},
{
name: 'khiknee',
description: 'decibel break-points denoting where compression or expansion will begin. These set the boundaries of a soft-knee curve joining the low-amplitude 1:1 line and the higher-amplitude compression ratio line. Typical values are 48 and 60 db. If the two breakpoints are equal, a hard-knee (angled) map will result.',
type: 'performance'
},
{
name: 'kratio',
description: 'ratio of compression when the signal level is above the knee. The value 2 will advance the output just one decibel for every input gain of two; 3 will advance just one in three; 20 just one in twenty, etc. Inverse ratios will cause signal expansion: .5 gives two for one, .25 four for one, etc. The value 1 will result in no change.',
type: 'performance'
},
],
seeAlso: ['Amplitude Modifiers and Dynamic processing']
},
{
name: 'compress2',
type: 'opcode',
category: 'Signal Modifiers:Amplitude Modifiers',
description: 'Compress, limit, expand, duck or gate an audio signal.',
syntax: 'ar = compress2(aasig, acsig, kthresh, kloknee, khiknee, kratio, katt, krel, ilook)',
example: '--8<-- "examples/compress2-modern.csd"',
parameters: [
{
name: 'ilook',
description: 'lookahead time in seconds, by which an internal envelope release can sense what is coming. This induces a delay between input and output, but a small amount of lookahead improves the performance of the envelope detector. Typical value is .05 seconds, sufficient to sense the peaks of the lowest frequency in _acsig_.',
type: 'initialization'
},
{
name: 'kthresh',
description: 'sets the lowest decibel level that will be allowed through. This is a threshold of a separate noise gate, normally set at -90 dB or less, but if higher the threshold will begin removing low-level signal energy such as background noise.',
type: 'performance'
},
{
name: 'kloknee',
description: 'decibel break-points denoting where compression or expansion will begin. These set the boundaries of a soft-knee curve joining the low-amplitude 1:1 line and the higher-amplitude compression ratio line. Typical values are -52 and -30 dB. If the two breakpoints are equal, a hard-knee (angled) map will result.',
type: 'performance'
},
{
name: 'khiknee',
description: 'decibel break-points denoting where compression or expansion will begin. These set the boundaries of a soft-knee curve joining the low-amplitude 1:1 line and the higher-amplitude compression ratio line. Typical values are -52 and -30 dB. If the two breakpoints are equal, a hard-knee (angled) map will result.',
type: 'performance'
},
{
name: 'kratio',
description: 'ratio of compression when the signal level is above the knee. The value 2 will advance the output just one decibel for every input gain of two; 3 will advance just one in three; 20 just one in twenty, etc. Inverse ratios will cause signal expansion: .5 gives two for one, .25 four for one, etc. The value 1 will result in no change.',
type: 'performance'
},
],
seeAlso: ['Amplitude Modifiers and Dynamic processing']
},
{
name: 'dam',
type: 'opcode',
category: 'Signal Modifiers:Amplitude Modifiers',
description: 'A dynamic compressor/expander.',
syntax: 'ares = dam(asig, kthreshold, icomp1, icomp2, irtime, iftime)',
example: '--8<-- "examples/dam.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'icomp1',
description: 'compression ratio for upper zone.',
type: 'initialization'
},
{
name: 'icomp2',
description: 'compression ratio for lower zone',
type: 'initialization'
},
{
name: 'irtime',
description: 'gain rise time in seconds. Time over which the gain factor is allowed to raise of one unit.',
type: 'initialization'
},
{
name: 'iftime',
description: 'gain fall time in seconds. Time over which the gain factor is allowed to decrease of one unit.',
type: 'initialization'
},
{
name: 'asig',
description: 'input signal to be modified',
type: 'performance'
},
{
name: 'kthreshold',
description: 'level of input signal which acts as the threshold. Can be changed at k-time (e.g. for ducking)',
type: 'performance'
},
],
seeAlso: ['Amplitude Modifiers and Dynamic processing']
},
{
name: 'gain',
type: 'opcode',
category: 'Signal Modifiers:Amplitude Modifiers',
description: 'Adjusts the amplitude audio signal according to a root-mean-square value.',
syntax: 'ares = gain(asig, krms [, ihp] [, iskip])',
example: '--8<-- "examples/gain.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'asig',
description: 'input audio signal',
type: 'performance'
},
],
seeAlso: ['Amplitude Modifiers and Dynamic processing']
},
]

View File

@ -0,0 +1,188 @@
import type { CsoundReference } from './types'
// Signal Modifiers:Comparators and Accumulators
export const signalModifiersComparatorsAndAccumulators: CsoundReference[] = [
{
name: 'cmp',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Compares audio signals or arrays.',
syntax: 'aout = cmp(a1, S_operator, a2)\n aout = cmp(a1, S_operator, kb)\n kOut[] = cmp(kA[], S_operator, kb)\n kOut[] = cmp(kA[], S_operator, kB[])\n kOut[] = cmp(k1, S_operator1, kIn[], S_operator2, k2)',
example: '--8<-- "examples/cmp.csd"',
parameters: [
{
name: 'operator',
description: 'Math operator, one of ">", ">=", "<", "<=", "=="',
type: 'initialization'
},
{
name: 'a1',
description: 'Input signals',
type: 'performance'
},
{
name: 'a2',
description: 'Input signals',
type: 'performance'
},
{
name: 'kb',
description: 'Scalar term',
type: 'performance'
},
{
name: 'ib',
description: 'Scalar term',
type: 'performance'
},
],
seeAlso: ['Arithmetic and Logic Operations', 'Comparators and Accumulators', 'Array opcodes']
},
{
name: 'max',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Produces a signal that is the maximum of any number of input signals.',
syntax: 'amax = max(ain1, ain2 [, ain3] [, ain4] [...])\n kmax = max(kin1, kin2 [, kin3] [, kin4] [...])\n imax = max(iin1, iin2 [, iin3] [, iin4] [...])',
example: '--8<-- "examples/max.csd"',
seeAlso: ['Comparators and Accumulators']
},
{
name: 'max_k',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Local maximum (or minimum) value of an incoming asig signal, checked in the time interval between ktrig has become true twice.',
syntax: 'knumkout = max_k(asig, ktrig, itype)',
example: '--8<-- "examples/max_k.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'itype',
description: 'itype determinates the behaviour of max_k (see below)',
type: 'initialization'
},
{
name: 'asig',
description: 'incoming (input) signal',
type: 'performance'
},
{
name: 'ktrig',
description: 'trigger signal',
type: 'performance'
},
],
seeAlso: ['Comparators and Accumulators']
},
{
name: 'maxabs',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Produces a signal that is the maximum of the absolute values of any number of input signals.',
syntax: 'amax = maxabs(ain1, ain2 [, ain3] [, ain4] [...])\n kmax = maxabs(kin1, kin2 [, kin3] [, kin4] [...])',
example: '--8<-- "examples/maxabs.csd"',
seeAlso: ['Comparators and Accumulators']
},
{
name: 'maxabsaccum',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Accumulates the maximum of the absolute values of audio signals.',
syntax: 'maxabsaccum(aAccumulator, aInput)',
example: '--8<-- "examples/maxabsaccum.csd"',
parameters: [
{
name: 'aAccumulator',
description: 'audio variable to store the maximum value',
type: 'performance'
},
{
name: 'aInput',
description: 'signal that aAccumulator is compared to',
type: 'performance'
},
],
seeAlso: ['Comparators and Accumulators']
},
{
name: 'maxaccum',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Accumulates the maximum value of audio signals.',
syntax: 'maxaccum(aAccumulator, aInput)',
example: '--8<-- "examples/maxaccum.csd"',
parameters: [
{
name: 'aAccumulator',
description: 'audio variable to store the maximum value',
type: 'performance'
},
{
name: 'aInput',
description: 'signal that aAccumulator is compared to',
type: 'performance'
},
],
seeAlso: ['Comparators and Accumulators']
},
{
name: 'min',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Produces a signal that is the minimum of any number of input signals.',
syntax: 'amin = min(ain1, ain2 [, ain3] [, ain4] [...])\n kmin = min(kin1, kin2 [, kin3] [, kin4] [...])\n imin = min(iin1, iin2 [, iin3] [, iin4] [...])',
example: '--8<-- "examples/min.csd"',
seeAlso: ['Comparators and Accumulators']
},
{
name: 'minabs',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Produces a signal that is the minimum of the absolute values of any number of input signals.',
syntax: 'amin = minabs(ain1, ain2 [, ain3] [, ain4] [...])\n kmin = minabs(kin1, kin2 [, kin3] [, kin4] [...])',
example: '--8<-- "examples/minabs.csd"',
seeAlso: ['Comparators and Accumulators']
},
{
name: 'minabsaccum',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Accumulates the minimum of the absolute values of audio signals.',
syntax: 'minabsaccum(aAccumulator, aInput)',
example: '--8<-- "examples/minabsaccum.csd"',
parameters: [
{
name: 'aAccumulator',
description: 'audio variable to store the minimum value',
type: 'performance'
},
{
name: 'aInput',
description: 'signal that aAccumulator is compared to',
type: 'performance'
},
],
seeAlso: ['Comparators and Accumulators']
},
{
name: 'minaccum',
type: 'opcode',
category: 'Signal Modifiers:Comparators and Accumulators',
description: 'Accumulates the minimum value of audio signals.',
syntax: 'minaccum(aAccumulator, aInput)',
example: '--8<-- "examples/minaccum.csd"',
parameters: [
{
name: 'aAccumulator',
description: 'audio variable to store the minimum value',
type: 'performance'
},
{
name: 'aInput',
description: 'signal that aAccumulator is compared to',
type: 'performance'
},
],
seeAlso: ['Comparators and Accumulators']
},
]

View File

@ -0,0 +1,211 @@
import type { CsoundReference } from './types'
// Signal Modifiers:Convolution and Morphing
export const signalModifiersConvolutionAndMorphing: CsoundReference[] = [
{
name: 'convle',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'Same as the [convolve](../opcodes/convolve.md) opcode.',
},
{
name: 'convolve',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'Convolves a signal and an impulse response.',
syntax: 'ar1 [, ar2] [, ar3] [, ar4] = convolve(ain, ifilcod [, ichannel])',
example: 'csound -Ucvanal l1_44.wav l1_44.cv',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting an impulse response data file. An integer denotes the suffix of a file _convolve.m_; a character string (in double quotes) gives a filename, optionally a full pathname. If not a fullpath, the file is sought first in the current directory, then in the one given by the environment variable SADIR (if defined). The data file contains the Fourier transform of an impulse response. Memory usage depends on the size of the data file, which is read and held entirely in memory during computation, but which is shared by multiple calls.',
type: 'initialization'
},
{
name: 'ain',
description: 'input audio signal.',
type: 'performance'
},
],
seeAlso: ['Convolution and Morphing']
},
{
name: 'cross2',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'Cross synthesis using FFT\'s.',
syntax: 'ares = cross2(ain1, ain2, isize, ioverlap, iwin, kbias)',
example: '--8<-- "examples/cross2.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'isize',
description: 'This is the size of the FFT to be performed. The larger the size the better the frequency response but a sloppy time response.',
type: 'initialization'
},
{
name: 'ioverlap',
description: 'This is the overlap factor of the FFT\'s, must be a power of two. The best settings are 2 and 4. A big overlap takes a long time to compile.',
type: 'initialization'
},
{
name: 'iwin',
description: 'This is the function table that contains the window to be used in the analysis. One can use the [GEN20](../scoregens/gen20.md) routine to create this window.',
type: 'initialization'
},
{
name: 'ain1',
description: 'The stimulus sound. Must have high frequencies for best results.',
type: 'performance'
},
{
name: 'ain2',
description: 'The modulating sound. Must have a moving frequency response (like speech) for best results.',
type: 'performance'
},
{
name: 'kbias',
description: 'The amount of cross synthesis. 1 is the normal, 0 is no cross synthesis.',
type: 'performance'
},
],
seeAlso: ['Convolution and Morphing']
},
{
name: 'dconv',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'A direct convolution opcode.',
syntax: 'ares = dconv(asig, isize, ifn)',
example: '--8<-- "examples/dconv.csd"',
rates: ['a-rate', 'i-rate'],
parameters: [
{
name: 'isize',
description: 'the size of the convolution buffer to use. If the buffer size is smaller than the size of _ifn_, then only the first _isize_ values will be used from the table.',
type: 'initialization'
},
{
name: 'ifn',
description: 'table number of a stored function containing the impulse response for convolution.',
type: 'initialization'
},
],
seeAlso: ['Convolution and Morphing']
},
{
name: 'ftconv',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'Low latency multichannel convolution, using a function table as impulse response source.',
syntax: 'a1[, a2[, a3[, ... a8]]] = ftconv(ain, ift, iplen[, iskipsamples \\\n [, iirlen[, iskipinit]]])',
example: '--8<-- "examples/ftconv.csd"',
parameters: [
{
name: 'ift',
description: 'source ftable number. The table is expected to contain interleaved multichannel audio data, with the number of channels equal to the number of output variables (a1, a2, etc.). An interleaved table can be created from a set of mono tables with [GEN52](../scoregens/gen52.md).',
type: 'initialization'
},
{
name: 'iplen',
description: 'length of impulse response partitions, in sample frames; must be an integer power of two. Lower settings allow for shorter output delay, but will increase CPU usage.',
type: 'initialization'
},
{
name: 'ain',
description: 'input signal.',
type: 'performance'
},
],
seeAlso: ['Convolution and Morphing']
},
{
name: 'ftmorf',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'Uses an index into a table of ftable numbers to morph between adjacent tables in the list. This morphed function is written into the table referenced by _iresfn_ on every k-cycle.',
syntax: 'ftmorf(kftndx, iftfn, iresfn)',
example: '--8<-- "examples/ftmorf.csd"',
parameters: [
{
name: 'iftfn',
description: 'The table containing the numbers of any existing tables which are used for the morphing.',
type: 'initialization'
},
{
name: 'iresfn',
description: 'Table number of the morphed function',
type: 'initialization'
},
{
name: 'kftndx',
description: 'the index into the _iftfn_ table.',
type: 'performance'
},
],
seeAlso: ['Convolution and Morphing', 'Read/Write Operations']
},
{
name: 'liveconv',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'Partitioned convolution with dynamically reloadable impulse response.',
syntax: 'ares = liveconv(ain, ift, iplen, kupdate, kclear)',
example: '--8<-- "examples/liveconv.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ift',
description: 'table number for storing the impulse response (IR) for convolution. The table may be filled with new data at any time while the convolution is running.',
type: 'initialization'
},
{
name: 'iplen',
description: 'length of impulse response partition in samples; must be an integer power of two. Lower settings allow for shorter output delay, but will increase CPU usage.',
type: 'initialization'
},
{
name: 'ain',
description: 'input signal.',
type: 'performance'
},
{
name: 'ares',
description: 'output signal.',
type: 'performance'
},
{
name: 'kupdate',
description: 'flag indicating whether the IR table should be updated. If kupdate=1 the IR table ift is loaded partition by partition, starting with the next partition. If kupdate=-1 the IR table ift is unloaded (cleared to zero) partition by partition, starting with the next partition. Other values have no effect.',
type: 'performance'
},
{
name: 'kclear',
description: 'flag for clearing all internal buffers. If kclear has any value != zero, the internal buffers are cleared immediately. This operation is not free of artifacts.',
type: 'performance'
},
],
seeAlso: ['Convolution and Morphing']
},
{
name: 'pconvolve',
type: 'opcode',
category: 'Signal Modifiers:Convolution and Morphing',
description: 'Convolution based on a uniformly partitioned overlap-save algorithm.',
syntax: 'ar1 [, ar2 [, ar3 [, ar4]]] = pconvolve(ain, ifilcod [, ipartitionsize [, ichannel]])',
example: '--8<-- "examples/pconvolve.csd"',
parameters: [
{
name: 'ifilcod',
description: 'integer or character-string denoting an impulse response soundfile. Multichannel files are supported, the file must have the same sample-rate as the orc. [Note: _cvanal_ files cannot be used!] Keep in mind that longer files require more calculation time [and probably larger partition sizes and more latency]. At current processor speeds, files longer than a few seconds may not render in real-time.',
type: 'initialization'
},
{
name: 'ain',
description: 'input audio signal.',
type: 'performance'
},
],
seeAlso: ['Convolution and Morphing']
},
]

View File

@ -0,0 +1,235 @@
import type { CsoundReference } from './types'
// Signal Modifiers:Delay
export const signalModifiersDelay: CsoundReference[] = [
{
name: 'delay',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Delays an input signal by some time interval.',
syntax: 'ares = delay(asig, idlt [, iskip])',
example: '--8<-- "examples/delay.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'idlt',
description: 'requested delay time in seconds. This can be as large as available memory will permit. The space required for n seconds of delay is 4n * _sr_ bytes. It is allocated at the time the instrument is first initialized, and returned to the pool at the end of a score section.',
type: 'initialization'
},
{
name: 'asig',
description: 'audio signal',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'delay1',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Delays an input signal by one sample.',
syntax: 'ares = delay1(asig [, iskip])',
example: '--8<-- "examples/delay1.csd"',
rates: ['a-rate'],
seeAlso: ['Delay']
},
{
name: 'delayk',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Delays an input signal by some time interval.',
syntax: 'kr = delayk(ksig, idel[, imode])\n kr = vdel_k(ksig, kdel, imdel[, imode])',
example: '--8<-- "examples/delayk.csd"',
parameters: [
{
name: 'idel',
description: 'delay time (in seconds) for delayk. It is rounded to the nearest integer multiple of a k-cycle (i.e. 1/kr).',
type: 'initialization'
},
{
name: 'imode',
description: 'sum of 1 for skipping initialization (e.g. in tied notes) and 2 for holding the first input value during the initial delay, instead of outputting zero. This is mainly of use when delaying envelopes that do not start at zero.',
type: 'initialization'
},
{
name: 'imdel',
description: 'maximum delay time for vdel_k, in seconds.',
type: 'initialization'
},
{
name: 'kr',
description: 'the output signal. Note: neither of the opcodes interpolate the output.',
type: 'performance'
},
{
name: 'ksig',
description: 'the input signal.',
type: 'performance'
},
{
name: 'kdel',
description: 'delay time (in seconds) for vdel_k. It is rounded to the nearest integer multiple of a k-cycle (i.e. 1/kr).',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'delayr',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Reads from an automatically established digital delay line.',
syntax: 'ares = delayr(idlt [, iskip])',
example: '--8<-- "examples/delayr.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'idlt',
description: 'requested delay time in seconds. This can be as large as available memory will permit. The space required for n seconds of delay is 4n * _sr_ bytes. It is allocated at the time the instrument is first initialized, and returned to the pool at the end of a score section.',
type: 'initialization'
},
],
seeAlso: ['Delay']
},
{
name: 'delayw',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Writes the audio signal to a digital delay line.',
syntax: 'delayw(asig)',
example: '--8<-- "examples/delayw.csd"',
rates: ['a-rate'],
seeAlso: ['Delay']
},
{
name: 'deltap',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Taps a delay line at variable offset times.',
syntax: 'ares = deltap(kdlt)',
example: 'asource buzz 1, 440, 20, 1\n atime linseg 1, p3/2,.01, p3/2,1 ; trace a distance in secs\n ampfac = 1/atime/atime ; and calc an amp factor\n adump delayr 1 ; set maximum distance\n amove deltapi atime ; move sound source past\n delayw asource ; the listener\n out amove * ampfac',
rates: ['a-rate'],
parameters: [
{
name: 'kdlt',
description: 'specifies the tapped delay time in seconds. Each can range from 1 control period to the full delay time of the read/write pair; however, since there is no internal check for adherence to this range, the user is wholly responsible. Each argument can be a constant, a variable, or a time-varying signal.',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'deltap3',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Taps a delay line at variable offset times, uses cubic interpolation.',
syntax: 'ares = deltap3(xdlt)',
example: 'asource buzz 1, 440, 20, 1\natime linseg 1, p3/2,.01, p3/2,1 ; trace a distance in secs\nampfac = 1/atime/atime ; and calc an amp factor\nadump delayr 1 ; set maximum distance\namove deltapi atime ; move sound source past\n delayw asource ; the listener\n out amove * ampfac',
rates: ['a-rate'],
parameters: [
{
name: 'xdlt',
description: 'specifies the tapped delay time in seconds. Each can range from 1 control period to the full delay time of the read/write pair; however, since there is no internal check for adherence to this range, the user is wholly responsible. Each argument can be a constant, a variable, or a time-varying signal; the _xdlt_ argument in _deltap3_ implies that an audio-varying delay is permitted there.',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'deltapi',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Taps a delay line at variable offset times, uses interpolation.',
syntax: 'ares = deltapi(xdlt)',
example: 'asource buzz 1, 440, 20, 1\natime linseg 1, p3/2,.01, p3/2,1 ; trace a distance in secs\nampfac = 1/atime/atime ; and calc an amp factor\nadump delayr 1 ; set maximum distance\namove deltapi atime ; move sound source past\n delayw asource ; the listener\n out amove * ampfac',
rates: ['a-rate'],
parameters: [
{
name: 'xdlt',
description: 'specifies the tapped delay time in seconds. Each can range from 1 control period to the full delay time of the read/write pair; however, since there is no internal check for adherence to this range, the user is wholly responsible. Each argument can be a constant, a variable, or a time-varying signal; the _xdlt_ argument in _deltapi_ implies that an audio-varying delay is permitted there.',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'deltapn',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Taps a delay line at variable offset times.',
syntax: 'ares = deltapn(xnumsamps)',
example: '--8<-- "examples/deltapn.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'xnumsamps',
description: 'specifies the tapped delay time in number of samples. Each can range from 1 control period to the full delay time of the read/write pair; however, since there is no internal check for adherence to this range, the user is wholly responsible. Each argument can be a constant, a variable, or a time-varying signal.',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'deltapx',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Read from or write to a delay line with interpolation.',
syntax: 'aout = deltapx(adel, iwsize)',
example: '--8<-- "examples/deltapx.csd"',
parameters: [
{
name: 'iwsize',
description: 'interpolation window size in samples. Allowed values are integer multiplies of 4 in the range 4 to 1024. _iwsize_ = 4 uses cubic interpolation. Increasing _iwsize_ improves sound quality at the expense of CPU usage, and minimum delay time.',
type: 'initialization'
},
{
name: 'aout',
description: 'Output signal.',
type: 'performance'
},
{
name: 'adel',
description: 'Delay time in seconds.',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'deltapxw',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Mixes the input signal to a delay line.',
syntax: 'deltapxw(ain, adel, iwsize)',
example: '--8<-- "examples/deltapxw.csd"',
parameters: [
{
name: 'iwsize',
description: 'interpolation window size in samples. Allowed values are integer multiplies of 4 in the range 4 to 1024. _iwsize_ = 4 uses cubic interpolation. Increasing _iwsize_ improves sound quality at the expense of CPU usage, and minimum delay time.',
type: 'initialization'
},
{
name: 'ain',
description: 'Input signal.',
type: 'performance'
},
{
name: 'adel',
description: 'Delay time in seconds.',
type: 'performance'
},
],
seeAlso: ['Delay']
},
{
name: 'multitap',
type: 'opcode',
category: 'Signal Modifiers:Delay',
description: 'Multitap delay line implementation.',
syntax: 'ares = multitap(asig [, itime1, igain1] [, itime2, igain2] [...])',
example: '--8<-- "examples/multitap.csd"',
rates: ['a-rate'],
seeAlso: ['Delay']
},
]

View File

@ -0,0 +1,865 @@
import type { CsoundReference } from './types'
// Signal Modifiers:Panning and Spatialization
export const signalModifiersPanningAndSpatialization: CsoundReference[] = [
{
name: 'bformdec1',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Decodes an ambisonic B format signal into loudspeaker specific signals.',
syntax: 'ao1, ao2 = bformdec1(isetup, aw, ax, ay, az [, ar, as, at, au, av \\\n [, abk, al, am, an, ao, ap, aq]])\n ao1, ao2, ao3, ao4 = bformdec1(isetup, aw, ax, ay, az [, ar, as, at, au, av \\\n [, abk, al, am, an, ao, ap, aq]])\n ao1, ao2, ao3, ao4, ao5 = bformdec1(isetup, aw, ax, ay, az [, ar, as, at, au, av \\\n [, abk, al, am, an, ao, ap, aq]])\n ao1, ao2, ao3, ao4, ao5, ao6, ao7, ao8 = bformdec1(isetup, aw, ax, ay, az \\\n [, ar, as, at, au, av [, abk, al, am, an, ao, ap, aq]])\n aout[] = bformdec1(isetup, abform[])',
example: '--8<-- "examples/bformenc1-modern.csd"',
parameters: [
{
name: 'isetup',
description: 'loudspeaker setup. There are five supported setups:',
type: 'initialization'
},
],
seeAlso: ['Panning and Spatialization: Ambisonics']
},
{
name: 'bformdec2',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Decodes an Ambisonics B format signal into loudspeaker specific signals, with dual--band decoding and near--field compensation.',
syntax: 'aout[] = bformdec2(isetup, abform[], [idecoder, idistance, ifreq, imix, \\\n ifilel, ifiler])',
parameters: [
{
name: 'isetup',
description: 'loudspeaker setup. There are currently 8 supported setups, the first five are backwards compatible with [bformdec1](../opcodes/bformdec1.md):',
type: 'initialization'
},
{
name: 'idecoder',
description: 'optional (default 0), select the type of decoder',
type: 'initialization'
},
{
name: 'idistance',
description: 'optional (default 1 meter), select the distance (in meters) to the loudspeaker (radius if regular configuration)',
type: 'initialization'
},
{
name: 'ifreq',
description: 'optional (default 400 Hz), frequency cut (Hz) of the band splitting filter (only has an effect if _idecoder_=0)*',
type: 'initialization'
},
{
name: 'imix',
description: 'optional (default 0), type of mix of the velocity and energy decoders\' outputs',
type: 'initialization'
},
{
name: 'ifilel',
description: 'left HRTF spectral data file',
type: 'initialization'
},
{
name: 'ifiler',
description: 'right HRTF spectral data file',
type: 'initialization'
},
{
name: 'abform',
description: 'input signal array in the B format',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Ambisonics']
},
{
name: 'bformenc1',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Codes a signal into the ambisonic B format.',
syntax: 'aw, ax, ay, az = bformenc1(asig, kalpha, kbeta)\n aw, ax, ay, az, ar, as, at, au, av = bformenc1(asig, kalpha, kbeta)\n aw, ax, ay, az, ar, as, at, au, av, ak, al, am, an, ao, ap, aq = bformenc1(\\\n asig, kalpha, kbeta)\n aarray[] = bformenc1(asig, kalpha, kbeta)',
example: '--8<-- "examples/bformenc1-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'aarray',
description: 'output array to hold cells of the B format.',
type: 'performance'
},
{
name: 'asig',
description: 'input signal.',
type: 'performance'
},
{
name: 'kalpha',
description: 'azimuth angle in degrees (anticlockwise).',
type: 'performance'
},
{
name: 'kbeta',
description: 'altitude angle in degrees.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Ambisonics']
},
{
name: 'hrtfearly',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Generates 3D binaural audio with high-fidelity early reflections in a parametric room using a Phase Truncation algorithm.',
syntax: 'aleft, aright, irt60low, irt60high, imfp = hrtfearly(asrc, ksrcx, ksrcy, ksrcz, \\\n klstnrx, klstnry, klstnrz, ifilel, ifiler, idefroom [,ifade, isr, iorder, \\\n ithreed, kheadrot, iroomx, iroomy, iroomz, iwallhigh, iwalllow, \\\n iwallgain1, iwallgain2, iwallgain3, ifloorhigh, ifloorlow, ifloorgain1, \\\n ifloorgain2, ifloorgain3, iceilinghigh, iceilinglow, iceilinggain1, \\\n iceilinggain2, iceilinggain3])',
example: '--8<-- "examples/hrtfearly.csd"',
parameters: [
{
name: 'ifilel',
description: 'left HRTF spectral data file.',
type: 'initialization'
},
{
name: 'ifiler',
description: 'right HRTF spectral data file.',
type: 'initialization'
},
{
name: 'idefroom',
description: 'default room, medium (1: 10*10*3), small (2: 3*4*3) or large (3: 20*25*7). Wall details (high coef, low coef, gain1, gain2, gain3): .3, .1, .75, .95, .9. Floor: .6, .1, .95, .6, .35. Ceiling: .2, .1, 1, 1, 1. If 0 is entered, optional room parameters will be read.',
type: 'initialization'
},
{
name: 'ifade',
description: 'optional, number of processing buffers for phase change crossfade (default 8). Legal range is 1-24. See [hrtfmove](../opcodes/hrtfmove.md).',
type: 'initialization'
},
{
name: 'isr',
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
type: 'initialization'
},
{
name: 'iorder',
description: 'optional, order of images processed: higher order: more reflections. Defaults to 1, legal range: 0-4.',
type: 'initialization'
},
{
name: 'ithreed',
description: 'optional, process image sources in three dimensions (1) or two (0: default).',
type: 'initialization'
},
{
name: 'iroomx',
description: 'optional, x room size in metres, will be read if no valid default room is entered (all below parameters behave similarly). Minimum room size is 2\\*2\\*2.',
type: 'initialization'
},
{
name: 'iroomy',
description: 'optional, y room size.',
type: 'initialization'
},
{
name: 'iroomz',
description: 'optional, z room size.',
type: 'initialization'
},
{
name: 'iwallhigh',
description: 'optional, high frequency wall absorption coefficient (all 4 walls are assumed identical). Absorption coefficients will affect reverb time output.',
type: 'initialization'
},
{
name: 'iwalllow',
description: 'optional, low frequency wall absorption coefficient.',
type: 'initialization'
},
{
name: 'iwallgain1',
description: 'optional, gain on filter centred at 250 Hz (all filters have a Q implying 4 octaves).',
type: 'initialization'
},
{
name: 'iwallgain2',
description: 'optional, as above, centred on 1000 Hz.',
type: 'initialization'
},
{
name: 'iwallgain3',
description: 'optional, as above, centred on 4000 Hz.',
type: 'initialization'
},
{
name: 'ifloorhigh',
description: 'as above for floor.',
type: 'initialization'
},
{
name: 'ifloorlow',
description: 'as above for floor.',
type: 'initialization'
},
{
name: 'ifloorgain1',
description: 'as above for floor.',
type: 'initialization'
},
{
name: 'ifloorgain2',
description: 'as above for floor.',
type: 'initialization'
},
{
name: 'ifloorgain3',
description: 'as above for floor.',
type: 'initialization'
},
{
name: 'iceilinghigh',
description: 'as above for ceiling.',
type: 'initialization'
},
{
name: 'iceilinglow',
description: 'as above for ceiling.',
type: 'initialization'
},
{
name: 'iceilinggain1',
description: 'as above for ceiling.',
type: 'initialization'
},
{
name: 'iceilinggain2',
description: 'as above for ceiling.',
type: 'initialization'
},
{
name: 'iceilinggain3',
description: 'as above for ceiling.',
type: 'initialization'
},
{
name: 'kheadrot',
description: 'optional, angular value for head rotation.',
type: 'performance'
},
{
name: 'asrc',
description: 'Input/source signal.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Binaural spatialization']
},
{
name: 'hrtfer',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Creates 3D audio for two speakers. Output is binaural (headphone) 3D audio.',
syntax: 'aleft, aright = hrtfer(asig, kaz, kelev, "HRTFcompact")',
example: '--8<-- "examples/hrtfer.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'kAz',
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
type: 'initialization'
},
{
name: 'kElev',
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions under horizontal.',
type: 'initialization'
},
],
seeAlso: ['Panning and Spatialization: Binaural spatialization']
},
{
name: 'hrtfmove',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Generates dynamic 3d binaural audio for headphones using magnitude interpolation and phase truncation.',
syntax: 'aleft, aright = hrtfmove(asrc, kAz, kElev, ifilel, ifiler [, imode, ifade, isr])',
example: '--8<-- "examples/hrtfmove.csd"',
parameters: [
{
name: 'ifilel',
description: 'left HRTF spectral data file',
type: 'initialization'
},
{
name: 'ifiler',
description: 'right HRTF spectral data file',
type: 'initialization'
},
{
name: 'imode',
description: 'optional, default 0 for phase truncation, 1 for minimum phase',
type: 'initialization'
},
{
name: 'ifade',
description: 'optional, number of processing buffers for phase change crossfade (default 8). Legal range is 1-24. A low value is recommended for complex sources (4 or less: a higher value may make the crossfade audible), a higher value (8 or more: a lower value may make the inconsistency when the filter changes phase values audible) for narrowband sources. Does not effect minimum phase processing.',
type: 'initialization'
},
{
name: 'isr',
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
type: 'initialization'
},
{
name: 'kAz',
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
type: 'performance'
},
{
name: 'kElev',
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Binaural spatialization', 'http://www.csoundjournal.com/issue9/newHRTFOpcodes.html']
},
{
name: 'hrtfmove2',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Generates dynamic 3d binaural audio for headphones using a Woodworth based spherical head model with improved low frequency phase accuracy.',
syntax: 'aleft, aright = hrtfmove2(asrc, kAz, kElev, ifilel, ifiler [,ioverlap, iradius, isr])',
example: '--8<-- "examples/hrtfmove2.csd"',
parameters: [
{
name: 'ifilel',
description: 'left HRTF spectral data file',
type: 'initialization'
},
{
name: 'ifiler',
description: 'right HRTF spectral data file',
type: 'initialization'
},
{
name: 'ioverlap',
description: 'optional, number of overlaps for STFT processing (default 4). See STFT section of manual.',
type: 'initialization'
},
{
name: 'iradius',
description: 'optional, head radius used for phase spectra calculation in centimeters (default 9.0)',
type: 'initialization'
},
{
name: 'isr',
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
type: 'initialization'
},
{
name: 'asrc',
description: 'Input/source signal.',
type: 'performance'
},
{
name: 'kAz',
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
type: 'performance'
},
{
name: 'kElev',
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Binaural spatialization', 'http://www.csoundjournal.com/issue9/newHRTFOpcodes.html']
},
{
name: 'hrtfreverb',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'A binaural, dynamic FDN based diffuse-field reverberator. The opcode works independently as an efficient, flexible reverberator.',
syntax: 'aleft, aright, idel = hrtfreverb(asrc, ilowrt60, ihighrt60, ifilel, ifiler \\\n [,isr, imfp, iorder])',
example: '--8<-- "examples/hrtfearly.csd"',
parameters: [
{
name: 'ilowrt60',
description: 'low frequency reverb time.',
type: 'initialization'
},
{
name: 'ihighrt60',
description: 'high frequency reverb time.',
type: 'initialization'
},
{
name: 'ifilel',
description: 'left HRTF spectral data file.',
type: 'initialization'
},
{
name: 'ifiler',
description: 'right HRTF spectral data file.',
type: 'initialization'
},
{
name: 'isr',
description: 'optional, default 44.1kHz, legal values: 44100, 48000 and 96000.',
type: 'initialization'
},
{
name: 'imfp',
description: 'optional, mean free path, defaults to that of a medium room. If used with [hrtfearly](../opcodes/hrtfearly.md), the mean free path of the room can be used to calculate the appropriate delay for the later reverb. Legal range: the mean free path of the smallest room allowed by hrtfearly (0.003876) 1.',
type: 'initialization'
},
{
name: 'iorder',
description: 'optional, order of early reflection processing. If used with [hrtfearly](../opcodes/hrtfearly.md), the order of early reflections can be used to calculate the appropriate delay on the later reverb.',
type: 'initialization'
},
{
name: 'asrc',
description: 'Input/source signal.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Binaural spatialization']
},
{
name: 'hrtfstat',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Generates static 3d binaural audio for headphones using a Woodworth based spherical head model with improved low frequency phase accuracy.',
syntax: 'aleft, aright = hrtfstat(asrc, iAz, iElev, ifilel, ifiler [,iradius, isr])',
example: '--8<-- "examples/hrtfstat.csd"',
parameters: [
{
name: 'iAz',
description: 'azimuth value in degrees. Positive values represent position on the right, negative values are positions on the left.',
type: 'initialization'
},
{
name: 'iElev',
description: 'elevation value in degrees. Positive values represent position above horizontal, negative values are positions below horizontal (min -40).',
type: 'initialization'
},
{
name: 'ifilel',
description: 'left HRTF spectral data file',
type: 'initialization'
},
{
name: 'ifiler',
description: 'right HRTF spectral data file',
type: 'initialization'
},
{
name: 'iradius',
description: 'optional, head radius used for phase spectra calculation in centimeters (default 9.0)',
type: 'initialization'
},
{
name: 'isr',
description: 'optional (default 44.1kHz). Legal values are 44100, 48000 and 96000.',
type: 'initialization'
},
],
seeAlso: ['Panning and Spatialization: Binaural spatialization', 'http://www.csoundjournal.com/issue9/newHRTFOpcodes.html']
},
{
name: 'locsend',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Distributes the audio signals of a previous [locsig](../opcodes/locsig.md) opcode.',
syntax: 'a1, a2 = locsend()\n a1, a2, a3, a4 = locsend()',
example: 'asig some audio signal\n kdegree line 0, p3, 360\n kdistance line 1, p3, 10\n a1, a2, a3, a4 locsig asig, kdegree, kdistance, .1\n ar1, ar2, ar3, ar4 locsend\n ga1 = ga1+ar1\n ga2 = ga2+ar2\n ga3 = ga3+ar3\n ga4 = ga4+ar4\n outq a1, a2, a3, a4\nendin\n\ninstr 99 ; reverb instrument\n a1 reverb2 ga1, 2.5, .5\n a2 reverb2 ga2, 2.5, .5\n a3 reverb2 ga3, 2.5, .5\n a4 reverb2 ga4, 2.5, .5\n outq a1, a2, a3, a4\n ga1=0\n ga2=0\n ga3=0\n ga4=0',
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'locsig',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Takes an input signal and distributes between 2 or 4 channels.',
syntax: 'a1, a2 = locsig(asig, kdegree, kdistance, kreverbsend)\n a1, a2, a3, a4 = locsig(asig, kdegree, kdistance, kreverbsend)',
example: '--8<-- "examples/locsig_quad.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'kdegree',
description: 'value between 0 and 360 for placement of the signal in a 2 or 4 channel space configured as: a1=0, a2=90, a3=180, a4=270 (kdegree=45 would balanced the signal equally between a1 and a2). _locsig_ maps _kdegree_ to sin and cos functions to derive the signal balances (e.g.: asig=1, kdegree=45, a1=a2=.707).',
type: 'performance'
},
{
name: 'kdistance',
description: 'value &gt;= 1 used to attenuate the signal and to calculate reverb level to simulate distance cues. As _kdistance_ gets larger the sound should get softer and somewhat more reverberant (assuming the use of _locsend_ in this case).',
type: 'performance'
},
{
name: 'kreverbsend',
description: 'the percentage of the direct signal that will be factored along with the distance and degree values to derive signal amounts that can be sent to a reverb unit such as _reverb_, or _reverb2_.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'ms2st',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Mid-Side to stereo Conversion with a width control.',
syntax: 'aleft,aright = ms2st(am, as, kwidth)',
example: '--8<-- "examples/ms2st.csd"',
parameters: [
{
name: 'aleft',
description: 'left channel output.',
type: 'performance'
},
{
name: 'aright',
description: 'right channel output.',
type: 'performance'
},
{
name: 'am',
description: 'mid signal input.',
type: 'performance'
},
{
name: 'as',
description: 'side signal input.',
type: 'performance'
},
{
name: 'kwidth',
description: 'stereo width (0 to 1). At 0, no side signal is output, and at 1 no mid signal is present. A value of 0.5 restores a stereo to MS conversion (st2ms) exactly.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'pan',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Distribute an audio signal amongst four channels with localization control.',
syntax: 'a1, a2, a3, a4 = pan(asig, kx, ky, ifn [, imode] [, ioffset])',
example: '--8<-- "examples/pan.csd"',
rates: ['a-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: 'function table number of a stored pattern describing the amplitude growth in a speaker channel as sound moves towards it from an adjacent speaker. Requires extended guard-point.',
type: 'initialization'
},
],
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'pan2',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Distribute an audio signal across two channels with a choice of methods.',
syntax: 'a1, a2 = pan2(asig, xp [, imode])\n aouts[] = pan2(asig, xp [, imode])',
example: '--8<-- "examples/pan2.csd"',
rates: ['a-rate'],
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'space',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Distributes an input signal among 4 channels using cartesian coordinates.',
syntax: 'a1, a2, a3, a4 = space(asig, ifn, ktime, kreverbsend, kx, ky)',
example: '--8<-- "examples/space_quad.csd"',
rates: ['a-rate', 'i-rate'],
parameters: [
{
name: 'ifn',
description: 'number of the stored function created using [Gen28](../scoregens/gen28.md). This function generator reads a text file which contains sets of three values representing the xy coordinates and a time-tag for when the signal should be placed at that location. The file should look like:',
type: 'initialization'
},
{
name: 'asig',
description: 'input audio signal.',
type: 'performance'
},
{
name: 'ktime',
description: 'index into the table containing the xy coordinates. If used like:',
type: 'performance'
},
{
name: 'kreverbsend',
description: 'the percentage of the direct signal that will be factored along with the distance as derived from the xy coordinates to calculate signal amounts that can be sent to reverb units such as _reverb_, or _reverb2_.',
type: 'performance'
},
{
name: 'kx',
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the xy coordinates to localize the signal.',
type: 'performance'
},
{
name: 'ky',
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the xy coordinates to localize the signal.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'spat3d',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Positions the input sound in a 3D space and allows moving the sound at k-rate.',
syntax: 'aW, aX, aY, aZ = spat3d(ain, kX, kY, kZ, idist, ift, imode, imdel, iovr [, istor])',
example: '--8<-- "examples/spat3d_stereo.csd"',
parameters: [
{
name: 'idist',
description: 'For modes 0 to 3, _idist_ is the unit circle distance in meters. For mode 4, _idist_ is the distance between microphones.',
type: 'initialization'
},
{
name: 'ift',
description: 'Function table storing room parameters (for free field spatialization, set it to zero or negative). Table size is 54. The values in the table are:',
type: 'initialization'
},
{
name: 'imode',
description: 'Output mode',
type: 'initialization'
},
{
name: 'imdel',
description: 'Maximum delay time for spat3d in seconds. This has to be longer than the delay time of the latest reflection (depends on room dimensions, sound source distance, and recursion depth; using this formula gives a safe (although somewhat overestimated) value:',
type: 'initialization'
},
{
name: 'iovr',
description: 'Oversample ratio for spat3d (1 to 8). Setting it higher improves quality at the expense of memory and CPU usage. The recommended value is 2.',
type: 'initialization'
},
{
name: 'aW',
description: 'Output signals',
type: 'performance'
},
{
name: 'aX',
description: 'Output signals',
type: 'performance'
},
{
name: 'aY',
description: 'Output signals',
type: 'performance'
},
{
name: 'aZ',
description: 'Output signals',
type: 'performance'
},
{
name: 'ain',
description: 'Input signal',
type: 'performance'
},
{
name: 'kX',
description: 'Sound source coordinates (in meters)',
type: 'performance'
},
{
name: 'kY',
description: 'Sound source coordinates (in meters)',
type: 'performance'
},
{
name: 'kZ',
description: 'Sound source coordinates (in meters)',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Simulation of room acoustics']
},
{
name: 'spat3di',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Positions the input sound in a 3D space with the sound source position set at i-time.',
syntax: 'aW, aX, aY, aZ = spat3di(ain, iX, iY, iZ, idist, ift, imode [, istor])',
parameters: [
{
name: 'iX',
description: 'Sound source X coordinate in meters (positive: right, negative: left)',
type: 'initialization'
},
{
name: 'iY',
description: 'Sound source Y coordinate in meters (positive: front, negative: back)',
type: 'initialization'
},
{
name: 'iZ',
description: 'Sound source Z coordinate in meters (positive: up, negative: down)',
type: 'initialization'
},
{
name: 'idist',
description: 'For modes 0 to 3, _idist_ is the unit circle distance in meters. For mode 4, _idist_ is the distance between microphones.',
type: 'initialization'
},
{
name: 'ift',
description: 'Function table storing room parameters (for free field spatialization, set it to zero or negative). Table size is 54. The values in the table are:',
type: 'initialization'
},
{
name: 'imode',
description: 'Output mode',
type: 'initialization'
},
{
name: 'ain',
description: 'Input signal',
type: 'performance'
},
{
name: 'aW',
description: 'Output signals',
type: 'performance'
},
{
name: 'aX',
description: 'Output signals',
type: 'performance'
},
{
name: 'aY',
description: 'Output signals',
type: 'performance'
},
{
name: 'aZ',
description: 'Output signals',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Simulation of room acoustics']
},
{
name: 'spat3dt',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Can be used to render an impulse response for a 3D space at i-time.',
syntax: 'spat3dt(ioutft, iX, iY, iZ, idist, ift, imode, irlen [, iftnocl])',
example: '--8<-- "examples/spat3dt.csd"',
parameters: [
{
name: 'ioutft',
description: 'Output ftable number for spat3dt. W, X, Y, and Z outputs are written interleaved to this table. If the table is too short, output will be truncated.',
type: 'initialization'
},
{
name: 'iX',
description: 'Sound source X coordinate in meters (positive: right, negative: left)',
type: 'initialization'
},
{
name: 'iY',
description: 'Sound source Y coordinate in meters (positive: front, negative: back)',
type: 'initialization'
},
{
name: 'iZ',
description: 'Sound source Z coordinate in meters (positive: up, negative: down)',
type: 'initialization'
},
{
name: 'idist',
description: 'For modes 0 to 3, _idist_ is the unit circle distance in meters. For mode 4, _idist_ is the distance between microphones.',
type: 'initialization'
},
{
name: 'ift',
description: 'Function table storing room parameters (for free field spatialization, set it to zero or negative). Table size is 54. The values in the table are:',
type: 'initialization'
},
{
name: 'imode',
description: 'Output mode',
type: 'initialization'
},
{
name: 'irlen',
description: 'Impulse response length of echoes (in seconds). Depending on filter parameters, values around 0.005-0.01 are suitable for most uses (higher values result in more accurate output, but slower rendering)',
type: 'initialization'
},
],
seeAlso: ['Panning and Spatialization: Simulation of room acoustics']
},
{
name: 'spdist',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Calculates distance values from xy coordinates.',
syntax: 'k1 = spdist(ifn, ktime, kx, ky)',
example: '--8<-- "examples/spdist.csd"',
rates: ['i-rate'],
parameters: [
{
name: 'ifn',
description: 'number of the stored function created using [Gen28](../scoregens/gen28.md). This function generator reads a text file which contains sets of three values representing the xy coordinates and a time-tag for when the signal should be placed at that location. The file should look like:',
type: 'initialization'
},
{
name: 'ktime',
description: 'index into the table containing the xy coordinates. If used like:',
type: 'performance'
},
{
name: 'kx',
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the XY coordinates to localize the signal.',
type: 'performance'
},
{
name: 'ky',
description: 'when _ifn_ is 0, _space_ and _spdist_ will use these values as the XY coordinates to localize the signal.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'spsend',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Generates output signals based on a previously defined [space](../opcodes/space.md) opcode.',
syntax: 'a1, a2, a3, a4 = spsend()',
example: '--8<-- "examples/spsend.csd"',
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
{
name: 'st2ms',
type: 'opcode',
category: 'Signal Modifiers:Panning and Spatialization',
description: 'Stereo to Mid-Side Conversion.',
syntax: 'am,as = st2ms(aleft,aright)',
example: '--8<-- "examples/st2ms.csd"',
parameters: [
{
name: 'am',
description: 'mid signal output.',
type: 'performance'
},
{
name: 'as',
description: 'side signal output.',
type: 'performance'
},
{
name: 'aleft',
description: 'left channel input.',
type: 'performance'
},
{
name: 'aright',
description: 'right channel input.',
type: 'performance'
},
],
seeAlso: ['Panning and Spatialization: Amplitude spatialization']
},
]

View File

@ -0,0 +1,360 @@
import type { CsoundReference } from './types'
// Signal Modifiers:Reverberation
export const signalModifiersReverberation: CsoundReference[] = [
{
name: 'alpass',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Reverberates an input signal with a flat frequency response.',
syntax: 'ares = alpass(asig, xrvt, ilpt [, iskip] [, insmps])',
example: '--8<-- "examples/alpass-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ilpt',
description: 'loop time in seconds, which determines the &#8220;echo density&#8221; of the reverberation. This in turn characterizes the &#8220;color&#8221; of the filter whose frequency response curve will contain _ilpt_ * _sr_/2 peaks spaced evenly between 0 and _sr_/2 (the Nyquist frequency). Loop time can be as large as available memory will permit. The space required for an _n_ second loop is 4_n_*_sr_ bytes. The delay space is allocated and returned as in [delay](../opcodes/delay.md).',
type: 'initialization'
},
{
name: 'xrvt',
description: 'the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude).',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'babo',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'A physical model reverberator.',
syntax: 'a1, a2 = babo(asig, ksrcx, ksrcy, ksrcz, irx, iry, irz [, idiff] [, ifno])\n a1, a2 = babo2(asig, ksrcx, ksrcy, ksrcz, irx, iry, irz [, idiff] [, ifno])',
example: '--8<-- "examples/babo.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'irx',
description: 'the coordinates of the geometry of the resonator (length of the edges in meters)',
type: 'initialization'
},
{
name: 'iry',
description: 'the coordinates of the geometry of the resonator (length of the edges in meters)',
type: 'initialization'
},
{
name: 'irz',
description: 'the coordinates of the geometry of the resonator (length of the edges in meters)',
type: 'initialization'
},
{
name: 'idiff',
description: 'is the coefficient of diffusion at the walls, which regulates the amount of diffusion (0-1, where 0 = no diffusion, 1 = maximum diffusion - default: 1)',
type: 'initialization'
},
{
name: 'ifno',
description: 'expert values function: a function number that holds all the additional parameters of the resonator. This is typically a GEN2--type function used in non-rescaling mode. They are as follows:',
type: 'initialization'
},
{
name: 'decay',
description: 'main decay of the resonator (default: 0.99) * _hydecay_ -- high frequency decay of the resonator (default: 0.1) * _rcvx, rcvy, rcvz_ -- the coordinates of the position of the receiver (the listener) (in meters; 0,0,0 is the resonator center) * _rdistance_ -- the distance in meters between the two pickups (your ears, for example - default: 0.3) * _direct_ -- the attenuation of the direct signal (0-1, default: 0.5). This is a non-op in babo, but has been introduced in babo2. * _early_diff_ -- the attenuation coefficient of the early reflections (0-1, default: 0.8)',
type: 'initialization'
},
{
name: 'asig',
description: 'the input signal',
type: 'performance'
},
{
name: 'ksrcx',
description: 'the virtual coordinates of the source of sound (the input signal). These are allowed to move at k-rate and provide all the necessary variations in terms of response of the resonator.',
type: 'performance'
},
{
name: 'ksrcy',
description: 'the virtual coordinates of the source of sound (the input signal). These are allowed to move at k-rate and provide all the necessary variations in terms of response of the resonator.',
type: 'performance'
},
{
name: 'ksrcz',
description: 'the virtual coordinates of the source of sound (the input signal). These are allowed to move at k-rate and provide all the necessary variations in terms of response of the resonator.',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'comb',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Reverberates an input signal with a &#8220;colored&#8221; frequency response.',
syntax: 'ares = comb(asig, krvt, ilpt [, iskip] [, insmps])',
example: '--8<-- "examples/comb-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ilpt',
description: 'loop time in seconds, which determines the &#8220;echo density&#8221; of the reverberation. This in turn characterizes the &#8220;color&#8221; of the _comb_ filter whose frequency response curve will contain _ilpt_ * _sr_/2 peaks spaced evenly between 0 and _sr_/2 (the Nyquist frequency). Loop time can be as large as available memory will permit. The space required for an _n_ second loop is _n_*_sr_ floating or double numbers (usually 4 or 8 bytes). Delay space is allocated and returned as in [delay](../opcodes/delay.md).',
type: 'initialization'
},
{
name: 'krvt',
description: 'the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude).',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'combinv',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Reverberates an input signal with a &#8220;colored&#8221; frequency response. with a FIR filter.',
syntax: 'ares = combinv(asig, krvt, ilpt [, iskip] [, insmps])',
example: '--8<-- "examples/combinv-modern.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ilpt',
description: 'loop time in seconds, which determines the &#8220;echo density&#8221; of the reverberation. This in turn characterizes the &#8220;color&#8221; of the _combinv_ filter whose frequency response curve will contain _ilpt_ * _sr_/2 peaks spaced evenly between 0 and _sr_/2 (the Nyquist frequency). Loop time can be as large as available memory will permit. The space required for an _n_ second loop is _n_*_sr_ floating or double numbers (usually 4 or 8 bytes). Delay space is allocated and returned as in [delay](../opcodes/delay.md).',
type: 'initialization'
},
{
name: 'krvt',
description: 'the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude).',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'freeverb',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Opcode version of Jezar\'s Freeverb.',
syntax: 'aoutL, aoutR = freeverb(ainL, ainR, kRoomSize, kHFDamp[, iSRate[, iSkip]])',
example: '--8<-- "examples/freeverb.csd"',
parameters: [
{
name: 'ainL',
description: 'input signals; usually both are the same, but different inputs can be used for special effect',
type: 'performance'
},
{
name: 'ainR',
description: 'input signals; usually both are the same, but different inputs can be used for special effect',
type: 'performance'
},
{
name: 'aoutL',
description: 'output signals for left and right channel',
type: 'performance'
},
{
name: 'aoutR',
description: 'output signals for left and right channel',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'nestedap',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Three different nested all-pass filters, useful for implementing reverbs.',
syntax: 'ares = nestedap(asig, imode, imaxdel, idel1, igain1 [, idel2] [, igain2] \\\n [, idel3] [, igain3] [, istor])',
example: '--8<-- "examples/nestedap.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'imode',
description: 'operating mode of the filter:',
type: 'initialization'
},
{
name: 'idel1',
description: 'delay times of the filter stages. Delay times are in seconds and must be greater than zero. _idel1_ must be greater than the sum of _idel2_ and _idel3_.',
type: 'initialization'
},
{
name: 'idel2',
description: 'delay times of the filter stages. Delay times are in seconds and must be greater than zero. _idel1_ must be greater than the sum of _idel2_ and _idel3_.',
type: 'initialization'
},
{
name: 'idel3',
description: 'delay times of the filter stages. Delay times are in seconds and must be greater than zero. _idel1_ must be greater than the sum of _idel2_ and _idel3_.',
type: 'initialization'
},
{
name: 'igain1',
description: 'gain of the filter stages.',
type: 'initialization'
},
{
name: 'igain2',
description: 'gain of the filter stages.',
type: 'initialization'
},
{
name: 'igain3',
description: 'gain of the filter stages.',
type: 'initialization'
},
{
name: 'imaxdel',
description: 'will be necessary if k-rate delays are implemented. Not currently used.',
type: 'initialization'
},
{
name: 'istor',
description: 'Skip initialization if non-zero (default: 0).',
type: 'initialization'
},
{
name: 'asig',
description: 'input signal',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'nreverb',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'A reverberator consisting of 6 parallel comb-lowpass filters.',
syntax: 'ares = nreverb(asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] \\\n [, inumAlpas] [, ifnAlpas])',
example: '--8<-- "examples/nreverb.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ifnCombs',
description: 'function table with _inumCombs_ comb filter time values, followed the same number of gain values. The ftable should not be rescaled (use negative fgen number). Positive time values are in seconds. The time values are converted internally into number of samples, then set to the next greater prime number. If the time is negative, it is interpreted directly as time in sample frames, and no processing is done (except negation). New in Csound version 4.09.',
type: 'initialization'
},
],
seeAlso: ['Reverberation']
},
{
name: 'platerev',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Models the reverberation of a rectangular metal plate with settable physical characteristics when excited by audio signal(s).',
syntax: 'a1[, a2, ...] = platerev(itabexcite. itabouts, kbndry, iaspect, istiff, idecay, \\\n iloss, aexcite1[, aexcite2, ...])',
example: '--8<-- "examples/plate.csd"',
parameters: [
{
name: 'itabexcite',
description: 'number of a table that contains triplets for each excitation signal, (frequency, radius, initial phase in radians). The radius should be less than 1. These control where the excitation happens. The values in the table for frequency and radius may be changed in performance, with the proviso about clicking if the changes are too large.',
type: 'initialization'
},
{
name: 'itabouts',
description: 'number of a table that contains triplets for each output signal, (frequency, radius, initial phase in radians). See itabexcite description.',
type: 'initialization'
},
{
name: 'kbndry',
description: 'boundary condition of the plate; 0 = free, 1 = clamped, 2 = pivoting. Other values are undefined. Thus parameter may be changed at k-rate but that might give rise to clicks.',
type: 'initialization'
},
{
name: 'iaspect',
description: 'plate aspect ratio which should be less than or equal to 1.',
type: 'initialization'
},
{
name: 'istiff',
description: 'plate stiffness parameter (set around 1 or less for plate reverb).',
type: 'initialization'
},
{
name: 'idecay',
description: 'time taken for 30 dB decay',
type: 'initialization'
},
{
name: 'iloss',
description: 'loss parameter for high-frequency damping (value about 0.001 suggested).',
type: 'initialization'
},
{
name: 'aexciten',
description: 'excitation signal to be inserted into the plate.',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'reverb',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Reverberates an input signal with a &#8220;natural room&#8221; frequency response.',
syntax: 'ares = reverb(asig, krvt [, iskip])',
example: '--8<-- "examples/reverb.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'krvt',
description: 'the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude).',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
{
name: 'reverb2',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: 'Same as the [nreverb](../opcodes/nreverb.md) opcode.',
syntax: 'ares = reverb2(asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] \\\n [, inumAlpas] [, ifnAlpas])',
rates: ['a-rate'],
},
{
name: 'reverbsc',
type: 'opcode',
category: 'Signal Modifiers:Reverberation',
description: '8 delay line stereo FDN reverb.',
syntax: 'aoutL, aoutR = reverbsc(ainL, ainR, kfblvl, kfco[, israte[, ipitchm[, iskip]]])',
example: '--8<-- "examples/reverbsc.csd"',
parameters: [
{
name: 'aoutL',
description: 'output signals for left and right channel',
type: 'performance'
},
{
name: 'aoutR',
description: 'output signals for left and right channel',
type: 'performance'
},
{
name: 'ainL',
description: 'left and right channel input. Note that having an input signal on either the left or right channel only will still result in having reverb output on both channels, making this unit more suitable for reverberating stereo input than the [freeverb](../opcodes/freeverb.md) opcode.',
type: 'performance'
},
{
name: 'ainR',
description: 'left and right channel input. Note that having an input signal on either the left or right channel only will still result in having reverb output on both channels, making this unit more suitable for reverberating stereo input than the [freeverb](../opcodes/freeverb.md) opcode.',
type: 'performance'
},
{
name: 'kfblvl',
description: 'feedback level, in the range 0 to 1. 0.6 gives a good small "live" room sound, 0.8 a small hall, and 0.9 a large hall. A setting of exactly 1 means infinite length, while higher values will make the opcode unstable.',
type: 'performance'
},
{
name: 'kfco',
description: 'cutoff frequency of simple first order lowpass filters in the feedback loop of delay lines, in Hz. Should be in the range 0 to israte/2 (not sr/2). A lower value means faster decay in the high frequency range.',
type: 'performance'
},
],
seeAlso: ['Reverberation']
},
]

View File

@ -0,0 +1,171 @@
import type { CsoundReference } from './types'
// Signal Modifiers:Sample Level Operators
export const signalModifiersSampleLevelOperators: CsoundReference[] = [
{
name: 'denorm',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Mixes low level (~1e-20 for floats, and ~1e-56 for doubles) noise to a list of a-rate signals.',
syntax: 'denorm(a1[, a2[, a3[, ... ]]])',
example: '--8<-- "examples/denorm.csd"',
seeAlso: ['Sample Level Operators']
},
{
name: 'diff',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Modify a signal by differentiation.',
syntax: 'ares = diff(asig [, iskip])\n kres = diff(ksig [, iskip])',
example: '--8<-- "examples/diff.csd"',
rates: ['a-rate', 'k-rate'],
seeAlso: ['Sample Level Operators']
},
{
name: 'downsamp',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Modify a signal by down-sampling.',
syntax: 'kres = downsamp(asig [, iwlen])',
example: '--8<-- "examples/downsamp.csd"',
rates: ['a-rate', 'k-rate'],
seeAlso: ['Sample Level Operators']
},
{
name: 'fold',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Adds artificial foldover to an audio signal.',
syntax: 'ares = fold(asig, kincr)',
example: '--8<-- "examples/fold.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'asig',
description: 'input signal',
type: 'performance'
},
{
name: 'kincr',
description: 'amount of foldover expressed in multiple of sampling rate. Must be &gt;= 1',
type: 'performance'
},
],
seeAlso: ['Sample Level Operators']
},
{
name: 'integ',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Modify a signal by integration.',
syntax: 'ares = integ(asig [, iskip])\n kres = integ(ksig [, iskip])',
example: '--8<-- "examples/integ.csd"',
rates: ['a-rate', 'k-rate'],
seeAlso: ['Sample Level Operators']
},
{
name: 'interp',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Converts a control signal to an audio signal using linear interpolation.',
syntax: 'ares = interp(ksig [, iskip] [, imode] [, ivalue])',
example: '--8<-- "examples/interp.csd"',
rates: ['a-rate'],
parameters: [
{
name: 'ksig',
description: 'input k-rate signal.',
type: 'performance'
},
],
seeAlso: ['Sample Level Operators', 'Csound Journal, issue10 - An Overview of Csound Variable Types']
},
{
name: 'ntrpol',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Calculates the weighted mean value (i.e. linear interpolation) of two input signals.',
syntax: 'ares = ntrpol(asig1, asig2, kpoint [, imin] [, imax])\n ires = ntrpol(isig1, isig2, ipoint [, imin] [, imax])\n kres = ntrpol(ksig1, ksig2, kpoint [, imin] [, imax])',
example: '--8<-- "examples/ntrpol.csd"',
rates: ['a-rate', 'k-rate', 'i-rate'],
parameters: [
{
name: 'imin',
description: 'minimum xpoint value (optional, default 0)',
type: 'initialization'
},
{
name: 'imax',
description: 'maximum xpoint value (optional, default 1)',
type: 'initialization'
},
{
name: 'xsig1',
description: 'input signals',
type: 'performance'
},
{
name: 'xsig2',
description: 'input signals',
type: 'performance'
},
{
name: 'xpoint',
description: 'interpolation point between the two values',
type: 'performance'
},
],
seeAlso: ['Sample Level Operators']
},
{
name: 'opa',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Converts a k-sig or k-array parameter to an a-sig output.',
example: '--8<-- "examples/opa.csd"',
seeAlso: ['Sample Level Operators', 'Csound Journal, issue 10']
},
{
name: 'opi',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Returns an init-type equivalent of a k-rate argument or array element or directly returns an i-rate argument.',
seeAlso: ['Sample Level Operators', 'Csound Journal, issue 10']
},
{
name: 'opk',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Converts a i-rate parameter to an k-rate value or an a-rate value to a k-rate value by down-sampling.',
seeAlso: ['Sample Level Operators', 'Csound Journal, issue 10']
},
{
name: 'ops',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Returns a string containg the numeric value of its argument.',
seeAlso: ['Sample Level Operators']
},
{
name: 'samphold',
type: 'opcode',
category: 'Signal Modifiers:Sample Level Operators',
description: 'Performs a sample-and-hold operation on its input.',
syntax: 'ares = samphold(asig, agate [, ival] [, ivstor])\n kres = samphold(ksig, kgate [, ival] [, ivstor])',
example: 'asrc buzz 10000, 440, 20, 1 ; band-limited pulse train\nadif diff asrc ; emphasize the highs\nanew balance adif, asrc ; but retain the power\nagate reson asrc, 0, 440 ; use a lowpass of the original\nasamp samphold anew, agate ; to gate the new audiosig\naout tone asamp, 100 ; smooth out the rough edges',
rates: ['a-rate', 'k-rate'],
parameters: [
{
name: 'kgate',
description: 'controls whether to hold the signal.',
type: 'performance'
},
{
name: 'xgate',
description: 'controls whether to hold the signal.',
type: 'performance'
},
],
seeAlso: ['Sample Level Operators']
},
]

Some files were not shown because too many files have changed in this diff Show More