- this implements in the intention behind the previous commit.
a tempo mark is constant until its end has been changed by a
shift-drag on the next marker.
Timecode::BBT_Time bbt; /* 1|1|0 which is correct for the no-meter case */
if (have_initial_meter) {
- new_map.add_tempo (tempo, (t->time_pulses/smf.ppqn()) / 4.0, 0, TempoSection::Constant, MusicTime);
+ new_map.add_tempo (tempo, (t->time_pulses/smf.ppqn()) / 4.0, 0, MusicTime);
if (!(meter == last_meter)) {
bbt = new_map.bbt_at_quarter_note ((t->time_pulses/smf.ppqn()));
new_map.add_meter (meter, t->time_pulses, bbt, 0, MusicTime);
} else {
new_map.replace_meter (new_map.meter_section_at_frame (0), meter, bbt, pos, AudioTime);
- new_map.replace_tempo (new_map.tempo_section_at_frame (0), tempo, 0.0, pos, TempoSection::Constant, AudioTime);
+ new_map.replace_tempo (new_map.tempo_section_at_frame (0), tempo, 0.0, pos, AudioTime);
have_initial_meter = true;
}
} else {
const Tempo tempo (_marker->tempo());
const framepos_t frame = adjusted_current_frame (event) + 1;
- const TempoSection::Type type = _real_section->type();
_editor->begin_reversible_command (_("copy tempo mark"));
if (_real_section->position_lock_style() == MusicTime) {
const int32_t divisions = _editor->get_grid_music_divisions (event->button.state);
- _real_section = map.add_tempo (tempo, map.exact_qn_at_frame (frame, divisions), 0, type, MusicTime);
+ _real_section = map.add_tempo (tempo, map.exact_qn_at_frame (frame, divisions), 0, MusicTime);
} else {
- _real_section = map.add_tempo (tempo, 0.0, frame, type, AudioTime);
+ _real_section = map.add_tempo (tempo, 0.0, frame, AudioTime);
}
if (!_real_section) {
const double pulse = tsp->pulse();
const framepos_t frame = tsp->frame();
- const TempoSection::Type type = tsp->type();
const PositionLockStyle pls = (tsp->position_lock_style() == AudioTime) ? MusicTime : AudioTime;
const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
begin_reversible_command (_("change tempo lock style"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, type, pls);
+ _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
commit_reversible_command ();
}
}
-
+/* actally just resets the ts to constant using initial tempo */
void
Editor::toggle_tempo_type ()
{
if (tm) {
TempoSection* tsp = &tm->tempo();
- const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
+ const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type());
const double pulse = tsp->pulse();
const framepos_t frame = tsp->frame();
- const TempoSection::Type type = (tsp->type() == TempoSection::Ramp) ? TempoSection::Constant : TempoSection::Ramp;
const PositionLockStyle pls = tsp->position_lock_style();
- begin_reversible_command (_("change tempo type"));
+ begin_reversible_command (_("set tempo to constant"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, type, pls);
+ _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
} else if (t.frame() == start) {
_session->tempo_map().change_existing_tempo_at (start, beats_per_minute, t.note_type(), t.end_note_types_per_minute());
} else {
- const Tempo tempo (beats_per_minute, t.note_type(), t.end_note_types_per_minute());
- _session->tempo_map().add_tempo (tempo, 0.0, start, TempoSection::Constant, AudioTime);
+ /* constant tempo */
+ const Tempo tempo (beats_per_minute, t.note_type());
+ _session->tempo_map().add_tempo (tempo, 0.0, start, AudioTime);
}
XMLNode& after (_session->tempo_map().get_state());
if (pulse > 0.0) {
XMLNode &before = map.get_state();
/* add music-locked ramped (?) tempo using the bpm/note type at frame*/
- map.add_tempo (map.tempo_at_frame (frame), pulse, 0, TempoSection::Ramp, MusicTime);
+ map.add_tempo (map.tempo_at_frame (frame), pulse, 0, MusicTime);
XMLNode &after = map.get_state();
_session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
Timecode::BBT_Time when;
tempo_dialog.get_bbt_time (when);
- const TempoSection::Type ttype (tempo_dialog.get_tempo_type());
-
begin_reversible_command (_("replace tempo mark"));
XMLNode &before = _session->tempo_map().get_state();
if (tempo_dialog.get_lock_style() == AudioTime) {
framepos_t const f = _session->tempo_map().predict_tempo_position (section, when).second;
- _session->tempo_map().replace_tempo (*section, tempo, 0.0, f, ttype, AudioTime);
+ _session->tempo_map().replace_tempo (*section, tempo, 0.0, f, AudioTime);
} else {
double const p = _session->tempo_map().predict_tempo_position (section, when).first;
- _session->tempo_map().replace_tempo (*section, tempo, p, 0, ttype, MusicTime);
+ _session->tempo_map().replace_tempo (*section, tempo, p, 0, MusicTime);
}
XMLNode &after = _session->tempo_map().get_state();
Constant,
};
- TempoSection (const double& pulse, const double& minute, Tempo tempo, Type tempo_type, PositionLockStyle pls, framecnt_t sr)
- : MetricSection (pulse, minute, pls, true, sr), Tempo (tempo), _type (tempo_type), _c (0.0), _active (true), _locked_to_meter (false) {}
+ TempoSection (const double& pulse, const double& minute, Tempo tempo, PositionLockStyle pls, framecnt_t sr)
+ : MetricSection (pulse, minute, pls, true, sr), Tempo (tempo), _c (0.0), _active (true), _locked_to_meter (false) {}
TempoSection (const XMLNode&, const framecnt_t sample_rate);
double c () const { return _c; }
void set_c (double c) { _c = c; }
- void set_type (Type type);
- Type type () const { return _type; }
+ Type type () const { if (note_types_per_minute() == end_note_types_per_minute()) { return Constant; } else { return Ramp; } }
bool active () const { return _active; }
void set_active (bool yn) { _active = yn; }
this enables us to keep the tempo change at the same relative
position within the bar if/when the meter changes.
*/
- Type _type;
double _c;
bool _active;
bool _locked_to_meter;
* @param frame frame position of new section. ignored if pls == MusicTime
* @param type type of new tempo section (Ramp, Constant)
*/
- TempoSection* add_tempo (const Tempo&, const double& pulse, const framepos_t& frame, TempoSection::Type type, PositionLockStyle pls);
+ TempoSection* add_tempo (const Tempo&, const double& pulse, const framepos_t& frame, PositionLockStyle pls);
/** add a meter section locked to pls.. ignored values will be set in recompute_meters()
* @param meter the Meter to be added
void remove_tempo (const TempoSection&, bool send_signal);
void remove_meter (const MeterSection&, bool send_signal);
- void replace_tempo (TempoSection&, const Tempo&, const double& pulse, const framepos_t& frame
- , TempoSection::Type type, PositionLockStyle pls);
+ void replace_tempo (TempoSection&, const Tempo&, const double& pulse, const framepos_t& frame, PositionLockStyle pls);
void replace_meter (const MeterSection&, const Meter&, const Timecode::BBT_Time& where, framepos_t frame, PositionLockStyle pls);
void do_insert (MetricSection* section);
TempoSection* add_tempo_locked (const Tempo&, double pulse, double minute
- , TempoSection::Type type, PositionLockStyle pls, bool recompute, bool locked_to_meter = false);
+ , PositionLockStyle pls, bool recompute, bool locked_to_meter = false);
MeterSection* add_meter_locked (const Meter&, double beat, const Timecode::BBT_Time& where, framepos_t frame, PositionLockStyle pls, bool recompute);
set_active (string_is_affirmative (prop->value()));
}
- if ((prop = node.property ("tempo-type")) == 0) {
- _type = Constant;
- } else {
- _type = Type (string_2_enum (prop->value(), _type));
- }
-
if ((prop = node.property ("lock-style")) == 0) {
if (!initial()) {
set_position_lock_style (MusicTime);
root->add_property ("movable", buf);
snprintf (buf, sizeof (buf), "%s", active()?"yes":"no");
root->add_property ("active", buf);
- root->add_property ("tempo-type", enum_2_string (_type));
root->add_property ("lock-style", enum_2_string (position_lock_style()));
root->add_property ("locked-to-meter", locked_to_meter()?"yes":"no");
return *root;
}
-void
-TempoSection::set_type (Type type)
-{
- _type = type;
-}
-
/** returns the Tempo at the session-relative minute.
*/
Tempo
TempoSection::tempo_at_minute (const double& m) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && m < minute());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && m < minute());
if (constant) {
return Tempo (note_types_per_minute(), note_type());
}
double
TempoSection::minute_at_ntpm (const double& ntpm, const double& p) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && p < pulse());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && p < pulse());
if (constant) {
return ((p - pulse()) / pulses_per_minute()) + minute();
}
Tempo
TempoSection::tempo_at_pulse (const double& p) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && p < pulse());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && p < pulse());
if (constant) {
return Tempo (note_types_per_minute(), note_type());
double
TempoSection::pulse_at_ntpm (const double& ntpm, const double& m) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && m < minute());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && m < minute());
if (constant) {
return ((m - minute()) * pulses_per_minute()) + pulse();
}
double
TempoSection::pulse_at_minute (const double& m) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && m < minute());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && m < minute());
if (constant) {
return ((m - minute()) * pulses_per_minute()) + pulse();
}
double
TempoSection::minute_at_pulse (const double& p) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && p < pulse());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && p < pulse());
if (constant) {
return ((p - pulse()) / pulses_per_minute()) + minute();
}
double
TempoSection::pulse_at_frame (const framepos_t& f) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && f < frame());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && f < frame());
if (constant) {
return (minute_at_frame (f - frame()) * pulses_per_minute()) + pulse();
}
framepos_t
TempoSection::frame_at_pulse (const double& p) const
{
- const bool constant = _type == Constant || _c == 0.0 || (initial() && p < pulse());
+ const bool constant = type() == Constant || _c == 0.0 || (initial() && p < pulse());
if (constant) {
return frame_at_minute (((p - pulse()) / pulses_per_minute()) + minute());
}
double
TempoSection::compute_c_pulse (const double& end_npm, const double& end_pulse) const
{
- if (note_types_per_minute() == end_npm || _type == Constant) {
+ if (note_types_per_minute() == end_npm || type() == Constant) {
return 0.0;
}
double
TempoSection::compute_c_minute (const double& end_npm, const double& end_minute) const
{
- if (note_types_per_minute() == end_npm || _type == Constant) {
+ if (note_types_per_minute() == end_npm || type() == Constant) {
return 0.0;
}
_frame_rate = fr;
BBT_Time start (1, 1, 0);
- TempoSection *t = new TempoSection (0.0, 0.0, _default_tempo, TempoSection::Ramp, AudioTime, fr);
+ TempoSection *t = new TempoSection (0.0, 0.0, _default_tempo, AudioTime, fr);
MeterSection *m = new MeterSection (0.0, 0.0, 0.0, start, _default_meter.divisions_per_bar(), _default_meter.note_divisor(), AudioTime, fr);
t->set_initial (true);
*(dynamic_cast<Tempo*>(*i)) = *(dynamic_cast<Tempo*>(insert_tempo));
(*i)->set_position_lock_style (AudioTime);
- TempoSection* t;
- if ((t = dynamic_cast<TempoSection*>(*i)) != 0) {
- t->set_type (insert_tempo->type());
- }
need_add = false;
} else {
delete (*i);
}
/* user supplies the exact pulse if pls == MusicTime */
TempoSection*
-TempoMap::add_tempo (const Tempo& tempo, const double& pulse, const framepos_t& frame, ARDOUR::TempoSection::Type type, PositionLockStyle pls)
+TempoMap::add_tempo (const Tempo& tempo, const double& pulse, const framepos_t& frame, PositionLockStyle pls)
{
if (tempo.note_types_per_minute() <= 0.0) {
warning << "Cannot add tempo. note types per minute must be greater than zero." << endmsg;
TempoSection* prev_tempo = 0;
{
Glib::Threads::RWLock::WriterLock lm (lock);
- ts = add_tempo_locked (tempo, pulse, minute_at_frame (frame), type, pls, true);
+ ts = add_tempo_locked (tempo, pulse, minute_at_frame (frame), pls, true);
for (Metrics::iterator i = _metrics.begin(); i != _metrics.end(); ++i) {
if ((*i)->is_tempo()) {
}
void
-TempoMap::replace_tempo (TempoSection& ts, const Tempo& tempo, const double& pulse, const framepos_t& frame, TempoSection::Type type, PositionLockStyle pls)
+TempoMap::replace_tempo (TempoSection& ts, const Tempo& tempo, const double& pulse, const framepos_t& frame, PositionLockStyle pls)
{
if (tempo.note_types_per_minute() <= 0.0) {
warning << "Cannot replace tempo. note types per minute must be greater than zero." << endmsg;
TempoSection& first (first_tempo());
if (!ts.initial()) {
if (locked_to_meter) {
- ts.set_type (type);
{
/* cannot move a meter-locked tempo section */
*static_cast<Tempo*>(&ts) = tempo;
}
} else {
remove_tempo_locked (ts);
- new_ts = add_tempo_locked (tempo, pulse, minute_at_frame (frame), type, pls, true, locked_to_meter);
+ new_ts = add_tempo_locked (tempo, pulse, minute_at_frame (frame), pls, true, locked_to_meter);
if (new_ts && new_ts->type() == TempoSection::Constant) {
new_ts->set_end_note_types_per_minute (new_ts->note_types_per_minute());
}
} else {
- first.set_type (type);
first.set_pulse (0.0);
first.set_minute (minute_at_frame (frame));
first.set_position_lock_style (AudioTime);
TempoSection*
TempoMap::add_tempo_locked (const Tempo& tempo, double pulse, double minute
- , TempoSection::Type type, PositionLockStyle pls, bool recompute, bool locked_to_meter)
+ , PositionLockStyle pls, bool recompute, bool locked_to_meter)
{
- TempoSection* t = new TempoSection (pulse, minute, tempo, type, pls, _frame_rate);
+ TempoSection* t = new TempoSection (pulse, minute, tempo, pls, _frame_rate);
t->set_locked_to_meter (locked_to_meter);
do_insert (t);
if (pls == AudioTime) {
/* add meter-locked tempo */
- mlt = add_tempo_locked (tempo_at_minute_locked (_metrics, time_minutes), pulse, minute_at_frame (frame), TempoSection::Ramp, AudioTime, true, true);
+ mlt = add_tempo_locked (tempo_at_minute_locked (_metrics, time_minutes), pulse, minute_at_frame (frame), AudioTime, true, true);
if (!mlt) {
return 0;
goto out;
}
- /* this should be everywhere. no _type because type() is constant if note_types_per_minute() == end_types_per_minute()
- but what to do with legact sessions?
- */
- if (prev_t && prev_t->note_types_per_minute() != prev_t->end_note_types_per_minute()) {
+ if (prev_t && prev_t->type() == TempoSection::Ramp) {
prev_t->set_note_types_per_minute (new_bpm);
} else {
prev_t->set_end_note_types_per_minute (new_bpm);
recompute_meters (future_map);
if (check_solved (future_map)) {
- if (prev_t && prev_t->note_types_per_minute() != prev_t->end_note_types_per_minute()) {
+ if (prev_t && prev_t->type() == TempoSection::Ramp) {
ts->set_note_types_per_minute (new_bpm);
} else {
ts->set_end_note_types_per_minute (new_bpm);
goto out;
}
- if (prev_t && prev_t->type() == TempoSection::Ramp) {
- prev_t->set_end_note_types_per_minute (new_bpm);
- } else {
- if (prev_t) {
- prev_t->set_note_types_per_minute (new_bpm);
- prev_t->set_end_note_types_per_minute (prev_t->note_types_per_minute());
- }
- }
+ prev_t->set_end_note_types_per_minute (new_bpm);
recompute_tempi (future_map);
recompute_meters (future_map);
if (check_solved (future_map)) {
- if (prev_t && prev_t->type() == TempoSection::Ramp) {
- ts->set_end_note_types_per_minute (new_bpm);
- } else {
- if (prev_t) {
- ts->set_end_note_types_per_minute (prev_t->note_types_per_minute());
- ts->set_note_types_per_minute (prev_t->note_types_per_minute());
- }
- }
+ ts->set_end_note_types_per_minute (new_bpm);
+
recompute_tempi (_metrics);
recompute_meters (_metrics);
}
Meter meter (4, 4);
map.replace_meter (map.first_meter(), meter, BBT_Time (1, 1, 0), 0, AudioTime);
- map.replace_tempo (map.first_tempo(), tempo, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempo, 0.0, 0, AudioTime);
/* Add 1 beat to beat 3 of the first bar */
framepos_t r = map.framepos_plus_qn (frames_per_beat * 2, Evoral::Beats(1));
*/
Tempo tempoA (120, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
Tempo tempoB (240, 4.0);
- map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, MusicTime);
/* Now some tests */
*/
Tempo tempoA (120, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
Tempo tempoB (240, 4.0);
- map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, MusicTime);
Meter meterB (3, 8);
map.add_meter (meterB, 12.0, BBT_Time (4, 1, 0), 0, MusicTime);
*/
Tempo tempoA (120, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
Tempo tempoB (240, 4.0);
- map.add_tempo (tempoB, 12.0 / 4.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 12.0 / 4.0, 0, MusicTime);
Meter meterB (5, 8);
map.add_meter (meterB, 9.0, BBT_Time (4, 1, 0), 0, MusicTime);
/* Now some tests */
Meter meter (4, 4);
map.replace_meter (map.meter_section_at_frame (0), meter, BBT_Time (1, 1, 0), 0, AudioTime);
- map.replace_tempo (map.tempo_section_at_frame (0), tempo, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.tempo_section_at_frame (0), tempo, 0.0, 0, AudioTime);
/* Walk 1 beats-worth of frames from beat 3 */
double r = map.framewalk_to_qn (frames_per_beat * 2, frames_per_beat * 1).to_double();
*/
Tempo tempoA (120);
- map.replace_tempo (map.tempo_section_at_frame (0), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.tempo_section_at_frame (0), tempoA, 0.0, 0, AudioTime);
Tempo tempoB (240);
- map.add_tempo (tempoB, 12.0 / tempoB.note_type(), 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 12.0 / tempoB.note_type(), 0, MusicTime);
/* Now some tests */
*/
Tempo tempoA (120, 4.0);
- map.replace_tempo (map.tempo_section_at_frame (0), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.tempo_section_at_frame (0), tempoA, 0.0, 0, AudioTime);
Tempo tempoB (240, 4.0);
- map.add_tempo (tempoB, 4.0 / tempoB.note_type(), 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 4.0 / tempoB.note_type(), 0, MusicTime);
Tempo tempoC (160, 4.0);
- map.add_tempo (tempoC, 8.0 / tempoB.note_type(), 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoC, 8.0 / tempoB.note_type(), 0, MusicTime);
/* Walk from 1|3 to 4|1 */
double r = map.framewalk_to_qn (2 * 24e3, (2 * 24e3) + (4 * 12e3) + (4 * 18e3)).to_double();
Meter meter (7, 8);
map.replace_meter (map.meter_section_at_frame (0), meter, BBT_Time (1, 1, 0), 0, AudioTime);
- map.replace_tempo (map.tempo_section_at_frame (0), tempo, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.tempo_section_at_frame (0), tempo, 0.0, 0, AudioTime);
/* Walk 1 qn beats-worth of frames from beat 3 */
double r = map.framewalk_to_qn (frames_per_beat * 2, frames_per_beat * 1).to_double();
meter (4.0, 4.0)
{
_tempo_map = new TempoMap (FRAME_RATE);
- _tempo_map->add_tempo (tempo, 0.0, 0, TempoSection::Constant, AudioTime);
+ _tempo_map->add_tempo (tempo, 0.0, 0, AudioTime);
_tempo_map->add_meter (meter, 0.0, Timecode::BBT_Time(1, 1, 0), 0, AudioTime);
}
*/
Tempo tempoA (120.0, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
Tempo tempoB (240.0, 4.0);
- map.add_tempo (tempoB, 3.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 3.0, 0, MusicTime);
Meter meterB (3, 4);
map.add_meter (meterB, 12.0, BBT_Time (4, 1, 0), 0, MusicTime);
//map.dump (map._metrics, std::cout);
*/
Tempo tempoA (120.0, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
Tempo tempoB (240.0, 4.0);
- map.add_tempo (tempoB, 3.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 3.0, 0, MusicTime);
Meter meterB (3, 4);
map.add_meter (meterB, 12.0, BBT_Time (4, 1, 0), 288e3, MusicTime);
*/
Tempo tempoA (120.0, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
/* should have no effect on pulse */
Tempo tempoB (120.0, 4.0);
- map.add_tempo (tempoB, 2.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 2.0, 0, MusicTime);
/* equivalent to pulse 3.0 @ 120 bpm*/
Tempo tempoC (240.0, 4.0);
- map.add_tempo (tempoC, 0.0, 6 * sampling_rate, TempoSection::Constant, AudioTime);
+ map.add_tempo (tempoC, 0.0, 6 * sampling_rate, AudioTime);
Tempo tempoD (90.4, 4.0);
- map.add_tempo (tempoD, 9.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoD, 9.0, 0, MusicTime);
Tempo tempoE (110.6, 4.0);
- map.add_tempo (tempoE, 12.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoE, 12.0, 0, MusicTime);
Tempo tempoF (123.7, 4.0);
- map.add_tempo (tempoF, 15.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoF, 15.0, 0, MusicTime);
Tempo tempoG (111.8, 4.0);
- map.add_tempo (tempoG, 0.0, (framepos_t) 2 * 60 * sampling_rate, TempoSection::Constant, AudioTime);
+ map.add_tempo (tempoG, 0.0, (framepos_t) 2 * 60 * sampling_rate, AudioTime);
Meter meterB (3, 4);
map.add_meter (meterB, 12.0, BBT_Time (4, 1, 0), 288e3, MusicTime);
*/
- Tempo tempoA (120.2, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Ramp, AudioTime);
- Tempo tempoB (240.5, 4.0);
- map.add_tempo (tempoB, 3.0, 0, TempoSection::Ramp, MusicTime);
-
- Tempo tempoC (130.1, 4.0);
- map.add_tempo (tempoC, 0.0, 6 * sampling_rate, TempoSection::Ramp, AudioTime);
- Tempo tempoD (90.3, 4.0);
- map.add_tempo (tempoD, 9.0, 0, TempoSection::Ramp, MusicTime);
- Tempo tempoE (110.7, 4.0);
- map.add_tempo (tempoE, 12.0, 0, TempoSection::Ramp, MusicTime);
- Tempo tempoF (123.9, 4.0);
- map.add_tempo (tempoF, 15.0, 0, TempoSection::Ramp, MusicTime);
+ Tempo tempoA (120.2, 4.0, 240.5);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
+ Tempo tempoB (240.5, 4.0, 130.1);
+ map.add_tempo (tempoB, 3.0, 0, MusicTime);
+
+ Tempo tempoC (130.1, 4.0, 90.3);
+ map.add_tempo (tempoC, 0.0, 6 * sampling_rate, AudioTime);
+ Tempo tempoD (90.3, 4.0, 110.7);
+ map.add_tempo (tempoD, 9.0, 0, MusicTime);
+ Tempo tempoE (110.7, 4.0, 123.9);
+ map.add_tempo (tempoE, 12.0, 0, MusicTime);
+ Tempo tempoF (123.9, 4.0, 111.8);
+ map.add_tempo (tempoF, 15.0, 0, MusicTime);
Tempo tempoG (111.8, 4.0);
- map.add_tempo (tempoG, 0.0, (framepos_t) 2 * 60 * sampling_rate, TempoSection::Ramp, AudioTime);
+ map.add_tempo (tempoG, 0.0, (framepos_t) 2 * 60 * sampling_rate, AudioTime);
Meter meterB (3, 4);
map.add_meter (meterB, 4.0, BBT_Time (2, 1, 0), 288e3, AudioTime);
+ map.dump (std::cout);
map.recompute_map (map._metrics, 1);
list<MetricSection*>::iterator i = map._metrics.begin();
TempoMap map (sampling_rate);
Meter meterA (4, 4);
- Tempo tempoA (77.0, 4.0);
+ Tempo tempoA (77.0, 4.0, 217.0);
Tempo tempoB (217.0, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Ramp, AudioTime);
- map.add_tempo (tempoB, 0.0, (framepos_t) 60 * sampling_rate, TempoSection::Ramp, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
+ map.add_tempo (tempoB, 0.0, (framepos_t) 60 * sampling_rate, AudioTime);
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), 0, AudioTime);
/*
TempoMap map (sampling_rate);
Meter meterA (4, 4);
- Tempo tempoA (77.0, 4.0);
+ Tempo tempoA (77.0, 4.0, 217.0);
Tempo tempoB (217.0, 4.0);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Ramp, AudioTime);
- map.add_tempo (tempoB, 0.0, (framepos_t) 60 * sampling_rate, TempoSection::Ramp, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
+ map.add_tempo (tempoB, 0.0, (framepos_t) 60 * sampling_rate, AudioTime);
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), 0, AudioTime);
/*
TempoMap map (sampling_rate);
Meter meterA (4, 8);
- Tempo tempoA (80.0, 8.0);
- Tempo tempoB (160.0, 3.0);
+ Tempo tempoA (80.0, 8.0, 160.0);
+ Tempo tempoB (160.0, 3.0, 123.0);
Tempo tempoC (123.0, 4.0);
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), 0, AudioTime);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Ramp, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
- map.add_tempo (tempoB, 20.0, 0, TempoSection::Ramp, MusicTime);
- map.add_tempo (tempoC, 30.0, 0, TempoSection::Ramp, MusicTime);
+ map.add_tempo (tempoB, 20.0, 0, MusicTime);
+ map.add_tempo (tempoC, 30.0, 0, MusicTime);
TempoSection* tA = 0;
TempoSection* tB = 0;
Tempo tempoE (123.0, 3.0);
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), 0, AudioTime);
- map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
+ map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, AudioTime);
- map.add_tempo (tempoB, 20.0, 0, TempoSection::Constant, MusicTime);
- map.add_tempo (tempoC, 30.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoB, 20.0, 0, MusicTime);
+ map.add_tempo (tempoC, 30.0, 0, MusicTime);
- map.add_tempo (tempoD, 40.0, 0, TempoSection::Constant, MusicTime);
- map.add_tempo (tempoE, 50.0, 0, TempoSection::Constant, MusicTime);
+ map.add_tempo (tempoD, 40.0, 0, MusicTime);
+ map.add_tempo (tempoE, 50.0, 0, MusicTime);
TempoSection* tA = 0;
TempoSection* tB = 0;