line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Audio::LADSPA perl modules for interfacing with LADSPA plugins |
2
|
|
|
|
|
|
|
# Copyright (C) 2003 - 2004 Joost Diepenmaat. |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify |
5
|
|
|
|
|
|
|
# it under the terms of the GNU General Public License as published by |
6
|
|
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or |
7
|
|
|
|
|
|
|
# (at your option) any later version. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful, |
10
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
11
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12
|
|
|
|
|
|
|
# GNU General Public License for more details. |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License |
15
|
|
|
|
|
|
|
# along with this program; if not, write to the Free Software |
16
|
|
|
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
# See the COPYING file for more information. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
package Audio::LADSPA::Plugin::Sequencer4; |
21
|
1
|
|
|
1
|
|
1172
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
22
|
1
|
|
|
1
|
|
5
|
use base qw(Audio::LADSPA::Plugin::Perl); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
603
|
|
23
|
|
|
|
|
|
|
our $VERSION = "0.021"; |
24
|
|
|
|
|
|
|
use Carp; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my @frequency_table = map { 440 * (2 ** ( ( $_ - 69) / 12 )) } 0 .. 127; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__PACKAGE__->description( |
30
|
|
|
|
|
|
|
name => 'Audio::LADSPA::Plugin::Sequencer4', |
31
|
|
|
|
|
|
|
label => 'squencer', |
32
|
|
|
|
|
|
|
maker => 'Joost Diepenmaat', |
33
|
|
|
|
|
|
|
copyright => 'GPL', |
34
|
|
|
|
|
|
|
id => '1', |
35
|
|
|
|
|
|
|
ports => [ |
36
|
|
|
|
|
|
|
{ |
37
|
|
|
|
|
|
|
name => 'Run/Step', |
38
|
|
|
|
|
|
|
is_input => 1, |
39
|
|
|
|
|
|
|
is_control => 1, |
40
|
|
|
|
|
|
|
is_integer => 1, |
41
|
|
|
|
|
|
|
upper_bound => 10000, |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
name => 'Step 1', |
45
|
|
|
|
|
|
|
is_input => 1, |
46
|
|
|
|
|
|
|
is_control => 1, |
47
|
|
|
|
|
|
|
is_integer => 1, |
48
|
|
|
|
|
|
|
upper_bound => 127, |
49
|
|
|
|
|
|
|
}, |
50
|
|
|
|
|
|
|
{ |
51
|
|
|
|
|
|
|
name => 'Step 2', |
52
|
|
|
|
|
|
|
is_input => 1, |
53
|
|
|
|
|
|
|
is_control => 1, |
54
|
|
|
|
|
|
|
is_integer => 1, |
55
|
|
|
|
|
|
|
upper_bound => 127, |
56
|
|
|
|
|
|
|
}, |
57
|
|
|
|
|
|
|
{ |
58
|
|
|
|
|
|
|
name => 'Step 3', |
59
|
|
|
|
|
|
|
is_input => 1, |
60
|
|
|
|
|
|
|
is_control => 1, |
61
|
|
|
|
|
|
|
is_integer => 1, |
62
|
|
|
|
|
|
|
upper_bound => 127, |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
name => 'Step 4', |
66
|
|
|
|
|
|
|
is_input => 1, |
67
|
|
|
|
|
|
|
is_control => 1, |
68
|
|
|
|
|
|
|
is_integer => 1, |
69
|
|
|
|
|
|
|
upper_bound => 127, |
70
|
|
|
|
|
|
|
}, |
71
|
|
|
|
|
|
|
{ |
72
|
|
|
|
|
|
|
name => 'Frequency', |
73
|
|
|
|
|
|
|
is_input => 0, |
74
|
|
|
|
|
|
|
is_control => 1, |
75
|
|
|
|
|
|
|
}, |
76
|
|
|
|
|
|
|
{ |
77
|
|
|
|
|
|
|
name => 'Trigger', |
78
|
|
|
|
|
|
|
is_input => 0, |
79
|
|
|
|
|
|
|
is_control => 1, |
80
|
|
|
|
|
|
|
}, |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
], |
83
|
|
|
|
|
|
|
); |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub init { |
86
|
|
|
|
|
|
|
my $self = shift; |
87
|
|
|
|
|
|
|
$self->{run_counter} = 0; |
88
|
|
|
|
|
|
|
$self->{step_counter} = 1; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub run { |
92
|
|
|
|
|
|
|
my ($self,$samples) = @_; |
93
|
|
|
|
|
|
|
$self->set(5, $frequency_table[$self->get( $self->{step_counter})]); |
94
|
|
|
|
|
|
|
if (++$self->{run_counter} >= $self->get(0)) { |
95
|
|
|
|
|
|
|
$self->{run_counter} = 0; |
96
|
|
|
|
|
|
|
$self->{step_counter}++; |
97
|
|
|
|
|
|
|
$self->{step_counter} = 1 if $self->{step_counter} > 4; |
98
|
|
|
|
|
|
|
$self->set(6,1); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
else { |
101
|
|
|
|
|
|
|
$self->set(6,0); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
__END__ |