fix missing opening notes on non-first play per session (!)

master
zetaPRIME 2022-03-21 22:27:27 -04:00
parent d95e6ce1d5
commit f430ebab00
4 changed files with 10 additions and 9 deletions

7
notes
View File

@ -33,11 +33,6 @@ parameters {
TODO {
settings dialog {
about-license info
probably some audio engine settings {
working sample rate
buffer sizes and such
}
}
revert-to-saved menu action
@ -87,8 +82,6 @@ TODO {
does NOT break preview mode??
seems to be only with the Maybe sample??? idk
}
playback after stopping immediately after a note in the first pattern played sometimes skips that note
^ probably due to note IDs; randomize starting point on each playback start? or fix something in InstrumentCore
things can apparently be hooked up cyclically, which completely breaks the queue
pattern switching is slow when changing (especially increasing) number of rows; set fixed page size to avoid reallocation?

View File

@ -168,6 +168,10 @@ void AudioEngine::play(std::shared_ptr<Project> p, int fromPos) {
tempo = project->tempo;
tickAcc = 0;
// properly initialize note tracking to prevent
chTrack.clear(); // overwritten starting notes
chTrack.resize(findPattern()->channels.size());
startOutput();
mode = Playing;
@ -271,6 +275,10 @@ void AudioEngine::render(std::shared_ptr<Project> p, QString fileName) {
tempo = project->tempo;
tickAcc = 0;
// properly initialize note tracking to prevent
chTrack.clear(); // overwritten starting notes
chTrack.resize(findPattern()->channels.size());
initAudio(); // we actually need the period size. whoops.
QFileInfo fi(fileName);

View File

@ -209,7 +209,7 @@ void InstrumentCore::process(CommandPort* i, AudioPort* o) {
// then do the thing
if (o) o->pull();
double tickTime = smpTime * audioEngine->curTickSize();
double tickTime = smpTime * static_cast<double>(audioEngine->curTickSize());
if (processNote) {
for (auto p = activeNotes.begin(); p != activeNotes.end(); ) {

View File

@ -70,7 +70,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
// audio page
QStringList sampleRates = { qs("44100Hz"), qs("48000Hz"), qs("96000Hz") };
const constexpr int minBufMs = 5, maxBufMs = 250;
const constexpr int minBufMs = 25, maxBufMs = 250;
const QString ms = qs("ms");
bind(ui->playbackSampleRate, AudioConfig::playbackSampleRate, sampleRates);