diff options
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/engine/AudioBuffer.cpp | 5 | ||||
-rw-r--r-- | src/libs/engine/MidiNoteNode.cpp | 4 | ||||
-rw-r--r-- | src/libs/engine/MidiTriggerNode.cpp | 7 | ||||
-rw-r--r-- | src/libs/engine/events/CreatePortEvent.cpp | 4 | ||||
-rw-r--r-- | src/libs/gui/PatchWindow.cpp | 2 | ||||
-rw-r--r-- | src/libs/serialisation/Serialiser.cpp | 2 |
6 files changed, 9 insertions, 15 deletions
diff --git a/src/libs/engine/AudioBuffer.cpp b/src/libs/engine/AudioBuffer.cpp index b874d527..5eea7103 100644 --- a/src/libs/engine/AudioBuffer.cpp +++ b/src/libs/engine/AudioBuffer.cpp @@ -129,8 +129,11 @@ AudioBuffer::clear() void AudioBuffer::set_value(Sample val, FrameTime cycle_start, FrameTime time) { + if (_size == 1) + time = cycle_start; + FrameTime offset = time - cycle_start; - assert(offset < _size); + assert(offset <= _size); set_block(val, offset, _size - 1); diff --git a/src/libs/engine/MidiNoteNode.cpp b/src/libs/engine/MidiNoteNode.cpp index 53778f17..e9b36fbf 100644 --- a/src/libs/engine/MidiNoteNode.cpp +++ b/src/libs/engine/MidiNoteNode.cpp @@ -225,8 +225,8 @@ MidiNoteNode::note_on(ProcessContext& context, uchar note_num, uchar velocity, F assert(voice != NULL); assert(voice == &(*_voices)[voice_num]); - cerr << "[MidiNoteNode] Note " << (int)note_num << " on @ " << time - << ". Voice " << voice_num << " / " << _polyphony << 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) { diff --git a/src/libs/engine/MidiTriggerNode.cpp b/src/libs/engine/MidiTriggerNode.cpp index 7b210201..65f9833e 100644 --- a/src/libs/engine/MidiTriggerNode.cpp +++ b/src/libs/engine/MidiTriggerNode.cpp @@ -107,19 +107,14 @@ MidiTriggerNode::note_on(ProcessContext& context, uchar note_num, uchar velocity assert(time >= context.start() && time <= context.end()); assert(time - context.start() < _buffer_size); - cerr << "[MidiTriggerNode] " << path() << " Note " << (int)note_num << " on @ " << time << endl; + /*cerr << "[MidiTriggerNode] " << path() << " Note " << (int)note_num << " on @ " << time << endl;*/ Sample filter_note = ((AudioBuffer*)_note_port->buffer(0))->value_at(0); - cerr << "note: " << (int)note_num << ", filter: " << filter_note << endl; if (filter_note >= 0.0 && filter_note < 127.0 && (note_num == (uchar)filter_note)) { - - cerr << "!\n"; - ((AudioBuffer*)_gate_port->buffer(0))->set_value(1.0f, context.start(), time); ((AudioBuffer*)_trig_port->buffer(0))->set_value(1.0f, context.start(), time); ((AudioBuffer*)_trig_port->buffer(0))->set_value(0.0f, context.start(), time + 1); ((AudioBuffer*)_vel_port->buffer(0))->set_value(velocity / 127.0f, context.start(), time); - assert(((AudioBuffer*)_trig_port->buffer(0))->data()[time - context.start()] == 1.0f); } } diff --git a/src/libs/engine/events/CreatePortEvent.cpp b/src/libs/engine/events/CreatePortEvent.cpp index 272ef561..aca33c67 100644 --- a/src/libs/engine/events/CreatePortEvent.cpp +++ b/src/libs/engine/events/CreatePortEvent.cpp @@ -113,7 +113,7 @@ CreatePortEvent::pre_process() if (_type == "ingen:AudioPort") _driver_port = _engine.audio_driver()->create_port( dynamic_cast<DuplexPort*>(_patch_port)); - else if (_type == "ingen:MIDIPort") + else if (_type == "ingen:MIDIPort" || _type == "ingen:EventPort") _driver_port = _engine.midi_driver()->create_port( dynamic_cast<DuplexPort*>(_patch_port)); else if (_type == "ingen:OSCPort" && _engine.osc_driver()) @@ -145,7 +145,7 @@ CreatePortEvent::execute(ProcessContext& context) if (_driver_port) { if (_type == "ingen:AudioPort") _engine.audio_driver()->add_port(_driver_port); - else if (_type == "ingen:MIDIPort") + else if (_type == "ingen:MIDIPort" || _type == "ingen:EventPort") _engine.midi_driver()->add_port(_driver_port); else if (_type == "ingen:OSCPort") cerr << "OSC DRIVER PORT" << endl; diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index 9367f2d7..fc455a87 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -340,8 +340,6 @@ PatchWindow::event_save_as() int result = dialog.run(); //bool recursive = recursive_checkbutton.get_active(); - assert(result == Gtk::RESPONSE_OK || result == Gtk::RESPONSE_CANCEL || result == Gtk::RESPONSE_NONE); - if (result == Gtk::RESPONSE_OK) { string filename = dialog.get_filename(); if (filename.length() < 11 || filename.substr(filename.length()-10) != ".ingen.ttl") diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp index 710a538c..e93fb0d7 100644 --- a/src/libs/serialisation/Serialiser.cpp +++ b/src/libs/serialisation/Serialiser.cpp @@ -100,8 +100,6 @@ Serialiser::start_to_filename(const string& filename) { setlocale(LC_NUMERIC, "C"); - cout << "STARTING SERIALIZATION TO FILENAME: " << filename << endl; - assert(filename.find(":") == string::npos || filename.substr(0, 5) == "file:"); if (filename.find(":") == string::npos) _base_uri = "file://" + filename; |