Catalyst-View-Semantic
view release on metacpan or search on metacpan
lib/Catalyst/View/Semantic.pod~ view on Meta::CPAN
same as C<levels>, but get/sets durations for segments
=head2 dur($pos, [$level])
get/set dur at position
=head2 curves([@new_curves])
same as durs, but for curves
=head2 curve($pos, [$level])
get/set curvative at position
=head2 border_level([$begin,$end])
should be in range [0,1], can be array ref or single value for equal levels at begin/end of envelope
this will work only when passed to constructor to create random envelope, e.g.
Math::SegmentedEnvelope->new(border_level => [0.5,0.2])
=head1 FUNCTIONS
=over
=item env(constructor params)
handy function which will construct object from passed params, e.g.
use Math::SegmentedEnvelope 'env';
my @arr = map { env } 0..9; # @arr now contains 10 random envelope objects
alternatively you can use modules such as L<aliased>, L<as>
=back
=head1 EXAMPLES
=over
=item Plot
use PDL::Graphics::Prima::Simple;
use Math::SegmentedEnvelope;
my $e = Math::SegmentedEnvelope->new(is_morph => 1);
my $t = $e->table(4096);
line_plot($t);
=item Interpolate
use PDL;
interpolate(rand(4095), sequence(4096), pdl($t)); # interpolate at random position
=item Animation
use AnyEvent; # and/or Coro
my $e = Math::SegmentedEnvelope->new(is_morph => 1);
my $v = 0; # some property
my $w = AE::timer(0, 1/60, sub { # refresh $v with 60Hz rate
state $s = $e->static; # get static evaluator
state $started = AE::now;
$v = $s->(AE::now - $started); # or $e->at(..) if $e can be altered somewhere
});
my $k = AE::timer(10, 0, sub { undef $w }); # kill previous timer after 10secs
my $i = AE::idle(sub { ... }); # animate $v using OpenGL, SDL and etc..
AE::cv->recv;
=item visual representation of arbitrary definition
Math::SegmentedEnvelope->new([[0,1,0.5,0],[0.5,0.5,1],[-3,1/3,4]], is_morph => 1)
=begin HTML
<p><img src="http://i.imgur.com/Dsqaq.png" width="478" height="263" alt="envelope example" /></p>
=end HTML
=back
=head1 SUPPORT
=over
=item * GitHub
L<http://github.com/vividsnow/Math-SegmentedEnvelope>
=item * Search MetaCPAN
L<https://metacpan.org/module/Math::SegmentedEnvelope>
=back
=head1 ACKNOWLEDGEMENTS
L<SuperCollider|https://supercollider.sourceforge.net>, L<Moo>
=head1 AUTHOR
Yegor Korablev <egor@cpan.org>
=head1 LICENSE
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 SEE ALSO
L<PDL>, L<Math::Fractal::Noisemaker>, L<Math::NumSeq>, L<Math::PlanePath>, L<OpenGL>, L<SDL>, L<AnyEvent>
=head1 TODO
blending,stacking,duration scaling,delaying,inverting and some common predefined envelopes
more docs,tests and examples
=cut
( run in 0.484 second using v1.01-cache-2.11-cpan-39bf76dae61 )