Csound/ScoreStatement/f.pm

filter: Statementstmt 100% 35 / 35 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 91.6% 44 / 48 CC 3 SCAR 3.7
CC
3
Cov
95%
score_text
2.0
new
2.0
BEGIN
1.0
CRAP 1.4
« Csound/ScoreStatement/i.pm ↑ Summary Csound/ScoreStatement.pm »
1 #_{ Encoding and name
2 =encoding utf8
3 =head1 NAME
4  
5 Csound::ScoreStatement
6  
7 L<http://www.csounds.com/manual/html/ScoregensTop.html>
8  
9 =cut
10 #_}
11  
12 package Csound::ScoreStatement::f;
13  
14 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 3 ▶use 5.10.0; # state
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 3 ▶use Csound::ScoreStatement;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 3 our $VERSION = $Csound::VERSION;
23 3 our @ISA = qw(Csound::ScoreStatement);
24  
25 #_{ Synopsis
26  
27 =head1 SYNOPSIS
28  
29 use Csound::ScoreStatement::f;
30  
31 ...
32  
33 =cut
34 #_}
35 #_{ Description
36 =head DESCRIPTION
37  
38 The C<f> statement causes a so called GEN subroutine to place values in a stored function table.
39  
40 The syntax is
41  
42 f tableNumber actionTime size genRoutine …
43  
44 =cut
45 #_}
46 #_{ Methods
47 #_{
48 =head1 METHODS
49 =cut
50 #_}
51 4 ▶sub new { #_{
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
52 #_{ POD
53 =head2 new
54 =cut
55 #_}
56  
57 4 state $_table_nr = 0;
58  
59 4 my $class = shift;
60 4 my $gen_nr = shift;
61 4 my $size = shift;
62 4 my @params = @_;
63  
64 4 my $self = {};
65  
66 4 bless $self, $class;
67 4 ▶ die unless $self->isa('Csound::ScoreStatement::f');
Branch: 1 branch
BranchTrueFalseTotal
unless $self->isa("Csound::ScoreStatement::f") 0 4 4
68  
69 4 $self->{table_nr } = ++$_table_nr;
70 4 $self->{t_action } = 0; # Currently always 0
71 4 $self->{gen_nr } = $gen_nr;
72 4 $self->{size } = $size;
73 4 $self->{parameters} =\@params;
74  
75 4 return $self;
76  
77 } #_}
78 2 ▶sub score_text { #_{
Subroutine score_text: called CC=2 SCAR=7.0
Pod undocumented
79 #_{ POD
80 =head2 new
81 =cut
82 #_}
83  
84 2 my $self = shift;
85 2 ▶ die unless $self->isa('Csound::ScoreStatement::f');
Branch: 1 branch
BranchTrueFalseTotal
unless $self->isa("Csound::ScoreStatement::f") 0 2 2
86  
87 2 return sprintf("f%d %d %d %d %s", $self->{table_nr}, $self->{t_action}, $self->{size}, $self->{gen_nr}, join " ", @{$self->{parameters}});
88  
89 } #_}
90 #_}
91 #_{ POD: Copyright
92  
93 =head1 Copyright
94  
95 Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved.
96 This program is free software; you can redistribute it and/or modify it
97 under the terms of the the Artistic License (2.0). You may obtain a
98 copy of the full license at: L<http://www.perlfoundation.org/artistic_license_2_0>
99  
100 =cut
101  
102 #_}
103  
104 3 'tq84';
« Csound/ScoreStatement/i.pm ↑ Summary Csound/ScoreStatement.pm »