Skip to content

Commit

Permalink
Some work on the metronome
Browse files Browse the repository at this point in the history
  • Loading branch information
topisani committed Nov 23, 2017
1 parent 2317563 commit 3573ea3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/core/audio/main_audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ namespace otto::audio {
{
auto synth_out = Globals::synth.process(midi_in);
auto drums_out = Globals::drums.process(midi_in);
for (auto&& [dst, src] : util::zip(drums_out, synth_out)) {
util::audio::add_all(src, dst);
auto mtrnm_out = Globals::metronome.process(midi_in);
for (auto&& [drm, snth, mtrn] : util::zip(drums_out, synth_out, mtrnm_out)) {
util::audio::add_all(drm, snth);
util::audio::add_all(drm, mtrn);
}
return Globals::effect.process(drums_out);
}
Expand Down
4 changes: 3 additions & 1 deletion src/core/audio/processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ namespace otto {
auto res = *this;
length = length < 0 ? nframes - idx : length;
res.nframes = length;
res.audio = {audio.data() + idx, length};
if constexpr (channels != 0) {
res.audio = {audio.data() + idx, length};
}
return res;
}

Expand Down
1 change: 0 additions & 1 deletion src/modules/studio/metronome/metronome.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace otto::modules {
class Metronome : public Module, audio::FaustWrapper<0, 1> {

std::unique_ptr<MetronomeScreen> screen;
audio::ProcessBuffer<1> proc_buf;

using audio::FaustWrapper<0, 1>::process;

Expand Down
20 changes: 10 additions & 10 deletions src/util/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ namespace otto::util {

// Increment (Any)

iterator_adaptor_impl operator++()
iterator_adaptor_impl& operator++()
{
auto old = *this;
Impl::advance(1);
return old;
return *this;
}

iterator_adaptor_impl& operator++(int)
iterator_adaptor_impl operator++(int)
{
auto old = *this;
Impl::advance(1);
return *this;
return old;
}

// Dereference (Any)
Expand Down Expand Up @@ -192,17 +192,17 @@ namespace otto::util {

// Decrement (Bidirectional)

iterator_adaptor_impl operator--()
iterator_adaptor_impl& operator--()
{
auto old = *this;
Impl::advance(-1);
return old;
return *this;
}

iterator_adaptor_impl& operator--(int)
iterator_adaptor_impl operator--(int)
{
auto old = *this;
Impl::advance(-1);
return *this;
return old;
}
};

Expand Down

0 comments on commit 3573ea3

Please sign in to comment.