summaryrefslogtreecommitdiffstats
path: root/src/server/internals
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-14 05:11:04 +0000
committerDavid Robillard <d@drobilla.net>2012-05-14 05:11:04 +0000
commitbf7116520bc723980edb1120eaa66455a4c66ca5 (patch)
treedb8320d389e5ecdecbf7df8efbb3962f5a851648 /src/server/internals
parent1952ad39639b620a8ce43b0b0edf5c1283e5e8c5 (diff)
downloadingen-bf7116520bc723980edb1120eaa66455a4c66ca5.tar.gz
ingen-bf7116520bc723980edb1120eaa66455a4c66ca5.tar.bz2
ingen-bf7116520bc723980edb1120eaa66455a4c66ca5.zip
Tidy.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4410 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/internals')
-rw-r--r--src/server/internals/Controller.cpp2
-rw-r--r--src/server/internals/Controller.hpp13
-rw-r--r--src/server/internals/Delay.cpp38
-rw-r--r--src/server/internals/Delay.hpp13
-rw-r--r--src/server/internals/Note.cpp25
-rw-r--r--src/server/internals/Note.hpp13
-rw-r--r--src/server/internals/Trigger.cpp15
-rw-r--r--src/server/internals/Trigger.hpp13
8 files changed, 63 insertions, 69 deletions
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index 1e6cc594..41b56a77 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -119,7 +119,7 @@ ControllerNode::control(ProcessContext& context, uint8_t control_num, uint8_t va
// FIXME: not thread safe
_param_port->set_value(context.engine().world()->forge().make(control_num));
((AudioBuffer*)_param_port->buffer(0).get())->set_value(
- (float)control_num, context.start(), context.end());
+ (float)control_num, context.start(), context.end());
_param_port->broadcast_value(context, true);
_learning = false;
}
diff --git a/src/server/internals/Controller.hpp b/src/server/internals/Controller.hpp
index de87876e..5672d8ab 100644
--- a/src/server/internals/Controller.hpp
+++ b/src/server/internals/Controller.hpp
@@ -39,13 +39,12 @@ namespace Internals {
class ControllerNode : public NodeImpl
{
public:
- ControllerNode(
- InternalPlugin* plugin,
- BufferFactory& bufs,
- const std::string& path,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate);
+ ControllerNode(InternalPlugin* plugin,
+ BufferFactory& bufs,
+ const std::string& path,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate);
void process(ProcessContext& context);
diff --git a/src/server/internals/Delay.cpp b/src/server/internals/Delay.cpp
index fa0cb897..f825ffa5 100644
--- a/src/server/internals/Delay.cpp
+++ b/src/server/internals/Delay.cpp
@@ -38,7 +38,7 @@
#define LOG(s) s << "[DelayNode] "
#define CALC_DELAY(delaytime) \
- (f_clamp (delaytime * (float)sample_rate, 1.0f, (float)(buffer_mask + 1)))
+ (f_clamp (delaytime * (float)sample_rate, 1.0f, (float)(buffer_mask + 1)))
using namespace std;
@@ -52,13 +52,12 @@ InternalPlugin* DelayNode::internal_plugin(Shared::URIs& uris) {
return new InternalPlugin(uris, NS_INTERNALS "Delay", "delay");
}
-DelayNode::DelayNode(
- InternalPlugin* plugin,
- BufferFactory& bufs,
- const std::string& path,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate)
+DelayNode::DelayNode(InternalPlugin* plugin,
+ BufferFactory& bufs,
+ const std::string& path,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate)
: NodeImpl(plugin, path, polyphonic, parent, srate)
, _buffer(0)
, _buffer_length(0)
@@ -134,9 +133,10 @@ static inline float f_clamp(float x, float a, float b)
static inline float cube_interp(const float fr, const float inm1, const float
in, const float inp1, const float inp2)
{
- return in + 0.5f * fr * (inp1 - inm1 +
- fr * (4.0f * inp1 + 2.0f * inm1 - 5.0f * in - inp2 +
- fr * (3.0f * (in - inp1) - inm1 + inp2)));
+ return in + 0.5f * fr * (
+ inp1 - inm1 + fr * (
+ 4.0f * inp1 + 2.0f * inm1 - 5.0f * in - inp2 + fr * (
+ 3.0f * (in - inp1) - inm1 + inp2)));
}
void
@@ -171,10 +171,10 @@ DelayNode::process(ProcessContext& context)
for (uint32_t i = 0; i < sample_count; i++) {
int64_t read_phase = write_phase - (int64_t)delay_samples;
const float read = cube_interp(frac,
- buffer_at(read_phase - 1),
- buffer_at(read_phase),
- buffer_at(read_phase + 1),
- buffer_at(read_phase + 2));
+ buffer_at(read_phase - 1),
+ buffer_at(read_phase),
+ buffer_at(read_phase + 1),
+ buffer_at(read_phase + 2));
buffer_at(write_phase++) = in[i];
out[i] = read;
}
@@ -189,10 +189,10 @@ DelayNode::process(ProcessContext& context)
const int64_t idelay_samples = (int64_t)delay_samples;
const float frac = delay_samples - idelay_samples;
const float read = cube_interp(frac,
- buffer_at(read_phase - 1),
- buffer_at(read_phase),
- buffer_at(read_phase + 1),
- buffer_at(read_phase + 2));
+ buffer_at(read_phase - 1),
+ buffer_at(read_phase),
+ buffer_at(read_phase + 1),
+ buffer_at(read_phase + 2));
buffer_at(write_phase) = in[i];
out[i] = read;
}
diff --git a/src/server/internals/Delay.hpp b/src/server/internals/Delay.hpp
index 4cca4ed7..e9695ecc 100644
--- a/src/server/internals/Delay.hpp
+++ b/src/server/internals/Delay.hpp
@@ -35,13 +35,12 @@ namespace Internals {
class DelayNode : public NodeImpl
{
public:
- DelayNode(
- InternalPlugin* plugin,
- BufferFactory& bufs,
- const std::string& path,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate);
+ DelayNode(InternalPlugin* plugin,
+ BufferFactory& bufs,
+ const std::string& path,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate);
~DelayNode();
diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp
index e131fb69..e603c711 100644
--- a/src/server/internals/Note.cpp
+++ b/src/server/internals/Note.cpp
@@ -47,13 +47,12 @@ InternalPlugin* NoteNode::internal_plugin(Shared::URIs& uris) {
return new InternalPlugin(uris, NS_INTERNALS "Note", "note");
}
-NoteNode::NoteNode(
- InternalPlugin* plugin,
- BufferFactory& bufs,
- const std::string& path,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate)
+NoteNode::NoteNode(InternalPlugin* plugin,
+ BufferFactory& bufs,
+ const std::string& path,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate)
: NodeImpl(plugin, path, polyphonic, parent, srate)
, _voices(new Raul::Array<Voice>(_polyphony))
, _prepared_voices(NULL)
@@ -232,7 +231,7 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F
#ifdef RAUL_LOG_DEBUG
LOG(debug) << "Note " << (int)note_num << " on @ " << time
- << ". Voice " << voice_num << " / " << _polyphony << endl;
+ << ". Voice " << voice_num << " / " << _polyphony << endl;
#endif
// Update stolen key, if applicable
@@ -259,17 +258,17 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F
assert(_keys[voice->note].voice == voice_num);
((AudioBuffer*)_freq_port->buffer(voice_num).get())->set_value(
- note_to_freq(note_num), context.start(), time);
+ note_to_freq(note_num), context.start(), time);
((AudioBuffer*)_vel_port->buffer(voice_num).get())->set_value(
- velocity/127.0, context.start(), time);
+ velocity/127.0, context.start(), time);
((AudioBuffer*)_gate_port->buffer(voice_num).get())->set_value(
- 1.0f, context.start(), time);
+ 1.0f, context.start(), time);
// trigger (one sample)
((AudioBuffer*)_trig_port->buffer(voice_num).get())->set_value(
- 1.0f, context.start(), time);
+ 1.0f, context.start(), time);
((AudioBuffer*)_trig_port->buffer(voice_num).get())->set_value(
- 0.0f, context.start(), time + 1);
+ 0.0f, context.start(), time + 1);
assert(key->state == Key::Key::ON_ASSIGNED);
assert(voice->state == Voice::Voice::ACTIVE);
diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp
index 22aaee7d..591214ce 100644
--- a/src/server/internals/Note.hpp
+++ b/src/server/internals/Note.hpp
@@ -39,13 +39,12 @@ namespace Internals {
class NoteNode : public NodeImpl
{
public:
- NoteNode(
- InternalPlugin* plugin,
- BufferFactory& bufs,
- const std::string& path,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate);
+ NoteNode(InternalPlugin* plugin,
+ BufferFactory& bufs,
+ const std::string& path,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate);
~NoteNode();
diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp
index ae06d3b6..3c33f958 100644
--- a/src/server/internals/Trigger.cpp
+++ b/src/server/internals/Trigger.cpp
@@ -43,13 +43,12 @@ InternalPlugin* TriggerNode::internal_plugin(Shared::URIs& uris) {
return new InternalPlugin(uris, NS_INTERNALS "Trigger", "trigger");
}
-TriggerNode::TriggerNode(
- InternalPlugin* plugin,
- BufferFactory& bufs,
- const std::string& path,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate)
+TriggerNode::TriggerNode(InternalPlugin* plugin,
+ BufferFactory& bufs,
+ const std::string& path,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate)
: NodeImpl(plugin, path, false, parent, srate)
, _learning(false)
{
@@ -136,7 +135,7 @@ TriggerNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity
// FIXME
//_note_port->set_value(note_num);
((AudioBuffer*)_note_port->buffer(0).get())->set_value(
- (float)note_num, context.start(), context.end());
+ (float)note_num, context.start(), context.end());
_note_port->broadcast_value(context, true);
_learning = false;
}
diff --git a/src/server/internals/Trigger.hpp b/src/server/internals/Trigger.hpp
index 0c1f779b..5bbae82d 100644
--- a/src/server/internals/Trigger.hpp
+++ b/src/server/internals/Trigger.hpp
@@ -42,13 +42,12 @@ namespace Internals {
class TriggerNode : public NodeImpl
{
public:
- TriggerNode(
- InternalPlugin* plugin,
- BufferFactory& bufs,
- const std::string& path,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate);
+ TriggerNode(InternalPlugin* plugin,
+ BufferFactory& bufs,
+ const std::string& path,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate);
void process(ProcessContext& context);