diff options
author | David Robillard <d@drobilla.net> | 2007-09-21 00:46:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-21 00:46:21 +0000 |
commit | 2fd281a285e4b0bc31e0a0dc6f970359440612c8 (patch) | |
tree | b4537d5196d13608cacb32f4c96bdb24ff180b3d /src/libs/engine/MidiNoteNode.cpp | |
parent | c4faafc0d3b9c68d41706ad40edde1ecfb7f4338 (diff) | |
download | ingen-2fd281a285e4b0bc31e0a0dc6f970359440612c8.tar.gz ingen-2fd281a285e4b0bc31e0a0dc6f970359440612c8.tar.bz2 ingen-2fd281a285e4b0bc31e0a0dc6f970359440612c8.zip |
Somewhat functional dynamic polyphony (LV2 and internal nodes only).
git-svn-id: http://svn.drobilla.net/lad/ingen@744 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/MidiNoteNode.cpp')
-rw-r--r-- | src/libs/engine/MidiNoteNode.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libs/engine/MidiNoteNode.cpp b/src/libs/engine/MidiNoteNode.cpp index 3ac33a68..a5b29f85 100644 --- a/src/libs/engine/MidiNoteNode.cpp +++ b/src/libs/engine/MidiNoteNode.cpp @@ -87,9 +87,10 @@ MidiNoteNode::prepare_poly(uint32_t poly) NodeBase::prepare_poly(poly); + if (_prepared_voices && poly <= _prepared_voices->size()) + return true; + _prepared_voices = new Raul::Array<Voice>(poly, *_voices); - - cerr << path() << " prepared poly " << poly << endl; return true; } @@ -113,8 +114,6 @@ MidiNoteNode::apply_poly(Raul::Maid& maid, uint32_t poly) _polyphony = poly; assert(_voices->size() >= _polyphony); - cerr << path() << " applied poly " << poly << endl; - return true; } @@ -219,7 +218,8 @@ MidiNoteNode::note_on(uchar note_num, uchar velocity, FrameTime time, SampleCoun assert(voice != NULL); assert(voice == &(*_voices)[voice_num]); - //cerr << "[MidiNoteNode] Note on @ " << time << ". Key " << (int)note_num << ", Voice " << voice_num << endl; + //cerr << "[MidiNoteNode] Note " << (int)note_num << " on @ " << time + // << ". Voice " << voice_num << " / " << _polyphony << endl; // Update stolen key, if applicable if (voice->state == Voice::Voice::ACTIVE) { @@ -300,7 +300,7 @@ MidiNoteNode::note_off(uchar note_num, FrameTime time, SampleCount nframes, Fram void -MidiNoteNode::free_voice(size_t voice, FrameTime time, SampleCount nframes, FrameTime start, FrameTime end) +MidiNoteNode::free_voice(uint32_t voice, FrameTime time, SampleCount nframes, FrameTime start, FrameTime end) { assert(time >= start && time <= end); assert(time - start < _buffer_size); |