line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#_{ Encoding and name |
2
|
|
|
|
|
|
|
=encoding utf8 |
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Csound::ScoreStatement |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
L |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut |
10
|
|
|
|
|
|
|
#_} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Csound::ScoreStatement::i; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
15
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
16
|
|
|
|
|
|
|
# use 5.10.0; # state |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
71
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
352
|
use Csound::ScoreStatement; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
405
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = $Csound::VERSION; |
23
|
|
|
|
|
|
|
our @ISA = qw(Csound::ScoreStatement); |
24
|
|
|
|
|
|
|
#_{ Synopsis |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SYNOPSIS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use Csound::ScoreStatement::i; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
... |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
#_} |
34
|
|
|
|
|
|
|
#_{ Description |
35
|
|
|
|
|
|
|
=head DESCRIPTION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
The C statement causes a so called GEN subroutine to place values in a stored function table. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
The syntax is |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
f tableNumber actionTime size genRoutine … |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
#_} |
45
|
|
|
|
|
|
|
#_{ Methods |
46
|
|
|
|
|
|
|
#_{ |
47
|
|
|
|
|
|
|
=head1 METHODS |
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
#_} |
50
|
|
|
|
|
|
|
sub new { #_{ |
51
|
|
|
|
|
|
|
#_{ POD |
52
|
|
|
|
|
|
|
=head2 new |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This method should not be called by the end user, it should be called by L. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
#_} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $instr = shift; |
63
|
0
|
|
|
|
|
|
my $t_start = shift; |
64
|
0
|
|
|
|
|
|
my $t_len = shift; |
65
|
0
|
|
|
|
|
|
my @params = @_; |
66
|
|
|
|
|
|
|
|
67
|
0
|
0
|
|
|
|
|
croak "No instrument passed" unless $instr->isa('Csound::Instrument'); |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
my $self = {}; |
70
|
0
|
|
|
|
|
|
bless $self, $class; |
71
|
0
|
0
|
|
|
|
|
croak unless $self->isa('Csound::ScoreStatement::i'); |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
$self -> {instr } = $instr; |
74
|
0
|
|
|
|
|
|
$self -> {t_start } = $t_start; |
75
|
0
|
|
|
|
|
|
$self -> {t_len } = $t_len; |
76
|
0
|
|
|
|
|
|
$self -> {params } =\@params; |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return $self; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
} #_} |
81
|
|
|
|
|
|
|
sub score_text { #_{ |
82
|
|
|
|
|
|
|
#_{ POD |
83
|
|
|
|
|
|
|
=head2 score_text |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $txt = $i->score_text(); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Returns the text to be written into the score. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
#_} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
94
|
0
|
0
|
|
|
|
|
die unless $self->isa('Csound::ScoreStatement::i'); |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
my $score_text = sprintf ('i%d %s %s', $self->instrument_nr(), $self->{t_start}, $self->{t_len}); |
97
|
|
|
|
|
|
|
|
98
|
0
|
0
|
|
|
|
|
if (@{$self->{params}}) { |
|
0
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
$score_text .= ' '; |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
$score_text .= join ' ', @{$self->{params}}; |
|
0
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
return $score_text; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
} #_} |
108
|
|
|
|
|
|
|
sub instrument_nr { #_{ |
109
|
|
|
|
|
|
|
#_{ POD |
110
|
|
|
|
|
|
|
=head2 instrument_nr |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
my $inr = $i->instrument_nr(); |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Returns the number of the instrument to which this C belongs. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
#_} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
120
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
121
|
|
|
|
|
|
|
|
122
|
0
|
0
|
|
|
|
|
croak unless $self->isa('Csound::ScoreStatement::i'); |
123
|
|
|
|
|
|
|
|
124
|
0
|
0
|
|
|
|
|
die "\$sself->instr is not an Csound::Instrument" unless $self->{instr}->isa('Csound::Instrument'); |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
return $self->{instr}->{nr}; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
} #_} |
129
|
|
|
|
|
|
|
#_} |
130
|
|
|
|
|
|
|
#_{ POD: Copyright |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 Copyright |
133
|
|
|
|
|
|
|
Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved. |
134
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
135
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
136
|
|
|
|
|
|
|
copy of the full license at: L |
137
|
|
|
|
|
|
|
=cut |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
#_} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
'tq84'; |
142
|
|
|
|
|
|
|
|