#include "period-type.h"#include "player-core.h"

Classes | |
| class | clock_driver |
Functions | |
| signed8 | x_normalise (signed8 y) |
| signed8 | y_normalise (signed8 x) |
Variables | |
| quad_period_type | targetperiod_metarate |
| quad_period_type | currentperiod_metarate |
| quad_period_type | normalperiod_metarate |
| signed8 | x_diskrate |
| signed8 | y_playrate |
| clock_driver * | metronome |
converts the y position (samples given the current tempo) to x (playing position in the raw file)
References assert(), diskrate, dsp, and dsp_driver::playrate.
Referenced by cue_set(), and map_set_diskrate().
converts the x position (samples in the raw file) to a position given the current tempo.
References assert(), diskrate, dsp, and dsp_driver::playrate.
Referenced by jumpto(), loop_jump(), map_active(), map_stop(), Player::restartCore(), and Player::timerTick().
This variable denotes the current period, which is the length of 1 measure (=4 beats) used to play the song at the current playrate. The tempo must be set through. So it is possible to have a song with a normalperiod of 100, but it should be played at a currentperiod of 50 (hence double as fast).
Referenced by Player::changeTempo(), core_meta_init(), jumpto(), lfo_set(), Player::mediumSwitch(), Player::nudgeMinus(), Player::nudgeMinus1M(), Player::nudgeMinus4M(), Player::nudgeMinus8M(), Player::nudgeMinusHalfB(), Player::nudgePlus(), Player::nudgePlus1M(), Player::nudgePlus4M(), Player::nudgePlus8M(), Player::nudgePlusB(), Player::Player(), BeatGraphAnalyzer::setTempo(), BpmAnalyzerDialog::tap(), Player::tempoChanged(), and Player::timerTick().
This variable denotes the period of 1 measure (4 beats) in the native song. This is thus the reciprocal of the native tempo To modify the tempo, one should go through the metronome.
Referenced by RhythmAnalyzer::calculateRhythmPattern2(), Player::changeTempo(), core_meta_init(), Player::loop(), Player::mapStart(), Player::normalTempo(), Player::nudgeCueBack8M(), Player::nudgeCueForward8M(), Player::Player(), WritingFinished::run(), BeatGraphAnalyzer::setTempo(), BpmAnalyzerDialog::tap(), Player::targetStep(), and Player::timerTick().
This variable denotes the target period, which is the length of 1 measure (=4 beats) at the command line requested playing speed
Referenced by core_meta_init(), BeatGraphAnalyzer::setTempo(), and Player::targetTempo().
x is the data position in the raw file (thus at normal tempo and at diskrate Hz). This is calculated during streaming. So updating this variable doesn't have much effect. To have some effect you might need to set the y variable properly.
Referenced by clock_driver::changetempo(), loop_jump(), loop_set_diskrate(), map_active(), map_stop(), BeatGraphLabel::moveRuler(), Player::restartCore(), and clock_driver::set_normalperiod_metarate().
y is the position in the playing file (thus at target tempo and at playrate) So if a song is 4 minutes and we play it at 50% of the normal speed then we have a total length of 8 minutes, which means that the position halfway the song will be at samplerate*4 and the last position in the song is at samplerate*8. If the song would play at double the speed then the last position in the song is at samplerate*4/8 (or samplerate/2) In other words. this is a tricky variable which is afterward transformed to the proper playing position x during the streaming. The advantage of this setup is that y can simply be incremented.
Referenced by Player::breakLfo(), clock_driver::changetempo(), cue_set(), Player::fastPan(), Player::fastRevSaw(), Player::fastSaw(), jumpto(), lfo_break(), lfo_metronome(), lfo_pan(), lfo_revsaw(), lfo_saw(), lfo_set(), loop_jump(), map_active(), map_set_diskrate(), map_stop(), Player::metronome(), Player::normalLfo(), Player::restart(), Player::restartCore(), clock_driver::set_normalperiod_metarate(), clock_driver::shift_playrate(), Player::slowPan(), Player::slowRevSaw(), Player::slowSaw(), and Player::timerTick().
1.6.2