|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcrayolon.portamod.PortaMod
public class PortaMod
PortaMod - a MOD/XM/S3M replayer library for Processing by Brendan Ratliff (aka Crayolon, aka Syphus of UpRough) Based on IBXM by Martin Cameron (© 2008) Fundamentally, PortaMod is a Processing implementation of IBXM so that the Processing community can benefit from the advantages that oldschool 'tracker' formats offer. Compared to WAV/MP3/OGG, these advantages include small file-size, the ability to synchronise visuals and other triggered events to events in the music (e.g. synching a screenflash to a particular note, at a particular time and volume) and the possibility for allowing extensive user interaction with the music itself. Compared to MIDI, tracked formats use instruments based on samples which sound the same on any replayer system, rather than being dependent on varying MIDI-synths. Though oldschool 4-channel chiptunes can be as small as 3 kilobytes, complex and high- quality music can be arranged in an XM of up to 32 channels, often matching mp3 quality but with a reduced filesize. PortaMod builds quite heavily on IBXM in the control features it offers, while retaining IBXM's efficiency and reliable handling of these formats and their idiosyncrasies. Its diverse range of methods is intended to give the Processing community a very granular relationship with tracked audio data, which can either be found amongst the gigabytes of free modules available online or created with trackers such as ProTracker (Amiga), FastTracker (MS-DOS), ScreamTracker (MS-DOS), or the modern-day and very cross-platform MilkyTracker - www.milkytracker.org Feedback always appreciated - echolevel@gmail.com Special thanks to Peter Quayle (parapete), Paul Carpenter (Vampire^TZT) and Anders Carlsson (goto80), for help and bugtesting; to Joey Scully (dataprole) and Jamie Allen for advice; to Martin Cameron (of course!) for IBXM :D
| Field Summary | |
|---|---|
int |
bpmvalue
|
CellContent[] |
cellcontent
|
int[] |
chantranspose
|
CellContent[] |
content
|
java.util.ArrayList<CurrentPattern>[] |
currentpatternrows
|
int |
delayedchannel
|
java.util.ArrayList<CustomNote> |
delayednotes
|
CustomNote[] |
delaynotes
|
Player |
delayplayerA
|
java.lang.String |
filepath
|
int |
globvol
|
java.lang.String[] |
infotext
|
int |
initialtempo
|
int |
interpolation
|
int |
jamcounter
|
int |
loadSuccess
|
byte[] |
localmod_header
|
NoteData |
localnotes
|
boolean |
looping
|
int[] |
looplength
|
int[] |
loopstart
|
float |
maxVol
|
float |
minVol
|
byte[] |
mod_header
|
java.lang.String |
modtype
|
boolean |
muted
|
int |
numchannels
|
int |
numinstruments
|
int |
numpatterns
|
java.util.ArrayList<Instrument> |
oldsamples
|
int[] |
origlooplength
|
int[] |
origloopstart
|
boolean |
paused
|
Player |
player
|
boolean |
playing
|
int[] |
sampledatalength
|
int |
sequencecounter
|
long |
songLength
|
long |
songPosition
|
long |
songStart
|
NoteData |
thisrow
|
int |
transpose
|
java.lang.String |
VERSION
|
javax.sound.sampled.FloatControl |
volCtrl
|
| Constructor Summary | |
|---|---|
PortaMod(PApplet p)
a Constructor, usually called in the setup() method in your sketch to initialize and start the library. |
|
| Method Summary | |
|---|---|
void |
channelDelay(int chan,
int delaytime,
int delaysend)
channelDelay(int, int, int) - OMG this'll be so awesome if it works. |
void |
customkeyDown(int note,
int inst,
java.lang.String vol,
java.lang.String effect,
java.lang.String effparam)
customkeyDown(int, int, String, String, String) takes note, instrument, volume, effect and effect-parameter and uses them to override playing notes in the selected channel. |
void |
customkeyUp(int note,
int inst)
customkeyUp(int, int) takes note and instrument numbers and flips the relevant keydown switch to off. |
void |
delaykeyDown(int note,
int inst,
int vol,
int effect,
int effparam)
delaykeyDown(int, int, int, int, int) takes note, instrument, volume, effect and effect-parameter and uses them to override playing |
void |
delayTap1(int channel,
int volume)
|
void |
doIt(IBXM instance,
NoteData notedata)
Callback from the replayer engine. |
int |
doModLoad(java.lang.String tune,
boolean autostart,
int startVol)
Load the MOD/XM/S3M module by filepath string. |
void |
effector(int chan,
java.lang.String effect,
java.lang.String effparam)
effector(int, String, String) - quite experimental for now. |
boolean |
getChanmute(int chan)
getChanmute(int) returns the mute status of a channel as a boolean - true for muted, false for unmuted. |
int |
getChanvol(int chan)
getChanvol(int) takes a channel as its argument and returns that channel's current volume as an int between 0 and 64. |
int |
getCurrent_row()
getCurrent_row() returns the current row at the current sequence position as an int |
int |
getCurrent_sequence_index()
getCurrent_sequence_index |
int |
getGlobvol()
getGlobvol() |
int |
getNext_row()
getNext_row() returns the sequence number of the next pattern due to be played |
int |
getNext_sequence_index()
getNext_sequence_index() returns the sequence number of the next pattern due to be played |
float |
getPanning()
getPanning() returns the current panning value for this instance as a flot of between -1.0f and 1.0f, where 0 is the centre-position. |
int |
getSeek()
getSeek() returns the current position of the song in milliseconds as an int. |
int |
getTempo()
getTempo() returns an int of between 32 and 255 indicating the playing module's current BPM tempo. |
java.lang.String |
getTitle()
getTitle() returns a string containing the module's title. |
float |
getVol()
getVol() - returns the current overall volume as a float of between -40.0f and 6.020f |
boolean |
headerCheck(java.lang.String tune)
headerCheck(String) takes the file path of a module, returns a boolean (true if the module is a valid MOD/S3M/XM file) and updates 'modtype'. |
void |
loopLength(int inst,
int newlooplength)
|
void |
loopReset(int inst)
loopReset(inst) takes the chosen instrument and resets the loop start/end points to the originals. |
void |
loopStart(int inst,
int newloopstart)
loopAdjust(inst, loopstart, looplength) takes an instrument number and two percentage values. |
void |
mute()
Mute audio (playback continues) |
java.lang.String |
noteConvert(int noteval)
Returns a formatted tracker-style representation of a given decimal note along with its octave and either an accidental or a hyphen, e.g. |
void |
pause()
Pause playback |
void |
play()
Start playback, or resume playback after pause |
void |
sampleDump()
|
void |
sampleRestore(int idx)
sampleRestore(int) takes the index of a sample you've replaced and restores the original sample. |
void |
sampleSwap(int idx,
java.lang.String inputpath,
int offset)
sampleSwap(int, byte[]) takes a MOD sample number and the path to a new sample, then replaces the extant sampledata with the new. |
void |
setChanmute(int chan,
boolean flip)
setChanmute(int, boolean) takes a channel-number as an int and and a boolean to mute or unmute that channel. |
void |
setChanvol(int chan,
int vol)
setChanvol(int, int) takes the channel number and the desired channel volume - it will override the channel's mixing volume, possibly with some unexpected consequences (such as more 'clipped'-sounding volume slides), and may be overridden by some varieties of volume change command in the module's patterndata. |
void |
setGlobvol(int vol)
setGlobvol(int) |
void |
setInterpolation(int interp)
setInterpolation(int) sets the mixing interpolation to 'none' (0), 'linear' (1) or 'sinc' (2). |
void |
setNext_row(int newrow)
setNext_row(int) takes the number of the desired next row in the current pattern. |
void |
setNext_sequence_index(int newpos,
int behaviour)
setNext_sequence_index(newpos, behaviour) takes the desired new sequence position and an int 0 or 1 to choose between 'continuous' pattern-skip behaviour (where the row in the new pattern follows smoothly from the row in the old pattern) and 'play from start' behaviour, where the new pattern plays from row 0. |
void |
setOverridetempo(boolean flip)
setOverridetempo() switches tempo override on or off. |
void |
setPanning(float panval)
setPanning(float) takes a float from -1.0f to 1.0f to pan the overall audio output across the stereo spectrum. |
void |
setSeek(int newpos)
setSeek(int) sets the current position of the song in milliseconds, from an int parameter. |
void |
setSongloop(boolean flip)
loopSong() switches song-looping on or off. |
void |
setStereosep(int percentage)
setStereosep(int) takes a percentage for desired MOD stereo spread. |
void |
setTempo(int tempo)
setTempo(int) adjusts tempo in beats-per-minute when given an int value between 32 and 255 |
void |
setTranspose(int chan,
int trans)
setTranspose(int, int) shifts playback key up or down by 12 semitones, while retaining tempo. |
void |
setVol(float newvol)
setVol(float) adjusts overall volume. |
void |
stop()
|
java.lang.String |
version()
return the version of the library. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String filepath
public int sequencecounter
public int interpolation
public int globvol
public boolean paused
public int loadSuccess
public byte[] mod_header
public byte[] localmod_header
public int delayedchannel
public boolean looping
public int transpose
public float minVol
public float maxVol
public boolean playing
public boolean muted
public long songStart
public long songLength
public long songPosition
public int numchannels
public int numinstruments
public int bpmvalue
public int initialtempo
public int numpatterns
public java.lang.String[] infotext
public javax.sound.sampled.FloatControl volCtrl
public Player player
public Player delayplayerA
public NoteData localnotes
public NoteData thisrow
public java.util.ArrayList<CurrentPattern>[] currentpatternrows
public java.util.ArrayList<Instrument> oldsamples
public java.util.ArrayList<CustomNote> delayednotes
public CustomNote[] delaynotes
public int[] chantranspose
public int[] origloopstart
public int[] origlooplength
public int[] loopstart
public int[] looplength
public int[] sampledatalength
public CellContent[] cellcontent
public CellContent[] content
public java.lang.String modtype
public int jamcounter
public final java.lang.String VERSION
| Constructor Detail |
|---|
public PortaMod(PApplet p)
p - | Method Detail |
|---|
public java.lang.String version()
public java.lang.String getTitle()
public void play()
public void pause()
public float getVol()
public void setVol(float newvol)
public void mute()
public void setTranspose(int chan,
int trans)
public int getTempo()
public void setTempo(int tempo)
public float getPanning()
public void setPanning(float panval)
public boolean getChanmute(int chan)
public void setChanmute(int chan,
boolean flip)
public void setSongloop(boolean flip)
public int getChanvol(int chan)
chan -
public void setChanvol(int chan,
int vol)
public void setGlobvol(int vol)
public int getGlobvol()
public void setStereosep(int percentage)
public void setInterpolation(int interp)
interp - public int getSeek()
public void setSeek(int newpos)
public void setOverridetempo(boolean flip)
public void sampleSwap(int idx,
java.lang.String inputpath,
int offset)
idx - data_input - public void sampleRestore(int idx)
idx -
public int doModLoad(java.lang.String tune,
boolean autostart,
int startVol)
public void delayTap1(int channel,
int volume)
public void doIt(IBXM instance,
NoteData notedata)
public java.lang.String noteConvert(int noteval)
public boolean headerCheck(java.lang.String tune)
public void customkeyDown(int note,
int inst,
java.lang.String vol,
java.lang.String effect,
java.lang.String effparam)
public void delaykeyDown(int note,
int inst,
int vol,
int effect,
int effparam)
public void channelDelay(int chan,
int delaytime,
int delaysend)
chan - rowlength -
public void effector(int chan,
java.lang.String effect,
java.lang.String effparam)
public void customkeyUp(int note,
int inst)
public void loopStart(int inst,
int newloopstart)
public void loopLength(int inst,
int newlooplength)
public void loopReset(int inst)
inst - public void sampleDump()
public int getCurrent_sequence_index()
public int getCurrent_row()
public int getNext_sequence_index()
public int getNext_row()
public void setNext_sequence_index(int newpos,
int behaviour)
public void setNext_row(int newrow)
public void stop()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||