Csound::Instrument
use Csound::Instrument; ...
my $composition = Csound::Composition->new(…); my $instr = Csound::Instrument->new( { composition => $composition, parameters => ['amplitude', 'foo_1', 'foo_2'] } );
If the parameter composition is passed with a reference to a Csound::Composition, the instrument's "play" method is shorthand for $composition->play($instr, …).
composition
$composition->play($instr, …)
Most instrument play notes. However, to indicate that an instrument doesn't play a note (such as a high hat or a noise etc.), the flag no_note can be given.
no_note
my $instr = Csound::Instrument->new( $composition, { parameters => ['amplitude', 'foo_1', 'foo_2'], no_note => 1 } );
$instr->play($t_start, $duration, 'f♯5', …);
When the instrument was constructed with the composition parameter, this is a shorthand for
$composition->play($instr, $t_start, $duration, 'f♯5', …);
my $yes_no = $instr->plays_note();
In most cases, an instrument will play a note. When the flag/parameter no_note was given in "new", the instrument also doesn't play a note.
$instr -> i($t_start, $t_len, …);
Creates an i statement. It should not be called by the end user. Rather, the user should call "play" in Csound::Score.
my $score = Csound::Score->new(…); my $txt = $instr->orchestra_text($score);
Returns the text to be written into the score.
Sometimes, the instrument needs to have access to the score (notably for the f statements required in the oscil opcode family). Therefore, the method needs the $score parameter.
oscil
$score
Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at: http://www.perlfoundation.org/artistic_license_2_0
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =head
To install Csound, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Csound
CPAN shell
perl -MCPAN -e shell install Csound
For more information on module installation, please visit the detailed CPAN module installation guide.