Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
17d3204
analyse when recording
novikov-alexander Sep 9, 2023
5b734da
note recognition works
novikov-alexander Jul 9, 2024
40eef44
use last event for analisys
novikov-alexander Jul 9, 2024
d52f3e6
merge notes
novikov-alexander Jul 9, 2024
26e1126
layer creation comment
novikov-alexander Jul 10, 2024
3f84fe9
working copy/paste
novikov-alexander Jul 10, 2024
d74f567
templates
novikov-alexander Jul 10, 2024
0b0d9e4
bind processing with timeframes
novikov-alexander Jul 11, 2024
9e9d740
working prototype
novikov-alexander Jul 11, 2024
def17d3
further refactoring
novikov-alexander Jul 11, 2024
5e5e162
comments
novikov-alexander Jul 11, 2024
5306b57
subscribe on record duration changed
novikov-alexander Jul 11, 2024
ae63f7f
analysis mode submenu
novikov-alexander Sep 5, 2025
08892ec
use layer pool
novikov-alexander Sep 5, 2025
2818440
remove duplicated events
novikov-alexander Sep 5, 2025
0402064
intelligent overlap
novikov-alexander Sep 5, 2025
ff43c09
multievent overlaps
novikov-alexander Sep 5, 2025
bf5c4be
refactor overlapping
novikov-alexander Sep 5, 2025
c3c76ef
safe pointer
novikov-alexander Mar 14, 2026
f8d2458
safer
novikov-alexander Mar 14, 2026
860121f
safer
novikov-alexander Mar 15, 2026
e10a0de
c++17
novikov-alexander Mar 16, 2026
d926db1
realtime analyser
novikov-alexander Mar 16, 2026
bd7a622
improve OverlapProcessor
novikov-alexander Mar 16, 2026
19192a0
continue
novikov-alexander Aug 6, 2026
e2254d0
Fix intermittent failures in realtime recording analysis
novikov-alexander Aug 6, 2026
38ab4f5
Fix live pitch track appearing at roughly twice its correct frame
novikov-alexander Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
389 changes: 264 additions & 125 deletions main/Analyser.cpp

Large diffs are not rendered by default.

36 changes: 31 additions & 5 deletions main/Analyser.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
An intonation analysis and annotation tool
Centre for Digital Music, Queen Mary, University of London.
This file copyright 2006-2012 Chris Cannam and QMUL.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
Expand All @@ -19,6 +19,7 @@
#include <QObject>
#include <QRect>
#include <QMutex>
#include <QtGlobal>

#include <map>
#include <vector>
Expand All @@ -36,6 +37,8 @@ class TimeValueLayer;
class Layer;
}

class RealtimeAnalyser;

class Analyser : public QObject,
public sv::Document::LayerCreationHandler
{
Expand All @@ -56,9 +59,12 @@ class Analyser : public QObject,
// layers; return "" on success or error string on failure
QString analyseExistingFile();

// Completes analysis from the last position to the end
QString analyseRecordingToEnd(sv::sv_frame_t record_duration);

// Discard any layers etc associated with the current document
void fileClosed();

void setIntelligentActions(bool);

bool getDisplayFrequencyExtents(double &min, double &max);
Expand Down Expand Up @@ -128,7 +134,14 @@ class Analyser : public QObject,
* group in QSettings.
*/
static std::map<QString, QVariant> getAnalysisSettings();


/**
* Analyse the selection and schedule asynchronous adds of
* candidate layers for the region it contains. Returns "" on
* success or a user-readable error string on failure.
*/
QString analyseRecording(sv::Selection sel);

/**
* Analyse the selection and schedule asynchronous adds of
* candidate layers for the region it contains. Returns "" on
Expand Down Expand Up @@ -232,6 +245,8 @@ class Analyser : public QObject,
void initialAnalysisCompleted();

protected slots:
void updatePitchTrack(sv::ModelId);
void updateNoteLayer(sv::ModelId);
void layerAboutToBeDeleted(sv::Layer *);
void layerCompletionChanged(sv::ModelId);
void reAnalyseRegion(sv::sv_frame_t, sv::sv_frame_t, float, float);
Expand All @@ -247,12 +262,16 @@ protected slots:

sv::Clipboard m_preAnalysis;
sv::Selection m_reAnalysingSelection;
sv::sv_frame_t m_analysedFrames = 0;
FrequencyRange m_reAnalysingRange;
std::vector<sv::Layer *> m_reAnalysisCandidates;

RealtimeAnalyser *m_realtimeAnalyser = nullptr;

int m_currentCandidate;
bool m_candidatesVisible;
sv::Document::LayerCreationAsyncHandle m_currentAsyncHandle;
QMutex m_asyncMutex;
mutable QMutex m_asyncMutex;

QString doAllAnalyses(bool withPitchTrack);

Expand All @@ -263,13 +282,20 @@ protected slots:
void discardPitchCandidates();

void stackLayers();

// Document::LayerCreationHandler method
void layersCreated(sv::Document::LayerCreationAsyncHandle,
std::vector<sv::Layer *>, std::vector<sv::Layer *>);

void saveState(Component c) const;
void loadState(Component c);

static constexpr const char* PYIN_PLUGIN_NAME = "pYIN";
static constexpr const char* PYIN_TRANSFORM_BASE = "vamp:pyin:pyin:";
static constexpr const char* PYIN_F0_OUT = "smoothedpitchtrack";
static constexpr const char* PYIN_NOTE_OUT = "notes";


};

#endif
Loading