comparison framework/Align.cpp @ 672:ae7584dbd668 tuning-difference

Provide facility to re-align models
author Chris Cannam
date Fri, 17 May 2019 09:45:12 +0100
parents b6cafe05017d
children b375fdbb74bc
comparison
equal deleted inserted replaced
671:b6cafe05017d 672:ae7584dbd668
101 <RangeSummarisableTimeValueModel *>(other); 101 <RangeSummarisableTimeValueModel *>(other);
102 102
103 if (!reference || !rm) return false; // but this should have been tested already 103 if (!reference || !rm) return false; // but this should have been tested already
104 104
105 // This involves creating either three or four new models: 105 // This involves creating either three or four new models:
106 106 //
107 // 1. an AggregateWaveModel to provide the mixdowns of the main 107 // 1. an AggregateWaveModel to provide the mixdowns of the main
108 // model and the new model in its two channels, as input to the 108 // model and the new model in its two channels, as input to the
109 // MATCH plugin 109 // MATCH plugin
110 110 //
111 // 2a. a SparseTimeValueModel which will be automatically created 111 // 2a. a SparseTimeValueModel which will be automatically created
112 // by FeatureExtractionModelTransformer when running the 112 // by FeatureExtractionModelTransformer when running the
113 // TuningDifference plugin to receive the relative tuning of the 113 // TuningDifference plugin to receive the relative tuning of the
114 // second model (if pitch-aware alignment is enabled in the 114 // second model (if pitch-aware alignment is enabled in the
115 // preferences) 115 // preferences)
116 116 //
117 // 2b. a SparseTimeValueModel which will be automatically created 117 // 2b. a SparseTimeValueModel which will be automatically created
118 // by FeatureExtractionPluginTransformer when running the MATCH 118 // by FeatureExtractionPluginTransformer when running the MATCH
119 // plugin to perform alignment (so containing the alignment path) 119 // plugin to perform alignment (so containing the alignment path)
120 120 //
121 // 3. an AlignmentModel, which stores the path model and carries 121 // 3. an AlignmentModel, which stores the path model and carries
122 // out alignment lookups on it. 122 // out alignment lookups on it.
123 123 //
124 // The AggregateWaveModel [1] is registered with the document, 124 // The AggregateWaveModel [1] is registered with the document,
125 // which deletes it when it is invalidated (when one of its 125 // which deletes it when it is invalidated (when one of its
126 // components is deleted). The SparseTimeValueModel [2a] is reused 126 // components is deleted). The SparseTimeValueModel [2a] is reused
127 // by us when starting the alignment process proper, and is then 127 // by us when starting the alignment process proper, and is then
128 // deleted by us. The SparseTimeValueModel [2b] is passed to the 128 // deleted by us. The SparseTimeValueModel [2b] is passed to the
129 // AlignmentModel, which takes ownership of it. The AlignmentModel 129 // AlignmentModel, which takes ownership of it. The AlignmentModel
130 // is attached to the new model we are aligning, which also takes 130 // is attached to the new model we are aligning, which also takes
131 // ownership of it. The only one of these models that we need to 131 // ownership of it. The only one of these models that we need to
132 // delete here is the SparseTimeValueModel [2a]. 132 // delete here is the SparseTimeValueModel [2a].
133 //
134 // (We also create a sneaky additional SparseTimeValueModel
135 // temporarily so we can attach completion information to it -
136 // this is quite unnecessary from the perspective of simply
137 // producing the results.)
133 138
134 AggregateWaveModel::ChannelSpecList components; 139 AggregateWaveModel::ChannelSpecList components;
135 140
136 components.push_back(AggregateWaveModel::ModelChannelSpec 141 components.push_back(AggregateWaveModel::ModelChannelSpec
137 (reference, -1)); 142 (reference, -1));