mirror of
https://github.com/AxioDL/amuse.git
synced 2025-08-09 05:29:07 +00:00
Properly advertise Sequencer tempo to voice SoundMacros
This commit is contained in:
parent
a047b1f6c8
commit
e932539ec4
@ -109,6 +109,9 @@ public:
|
|||||||
* @return `true` if END reached
|
* @return `true` if END reached
|
||||||
*/
|
*/
|
||||||
bool advance(Sequencer& seq, double dt);
|
bool advance(Sequencer& seq, double dt);
|
||||||
|
|
||||||
|
/** Get current song tempo in BPM */
|
||||||
|
uint32_t getTempo() const {return m_tempo;}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ std::shared_ptr<Voice> Sequencer::ChannelState::keyOn(uint8_t note, uint8_t velo
|
|||||||
(*ret)->installCtrlValues(m_ctrlVals);
|
(*ret)->installCtrlValues(m_ctrlVals);
|
||||||
|
|
||||||
ObjectId oid = (m_parent.m_audioGroup.getDataFormat() == DataFormat::PC) ? m_page->objId : SBig(m_page->objId);
|
ObjectId oid = (m_parent.m_audioGroup.getDataFormat() == DataFormat::PC) ? m_page->objId : SBig(m_page->objId);
|
||||||
if (!(*ret)->loadSoundObject(oid, 0, 1000.f, note, velocity, m_ctrlVals[1]))
|
if (!(*ret)->loadSoundObject(oid, 0, m_parent.m_ticksPerSec, note, velocity, m_ctrlVals[1]))
|
||||||
{
|
{
|
||||||
m_parent.m_engine._destroyVoice(ret);
|
m_parent.m_engine._destroyVoice(ret);
|
||||||
return {};
|
return {};
|
||||||
@ -465,6 +465,7 @@ void Sequencer::playSong(const unsigned char* arrData, bool dieOnEnd)
|
|||||||
m_arrData = arrData;
|
m_arrData = arrData;
|
||||||
m_dieOnEnd = dieOnEnd;
|
m_dieOnEnd = dieOnEnd;
|
||||||
m_songState.initialize(arrData);
|
m_songState.initialize(arrData);
|
||||||
|
setTempo(m_songState.getTempo() * 384 / 60);
|
||||||
m_state = SequencerState::Playing;
|
m_state = SequencerState::Playing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,6 +326,7 @@ bool SongState::advance(Sequencer& seq, double dt)
|
|||||||
{
|
{
|
||||||
/* Turn over tempo */
|
/* Turn over tempo */
|
||||||
m_tempo = change.m_tempo;
|
m_tempo = change.m_tempo;
|
||||||
|
seq.setTempo(m_tempo * 384 / 60);
|
||||||
++m_tempoPtr;
|
++m_tempoPtr;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user