Skip to content

Commit

Permalink
Small clean
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviliz committed Jun 21, 2024
1 parent 2a27876 commit 0d532ab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
33 changes: 0 additions & 33 deletions src/algorithms/tonal/pitch2midi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ void Pitch2Midi::configure()
_minOffsetCheckThreshold = _minOffsetCheckPeriod / _frameTime;
_minNoteChangeThreshold = _minNoteChangePeriod / _frameTime;

// deactivate E_INFO
// TODO: remove E_INFO
/*
E_INFO("_minOnsetCheckThreshold: " << _minOnsetCheckThreshold);
Expand Down Expand Up @@ -111,14 +110,6 @@ bool Pitch2Midi::isMaxVotedCountGreaterThanMinOcurrenceRate() {
}

void Pitch2Midi::setOutputs(int midiNoteNumber, float onsetTimeCompensation, float offsetTimeCompensation) {
// TODO: update outputs as vectors
// get refs to outputs
//int& midiNoteNumberOut = _midiNoteNumberOut.get();
//int& previousMidiNoteNumberOut = _previousMidiNoteNumberOut.get();
//Real& onsetTimeCompensationOut = _onsetTimeCompensation.get();
//Real& offsetTimeCompensationOut = _offsetTimeCompensation.get();
//int& messageTypeOut = _messageType.get();

vector<string>& messageTypeOut = _messageTypeOut.get();
vector<Real>& midiNoteNumberOut = _midiNoteNumberOut.get();
vector<Real>& timeCompensationOut = _timeCompensationOut.get();
Expand All @@ -136,38 +127,19 @@ void Pitch2Midi::setOutputs(int midiNoteNumber, float onsetTimeCompensation, flo
}

// let's define first the message type
// TODO: define outputs in vector format

//if (_noteOff && !_noteOn) {
if (_noteOff) {
//messageTypeOut = 0;
_messageTypeBin.push_back("note_off");
}

//if (_noteOn && !_noteOff) {
if (_noteOn) {
//messageTypeOut = 1;
_messageTypeBin.push_back("note_on");
}

/*
if (_noteOn && _noteOff) {
//messageTypeOut = 2;
_messageTypeBin.push_back("note_off");
_messageTypeBin.push_back("note_on");
}
*/

if (!_applyCompensation) {
onsetTimeCompensation = 0.f;
offsetTimeCompensation = 0.f;
}

/*midiNoteNumberOut = midiNoteNumber;
previousMidiNoteNumberOut = dnote_->midiNote;
onsetTimeCompensationOut = onsetTimeCompensation;
offsetTimeCompensationOut = offsetTimeCompensation;*/

_midiNoteNumberBin.push_back(static_cast<Real>(dnote_->midiNote));
_midiNoteNumberBin.push_back(static_cast<Real>(midiNoteNumber));
_timeCompensationBin.push_back(offsetTimeCompensation);
Expand Down Expand Up @@ -199,11 +171,6 @@ void Pitch2Midi::compute()
}

getMidiNoteNumber(pitch);

// TODO: update messageTypeOut as vector
//int& messageTypeOut = _messageType.get();
// initialize messageType to null value
//messageTypeOut = -1;

// refresh note_on and note_off timestamps
_noteOn = false;
Expand Down
12 changes: 0 additions & 12 deletions src/algorithms/tonal/pitch2midi.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,8 @@ namespace standard {
Input<int> _voiced;

// Outputs
/*
Output<int> _midiNoteNumberOut;
Output<int> _previousMidiNoteNumberOut;
Output<Real> _onsetTimeCompensation;
Output<Real> _offsetTimeCompensation;
Output<int> _messageType;
*/

// define outputs as vectors - index vector connects the ouputs
// output vector for _messageType ("note_off", "note_on")
Output<std::vector<std::string> > _messageTypeOut;
// output vector for midiNoteNumber (<note_off>, <note_on>)
Output<std::vector<Real> > _midiNoteNumberOut;
// output vector for timeCompensation (offsetCompensation, onsetCompensation)
Output<std::vector<Real> > _timeCompensationOut;

bool _noteOn;
Expand Down

0 comments on commit 0d532ab

Please sign in to comment.