diff options
author | David Robillard <d@drobilla.net> | 2007-02-22 04:16:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-22 04:16:05 +0000 |
commit | 8cc603cd24294c0d917b37ea0568d89962b5a74f (patch) | |
tree | 9bb04036640c853bb67492efa81322601ad5972f /src/engine/machina | |
parent | 1429e4b2279566384ec09bfe3bfe7d7e0f0f79eb (diff) | |
download | machina-8cc603cd24294c0d917b37ea0568d89962b5a74f.tar.gz machina-8cc603cd24294c0d917b37ea0568d89962b5a74f.tar.bz2 machina-8cc603cd24294c0d917b37ea0568d89962b5a74f.zip |
Machina quantization, various timing related fixes.
git-svn-id: http://svn.drobilla.net/lad/machina@326 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/machina')
-rw-r--r-- | src/engine/machina/JackDriver.hpp | 6 | ||||
-rw-r--r-- | src/engine/machina/LearnRequest.hpp | 12 |
2 files changed, 7 insertions, 11 deletions
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> _machine; @@ -65,6 +66,7 @@ private: Raul::TimeSlice _cycle_time; Raul::DoubleBuffer<double> _bpm; + Raul::DoubleBuffer<double> _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>& node() { return _node; } @@ -70,6 +63,7 @@ private: bool _started; BeatTime _start_time; + double _quantization; SharedPtr<Node> _node; SharedPtr<MidiAction> _enter_action; SharedPtr<MidiAction> _exit_action; |