|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.core.Bead
net.beadsproject.beads.core.UGen
net.beadsproject.beads.ugens.RecordToSample
public class RecordToSample
RecordToSample records audio into a writeable Sample
.
RecordToSample has three different modes, which dictate
how it behaves when the end of the sample is reached:
clip()
the sample once done. Alternatively you can see
how many frames were written
.
Tip: Be sure to UGen.pause(boolean)
the recorder when using INFINITE mode,
otherwise it will keep recording and you may quickly run out of memory.
setResizingParameters(double, double)
.
Nested Class Summary | |
---|---|
static class |
RecordToSample.Mode
|
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary |
---|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
RecordToSample(AudioContext context,
int numChannels)
|
|
RecordToSample(AudioContext context,
Sample sample)
Instantiates a new RecordToSample. |
|
RecordToSample(AudioContext context,
Sample sample,
RecordToSample.Mode mode)
Instantiates a new RecordToSample. |
Method Summary | |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data. |
void |
clip()
Once you have finished writing into a sample this method clips the sample length to the recorded data. |
RecordToSample.Mode |
getMode()
|
long |
getNumFramesRecorded()
|
double |
getPosition()
Gets the position. |
Sample |
getSample()
Gets the Sample. |
boolean |
isLoopRecord()
Deprecated. Use getMode() instead. |
void |
reset()
Resets the Recorder to record into the beginning of the Sample. |
void |
setLoopRecord(boolean loopRecord)
Deprecated. Use setMode(Mode) instead. |
void |
setMode(RecordToSample.Mode mode)
|
void |
setPosition(double positionMs)
Sets the position to record to in milliseconds. |
void |
setResizingParameters(double doubleUpTime,
double constantResizeLength)
Advanced: Change the parameters used when resizing samples in INFINITE recorder mode. |
void |
setSample(Sample sample)
Sets the Sample. |
Methods inherited from class net.beadsproject.beads.core.UGen |
---|
addDependent, addInput, addInput, clearDependents, clearInputConnections, containsInput, crossfadeInput, getConnectedInputs, getContext, getEnvelopes, getIns, getNumberOfConnectedUGens, getNumberOfDependents, getOutBuffer, getOuts, getTimeTakenLastUpdate, getValue, getValue, getValueDouble, getValueDouble, initializeOuts, isTimerMode, isUpdated, noInputs, pause, printInBuffers, printInputList, printOutBuffers, removeAllConnections, removeConnection, removeDependent, setOutsToPause, setTimerMode, setValue, update, zeroIns, zeroOuts |
Methods inherited from class net.beadsproject.beads.core.Bead |
---|
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RecordToSample(AudioContext context, Sample sample) throws java.lang.Exception
context
- the AudioContext.sample
- the Sample.
java.lang.Exception
- if sample is not writeable.public RecordToSample(AudioContext context, Sample sample, RecordToSample.Mode mode) throws java.lang.Exception
context
- the AudioContext.sample
- the Sample.mode
- the Recording Mode to use.
java.lang.Exception
- if sample is not writeable.public RecordToSample(AudioContext context, int numChannels)
Method Detail |
---|
public Sample getSample()
public void setSample(Sample sample) throws java.lang.Exception
sample
- the new Sample.
java.lang.Exception
- if sample isn't writeablepublic void reset()
public void clip()
public void setPosition(double positionMs)
positionMs
- the new position in milliseconds.public void calculateBuffer()
UGen
UGen.bufIn
and putting data
into UGen.bufOut
in some way. UGen.bufIn
and UGen.bufOut
are 2D arrays of floats of the form float[numChannels][bufferSize]. The length of the buffers is given by
UGen.bufferSize
, and the number of channels of the input and output buffers are given by UGen.ins
and UGen.outs
respectively.
calculateBuffer
in class UGen
public double getPosition()
public long getNumFramesRecorded()
public RecordToSample.Mode getMode()
public void setMode(RecordToSample.Mode mode)
mode
- Change the mode of this recorder. Can be changed while running.public void setResizingParameters(double doubleUpTime, double constantResizeLength)
doubleUpTime
- The time (in ms) up to which the sample size should be doubled.constantResizeLength
- The length (in ms) of the extra space appended to Sample.public boolean isLoopRecord()
getMode()
instead.
public void setLoopRecord(boolean loopRecord)
setMode(Mode)
instead.
loopRecord
- true to enable loop record mode.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |