From 8cc603cd24294c0d917b37ea0568d89962b5a74f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 22 Feb 2007 04:16:05 +0000 Subject: Machina quantization, various timing related fixes. git-svn-id: http://svn.drobilla.net/lad/machina@326 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/machina/JackDriver.hpp | 6 ++++-- src/engine/machina/LearnRequest.hpp | 12 +++--------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src/engine/machina') diff --git a/src/engine/machina/JackDriver.hpp b/src/engine/machina/JackDriver.hpp index e52af88..1f9b197 100644 --- a/src/engine/machina/JackDriver.hpp +++ b/src/engine/machina/JackDriver.hpp @@ -51,10 +51,11 @@ public: size_t size, const unsigned char* event); - void set_bpm(double bpm) { _bpm.set(bpm); } + void set_bpm(double bpm) { _bpm.set(bpm); } + void set_quantization(double quantization) { _quantization.set(quantization); } private: - void process_input(jack_nframes_t nframes); + void process_input(const Raul::TimeSlice& time); virtual void on_process(jack_nframes_t nframes); SharedPtr _machine; @@ -65,6 +66,7 @@ private: Raul::TimeSlice _cycle_time; Raul::DoubleBuffer _bpm; + Raul::DoubleBuffer _quantization; }; diff --git a/src/engine/machina/LearnRequest.hpp b/src/engine/machina/LearnRequest.hpp index f485560..9284e90 100644 --- a/src/engine/machina/LearnRequest.hpp +++ b/src/engine/machina/LearnRequest.hpp @@ -43,16 +43,9 @@ public: return ret; } - // Add the learned actions to the node - void finish(BeatTime time) - { - _node->add_enter_action(_enter_action); - _node->add_exit_action(_exit_action); - _node->set_duration(time - _start_time); - std::cerr << "LEARN DURATION: " << _node->duration() << std::endl; - } + void finish(BeatTime time); - void start(BeatTime time) { _started = true; _start_time = time; } + void start(double q, BeatTime time) { _started = true; _start_time = time; _quantization = q; } bool started() { return _started; } const SharedPtr& node() { return _node; } @@ -70,6 +63,7 @@ private: bool _started; BeatTime _start_time; + double _quantization; SharedPtr _node; SharedPtr _enter_action; SharedPtr _exit_action; -- cgit v1.2.1