[][src]Crate csound

Csound

This crate contains safe Csound bindings for the csound's library. The supported csound's version is >= 6.12

What is Csound?

Csound is a sound and music computing system. If you want to known more visit:

Hello World

A simple Hello world example which reproduces a simple sine wave signal. The call to the csound's perform() method will block the application until the end of the score have been reached. There are another alternatives for non blocking calls to perform csound's scores or csd files. see the examples in the project's source directory or go to csound's examples repository for more advanced examples and use cases.

extern crate csound;
use csound::*;

static score: &str = "<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

kamp = .6
kcps = 440
ifn  = p4

asig oscil kamp, kcps, ifn
     outs asig,asig

endin
</CsInstruments>
<CsScore>
f1 0 16384 10 1
i 1 0 2 1
e
</CsScore>
</CsoundSynthesizer>";

fn main() {
    let mut cs = Csound::new();

   /* a message callback*/
   let func = |_, message:&str| {
       print!("{}", message);
   };
   cs.message_string_callback(|_, msg: &str| {
        print!("{}", msg) );
   cs.compile_csd_text(csd).unwrap();
   cs.start().unwrap();

   cs.perform();
}

Structs

BufferPtr

Csound buffer pointer representation. This struct is build up to manipulate directly csound's buffers.

ChannelHints

Holds the channel HINTS information.

ChannelInfo

Holds all relevant information about a csound bus channel.

CircularBuffer

Csound's Circular Buffer object. This struct wraps a *mut T pointer to a circular buffer allocated by csound. This Circular buffer won't outlive the csound instance that allocated the buffer.

ControlChannelPtr

Rust representation for a raw csound channel pointer

ControlChannelType

Defines the types of csound bus cahnnels

CsAudioDevice

Struct with specific audio device information.

CsMidiDevice

Struct with specific MIDI device information.

Csound

Opaque struct representing an csound object

FileInfo

Struct containing the relevant info of files are opened by csound.

OpcodeListEntry

Struct with information about a csound opcode.

PvsDataExt

Holds pvs data info of a pvs channel.

RtAudioParams

Real time audio params for a specific audio Device.

Table

Csound table representation. This struct is build up to manipulate directly a csound's table.

Enums

ChannelData

Enum variant which represent channel's types.

FileTypes

Describes the differents file types which are supported are by csound

Language

The languages supported by csound

MessageType

Define the type of csound messages

Status

Csound error codes

Type Definitions

RTCLOCK