本文整理汇总了C++中UGen类的典型用法代码示例。如果您正苦于以下问题:C++ UGen类的具体用法?C++ UGen怎么用?C++ UGen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UGen类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: throw
FFTSenderUGenInternal::FFTSenderUGenInternal(UGen const& input,
FFTEngine::FFTModes mode,
FFTEngine const& fft,
const int overlap,
const int firstBin,
const int numBins) throw()
: UGenInternal(NumInputs),
mode_(mode),
fftEngine(fft),
fftSize(fftEngine.size()),
fftSizeHalved(fftSize / 2),
overlap_(overlap < 1 ? 1 : overlap),
firstBin_(firstBin < fftSizeHalved ? firstBin : fftSizeHalved),
maxNumBins(fftSizeHalved - firstBin_ + 1),
numBins_(numBins ? (numBins < maxNumBins ? numBins : maxNumBins) : maxNumBins),
inputBuffer(Buffer::newClear(fftSize, input.getNumChannels(), true)),
outputBuffer(Buffer::newClear(fftSize, input.getNumChannels(), true)),
bufferIndex(0)
{
ugen_assert(overlap == overlap_); // should be > 0
ugen_assert(firstBin == firstBin_); // should be in range
// ugen_assert(numBins == numBins_); // should be in range
inputs[Input] = input;
}
开发者ID:,项目名称:,代码行数:25,代码来源:
示例2: throw
LoopPointsUGenInternal::LoopPointsUGenInternal(Buffer const& buffer,
UGen const& rate,
UGen const& start,
UGen const& end,
UGen const& loop,
UGen const& startAtZero,
UGen const& playToEnd,
const UGen::DoneAction doneAction,
MetaData const& metaDataToUse) throw()
: UGenInternal(NumInputs),
b(buffer),
currentValue((startAtZero.getValue() >= 0.5f) ? 0.f : start.getValue() * b.size()),
lastLoop(false),
doneAction_(doneAction),
shouldDeleteValue(doneAction_ == UGen::DeleteWhenDone),
metaData(metaDataToUse),
prevValue((rate.getValue() >= 0.f) ? currentValue - 1.f : b.size())
{
inputs[Rate] = rate;
inputs[Start] = start;
inputs[End] = end;
inputs[Loop] = loop;
inputs[StartAtZero] = startAtZero;
inputs[PlayToEnd] = playToEnd;
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:25,代码来源:ugen_PlayBuf.cpp
示例3: throw
HPF::HPF(UGen const& input, UGen const& freq) throw()
{
int numChannels = 1;
numChannels = input.getNumChannels() > numChannels ? input.getNumChannels() : numChannels;
numChannels = freq.getNumChannels() > numChannels ? freq.getNumChannels() : numChannels;
initInternal(numChannels);
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new HPFUGenInternal(input, freq);
}
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:13,代码来源:ugen_HPF.cpp
示例4: throw
MulAdd::MulAdd(UGen const& input, UGen const& mul, UGen const& add) throw()
{
UGen inputs[] = { input, mul, add };
const int numInputChannels = findMaxInputChannels(numElementsInArray(inputs), inputs);
ugen_assert(numInputChannels > 0);
initInternal(numInputChannels);
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new MulAddUGenInternal(input, mul, add);
internalUGens[i]->initValue(input.getValue(i) * mul.getValue(i) + add.getValue(i));
}
}
开发者ID:kazu2012,项目名称:ofxUGen,代码行数:14,代码来源:ugen_MulAdd.cpp
示例5: getMappedParameterControl
UGen UGenPlugin::constructGraph(UGen const& input)
{
UGen wet = getMappedParameterControl(UGenInterface::Parameters::Wet).lag();
UGen dry = getMappedParameterControl(UGenInterface::Parameters::Dry).lag();
plug = Plug::AR(UGen::emptyChannels(getNumOutputChannels()));
if(irBuffer.isNull())
plug.setSource(inputUGen);
else
plug.setSource(getConv());
return (plug * wet.dbamp() + input * dry.dbamp());
}
开发者ID:0x4d52,项目名称:ugen,代码行数:14,代码来源:UGenPlugin.cpp
示例6: throw
SAH::SAH(UGen const& input, UGen const& trig) throw()
{
UGen inputs[] = { input, trig };
const int numInputChannels = findMaxInputChannels(numElementsInArray(inputs), inputs);
initInternal(numInputChannels);
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new SAHUGenInternal(input, trig);
if(trig.getValue(i) <= 0.f)
internalUGens[i]->initValue(0.f);
else
internalUGens[i]->initValue(input.getValue(i));
}
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:15,代码来源:ugen_Triggers.cpp
示例7: throw
FSinOsc::FSinOsc(UGen const& freq) throw()
{
initInternal(freq.getNumChannels());
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new FSinOscUGenInternal(freq, 0.f, i);
}
}
开发者ID:kazu2012,项目名称:ofxUGen,代码行数:8,代码来源:ugen_FSinOsc.cpp
示例8: throw
BEGIN_UGEN_NAMESPACE
#include "../core/ugen_UGenArray.h"
#include "../buffers/ugen_Buffer.h"
#include "ugen_UnaryOpUGens.h"
UnaryOpUGenInternal::UnaryOpUGenInternal(UGen const& operand, const int channel) throw()
: UGenInternal(NumInputs)
{
if(channel < 0)
inputs[Operand] = operand;
else
{
int numChannels = operand.getNumChannels();
UGenInternal* internal = operand.getInternalUGen(channel % numChannels);
inputs[Operand] = UGen(internal->getChannelInternal(channel), channel);
}
}
开发者ID:satoruhiga,项目名称:ofxUGen,代码行数:18,代码来源:ugen_UnaryOpUGens.cpp
示例9: throw
Correlation::Correlation(UGen const& inputA,
UGen const& inputB,
const int length,
const int initialDelay) throw()
{
const int lengthChecked = ugen::clip(length, 1, 2044);
const int numInputChannels = ugen::max(inputA.getNumChannels(), inputB.getNumChannels());
initInternal(numInputChannels);
for(int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new CorrelationUGenInternal(inputA,
inputB,
lengthChecked,
initialDelay);
}
}
开发者ID:kazu2012,项目名称:ofxUGen,代码行数:18,代码来源:ugen_Correlation.cpp
示例10: throw
Trig::Trig(UGen const& input) throw()
{
initInternal(input.getNumChannels());
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new TrigUGenInternal(input);
}
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:9,代码来源:ugen_Trig.cpp
示例11: throw
BlockDelay::BlockDelay(UGen const& input) throw()
{
int numChannels = input.getNumChannels();
initInternal(numChannels);
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new BlockDelayUGenInternal(input);
}
}
开发者ID:ktechkez,项目名称:Karplus-test-project,代码行数:9,代码来源:ugen_BlockDelay.cpp
示例12: throw
SinOsc::SinOsc(UGen const& freq, Buffer const& initialPhase) throw()
{
int numChannels = ugen::max(freq.getNumChannels(), initialPhase.size());
initInternal(numChannels);
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new TableOscUGenInternal(freq, initialPhase.wrapAt(i), Buffer::getTableSine8192());
}
}
开发者ID:kazu2012,项目名称:ofxUGen,代码行数:11,代码来源:ugen_TableOsc.cpp
示例13: throw
LagUD::LagUD(UGen const& input, UGen const& lagTimeUp, UGen const& lagTimeDown) throw()
{
UGen inputs[] = { input, lagTimeUp, lagTimeDown };
const int numInputChannels = findMaxInputChannels(numElementsInArray(inputs), inputs);
initInternal(numInputChannels);
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new LagUDUGenInternal(input, lagTimeUp, lagTimeDown);
internalUGens[i]->initValue(input.getValue(i));
}
}
开发者ID:kazu2012,项目名称:ofxUGen,代码行数:12,代码来源:ugen_Lag.cpp
示例14: throw
bool VoicerBaseUGenInternal::sendMidiNote(const int midiChannel,
const int midiNote,
const int velocity) throw()
{
const int userData = createUserData(midiChannel, midiNote);
ugen_assert(userData != UGen::defaultUserData);
ugen_assert(velocity >= 0);
if(velocity > 0)
{
if(numVoices_ > 0)
{
const int voicesUsed = countNonstealingVoices();
if(voicesUsed >= numVoices_)
{
UGen stealee = chooseStealee();
if(stealee.isNotNull())
{
stealee.userData = stealingUserData;
stealee.steal(forcedSteal_);
}
}
}
// stop double notes, AU lab was sending two ons but only one off
// stealNote(midiChannel, midiNote, false, true); // let's only do this in the Juce version..
UGen newEvent = spawnEvent(*this, currentEventIndex++, midiChannel, midiNote, velocity);
if(newEvent.isNotNull())
{
newEvent.userData = userData;
events.add(newEvent);
}
}
else
{
UGen releasee = chooseReleasee(midiChannel, midiNote);
if(releasee.isNotNull())
{
//releasee.userData = UGen::defaultUserData; // need to rethink why I really wanted to do this
releasee.release();
}
}
return true;
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:50,代码来源:ugen_VoicerBase.cpp
示例15: throw
BEGIN_UGEN_NAMESPACE
#include "ugen_JuceMultiSlider.h"
MultiSliderUGenInternal::MultiSliderUGenInternal(UGen const& input, MultiSlider *_sliders) throw()
: ProxyOwnerUGenInternal(NumInputs, input.getNumChannels()-1),
sliders(_sliders->attachToMultiSliderUGenInternal() ? _sliders : 0),
values(sliders && input.getNumChannels() ? new double[input.getNumChannels()] : 0)
{
inputs[Input] = input;
if(values)
memset(values, 0, input.getNumChannels() * sizeof(double));
if(sliders)// && sliders->isValidComponent())
{
sliders->getInterceptsMouseClicks(oldClick, oldChildClick);
sliders->setInterceptsMouseClicks(false, false);
sliders->setNumSliders(input.getNumChannels());
for(int i = 0; i < input.getNumChannels(); i++)
{
values[i] = sliders->getSlider(i)->getValue();
}
startTimer(40);
}
}
开发者ID:kazu2012,项目名称:ofxUGen,代码行数:30,代码来源:ugen_JuceMultiSlider.cpp
示例16: throw
karplusUGen::karplusUGen(UGen const& input,
const float minFreq,
UGen const& fundamental,
UGen const& decayTime,
UGen const& cutoff) throw()
{
initInternal(input.getNumChannels());
for(unsigned int i = 0; i < numInternalUGens; i++)
{
internalUGens[i] = new karplusUGenInternal(input, minFreq, fundamental, decayTime, cutoff);
}
}
开发者ID:ktechkez,项目名称:Karplus-test-project,代码行数:13,代码来源:karplusUGen.cpp
示例17: throw
BEGIN_UGEN_NAMESPACE
#include "ugen_iPhoneAudioFileDiskOut.h"
#include "ugen_NSUtilities.h"
DiskOutUGenInternal::DiskOutUGenInternal(AudioFileID audioFile, AudioStreamBasicDescription const& format, UGen const& input) throw()
: ProxyOwnerUGenInternal(NumInputs, input.getNumChannels() - 1),
audioFile_(audioFile),
numChannels(input.getNumChannels()),
currentPacket(0),
allocatedBlockSize(0),
allocatedBlockSizeInBytes(0),
audioData(0),
bytesPerFrame(format.mBytesPerFrame)
{
inputs[Input] = input;
if(audioFile_)
{
allocatedBlockSize = UGen::getEstimatedBlockSize();
allocatedBlockSizeInBytes = allocatedBlockSize * bytesPerFrame;
audioData = malloc(allocatedBlockSizeInBytes + 4); // pad a little for 24 bit
}
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:24,代码来源:ugen_iPhoneAudioFileDiskOut.cpp
示例18: throw
FFTMagnitudeSelection::FFTMagnitudeSelection(UGen const& input,
FFTEngine const& fft,
const int overlap,
IntArray const& bins) throw()
{
int overlapChecked = Bits::isPowerOf2(overlap) ? overlap : Bits::nextPowerOf2(overlap);
ugen_assert(overlap != overlapChecked); // should be power of 2
FFTMagnitudeSelectionUGenInternal *fftMag = new FFTMagnitudeSelectionUGenInternal(input.mix(),
fft,
overlapChecked,
bins);
initInternal(fftMag->getNumBins());
generateFromProxyOwner(fftMag);
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:17,代码来源:ugen_FFTMagnitudeSelection.cpp
示例19: draw
void draw()
{
ofFill();
ofSetColor(255, amp.getValue() * 255);
ofCircle(pos.x, pos.y, amp.getValue() * 100);
ofNoFill();
ofSetColor(255);
ofCircle(pos.x, pos.y, amp.getValue() * 80);
}
开发者ID:satoruhiga,项目名称:ofxUGen,代码行数:10,代码来源:testApp.cpp
示例20: ofGetMouseX
MySynth()
{
pos.x = ofGetMouseX();
pos.y = ofGetMouseY();
float freq = ofMap(pos.x, 0, ofGetHeight(), 0, 2000);
float pan = ofMap(pos.y, 0, ofGetWidth(), -1, 1);
Env env = Env::perc(0.5, 1.5, 0.3, EnvCurve::Sine);
envgen = EnvGen::AR(env);
envgen.addDoneActionReceiver(this);
amp = SinOsc::AR(ofRandom(4.0), 0, 0.5, 0.5) * envgen;
Out(
Pan2::AR(SinOsc::AR(freq) * amp, pan)
);
}
开发者ID:satoruhiga,项目名称:ofxUGen,代码行数:18,代码来源:testApp.cpp
注:本文中的UGen类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论