ModuleExt

NAME

OpenMPT::Bindings::ModuleExt - libopenmpt extension API wrapper

SYNOPSIS


use OpenMPT::Bindings::ModuleExt;

my $ext = OpenMPT::Bindings::ModuleExt.from-file('track.xm');
say $ext.module.title;

# Interactive interface
$ext.set-current-speed(2);
$ext.set-tempo-factor(1.5);
$ext.play-note(0, 60, 0.8, 0.5);

# Pattern visualization
say $ext.get-pattern-row-channel-volume-effect-type(0, 0, 0);

DESCRIPTION

Wraps the opaque openmpt_module_ext* handle from libopenmpt and provides access to the extension interfaces:

CONSTRUCTION

from-blob

method from-blob(Blob $data, :%ctls --> ::?CLASS)

Create a ModuleExt from in-memory Blob data. Optional %ctls for initial CTL parameters. The underlying Module object is accessible via .module.

from-file

method from-file(Str $path, :%ctls --> ::?CLASS)

Read a file from disk and create a ModuleExt from its contents.

ATTRIBUTES

module

method module(--> OpenMPT::Bindings::Module)

The underlying Module instance. All standard Module methods (metadata, rendering, etc.) are available through this method.

Caveat: returns Nil after the ModuleExt has been destroyed.

INTERFACES

Interactive

Requires libopenmpt 0.3+. Methods die with X::OpenMPT::Bindings if the interface is not available.

  • set-current-speed(Int $speed) returns Bool

  • set-current-tempo(Int $tempo) returns Bool (DEPRECATED — use set-current-tempo2 instead)

  • set-tempo-factor(Num $factor) returns Bool

  • get-tempo-factor() returns Num

  • set-pitch-factor(Num $factor) returns Bool

  • get-pitch-factor() returns Num

  • set-global-volume(Num $volume) returns Bool

  • get-global-volume() returns Num

  • set-channel-volume(Int $channel, Num $volume) returns Bool

  • get-channel-volume(Int $channel) returns Num

  • set-channel-mute(Int $channel, Bool $mute) returns Bool

  • get-channel-mute(Int $channel) returns Bool

  • set-instrument-mute(Int $instrument, Bool $mute) returns Bool

  • get-instrument-mute(Int $instrument) returns Bool

  • play-note(Int $instrument, Int $note, Num $volume, Num $panning) returns Int

  • stop-note(Int $channel) returns Bool

Interactive2

Requires libopenmpt 0.6+.

  • note-off(Int $channel) returns Bool

  • note-fade(Int $channel) returns Bool

  • set-channel-panning(Int $channel, Num $panning) returns Bool

  • get-channel-panning(Int $channel) returns Num

  • set-note-finetune(Int $channel, Num $finetune) returns Bool

  • get-note-finetune(Int $channel) returns Num

Interactive3

Requires libopenmpt 0.7+.

  • set-current-tempo2(Num $tempo) returns Bool

Pattern Visualization

Requires libopenmpt 0.3+.

  • get-pattern-row-channel-volume-effect-type(Int $pattern, Int $row, Int $channel) returns Int

  • get-pattern-row-channel-effect-type(Int $pattern, Int $row, Int $channel) returns Int

SEE ALSO

OpenMPT::Bindings v0.0.3

Raku bindings for libopenmpt (module music rendering)

Authors

  • Sasha Abbott

License

CC0-1.0

Dependencies

Test Dependencies

Provides

  • OpenMPT::Bindings
  • OpenMPT::Bindings::Exception
  • OpenMPT::Bindings::Module
  • OpenMPT::Bindings::ModuleExt
  • OpenMPT::Bindings::Native
  • OpenMPT::Bindings::NativeLib
  • OpenMPT::Bindings::Types
  • OpenMPT::Bindings::Util

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.