bool ResultProcessor::checkConfigs(const std::vector<std::string> & configPaths, std::string & algName , FileLogger * dirLogger) { bool isSampleSet = false; int badConfigCount = 0; std::string sampleConfig; std::string currentConfig; for(unsigned i = 0 ; i < configPaths.size() ; i++) { if(!isSampleSet) { sampleConfig = Utils::readFileToString(configPaths[i]); algName = getNotes(sampleConfig); isSampleSet = true; } currentConfig = Utils::readFileToString(configPaths[i]); if(sampleConfig.compare(currentConfig) != 0) { oneclickLogger << FileLogger::LOG_WARNING << "config " << Utils::getLastItemInPath(configPaths[i]) << " differs from the first config in experiment\n"; *dirLogger << FileLogger::LOG_WARNING << "config " << Utils::getLastItemInPath(configPaths[i]) << " differs from the first config in experiment\n"; badConfigCount++; } } if(badConfigCount == 0) { oneclickLogger << FileLogger::LOG_INFO << "no different configs in experiment\n"; *dirLogger << FileLogger::LOG_INFO << "no different configs in experiment\n"; return true; } else { oneclickLogger << FileLogger::LOG_WARNING << Utils::itostr(badConfigCount) << " different configs in experiment\n"; *dirLogger << FileLogger::LOG_WARNING << Utils::itostr(badConfigCount) << " different configs in experiment\n"; return false; } }
int main(int argc, char** argv) { // process the command-line options checkOptions(options, argc, argv); HumdrumFile infile; infile.read(options.getArg(1)); if (distQ) { infile.analyzeRhythm(); } Array<NoteUnit> notes; getNotes(notes, infile); scrambleNotes(notes); if (transQ) { printNotes(notes); } else { replaceNotes(infile, notes); cout << infile; } if (displaySeedQ) { cout << "!!!seed: " << seed << endl; } return 0; }
float *Xenon::tick() { int note = getNotes()[ pos / lengthPerDivision ] ; int placeInNote = pos % lengthPerDivision; float ret; float gain = 0; if( note < 0 || note > 127 ) { ret = 0; } else { gain = sustainLevel; float n = 0; if( placeInNote < attackSamples ) { gain = placeInNote / (float) attackSamples ; n = noise.generateUniformRandomDeviate() * gain ; } else if( placeInNote < attackSamples + decaySamples ) { int p = placeInNote - attackSamples; float r = p / (float) decaySamples ; gain = ( 1 - r ) + sustainLevel * r ; n = noise.generateUniformRandomDeviate() * (1-r) ; } else if( placeInNote > lengthPerDivision - releaseSamples ) { int p = placeInNote - ( lengthPerDivision - releaseSamples ) ; float r = p / (float) releaseSamples ; gain = ( 1 - r ) * sustainLevel ; } else { } //cout << placeInNote << " : " << gain << " : " << sustainLevel << " : " << attackSamples ; //for( int i=0; i<80*gain; ++i ) // cout << "*" ; //cout << endl; ret = fabsf( sin( pitchTable[note] * placeInNote * 2 * M_PI / sampleRate ) ); ret = ( ret - .5 ) * 2 ; //ret += n / 20; ret *= gain; ret *= 6 ; ret = clip( ret, .33 ); } //cout << pos << " : " << ret << endl; ++pos; if( pos >= totalLength ) pos = 0; //filter //cout << "-------1 " << ret << endl; ret = lpfilter.process( ret ); //cout << "-------2 " << ret << endl; //cout << gain << " " << envFollow << " " << sampleRate << endl; envFollow = gain * .0005 + envFollow * .9995 ; envfilter.setupLowpass( sampleRate, 100 + envFollow * 700, 8 ); ret = envfilter.process( ret ); //cout << "-------3 " << ret << endl; ret = clip( ret, .95 ); //cout << "-------4 " << ret << endl; //if( isnan( ret ) ) // exit(0); retVals[0] = ret; retVals[1] = ret; return retVals; }
ContactvCard::ConvertStatus ContactvCard::convert(Contact* contact) { contact->first_name = getFirstName().toStdString(); contact->last_name = getLastName().toStdString(); contact->dac_id_string = getKHID().toStdString(); contact->notes = getNotes().toStdString(); contact->privacy_setting = bts::addressbook::secret_contact; contact->setIcon(QIcon(":/images/user.png")); if (public_key_address::convert(getPublicKey().toStdString(), &contact->public_key) == false) return ConvertStatus::PUBLIC_KEY_INVALID; return ConvertStatus::SUCCESS; }
bool UniPAX::SBase::getAttribute(std::vector<std::pair<std::string,std::string> >& value, PersistenceManager& manager) { if (!UniPAX::UIBase::getAttribute(value, manager)) return false; { if (! getMetaId().empty()) value.push_back(std::pair<std::string,std::string>("metaId", getMetaId())); } { if (!getSboTerm().empty()) value.push_back(std::pair<std::string,std::string>("sboTerm", getSboTerm())); } { if (!getNotes().empty()) value.push_back(std::pair<std::string,std::string>("notes", getNotes())); } { if (!getAnnotation().empty()) value.push_back(std::pair<std::string,std::string>("annotation", getAnnotation())); } return true; }
bool mmFilterTransactionsDialog::checkAll(const Model_Billsdeposits::Data &tran, const std::map<int, Model_Budgetsplittransaction::Data_Set>& splits) { bool ok = true; if (getAccountCheckBox() && (getAccountID() != tran.ACCOUNTID && getAccountID() != tran.TOACCOUNTID)) ok = false; else if (getDateRangeCheckBox() && !Model_Billsdeposits::TRANSDATE(tran) .IsBetween(getFromDateCtrl().GetDateOnly() , getToDateControl().GetDateOnly() ) ) ok = false; else if (!checkPayee<Model_Billsdeposits>(tran)) ok = false; else if (!checkCategory<Model_Billsdeposits>(tran, splits)) ok = false; else if (getStatusCheckBox() && !compareStatus(tran.STATUS)) ok = false; else if (getTypeCheckBox() && !allowType(tran.TRANSCODE, true)) ok = false; else if (getAmountRangeCheckBoxMin() && getAmountMin() > tran.TRANSAMOUNT) ok = false; else if (getAmountRangeCheckBoxMax() && getAmountMax() < tran.TRANSAMOUNT) ok = false; else if (getNumberCheckBox() && getNumber() != tran.TRANSACTIONNUMBER) ok = false; else if (getNotesCheckBox() && !tran.NOTES.Lower().Contains(getNotes().Lower())) ok = false; return ok; }
bool mmFilterTransactionsDialog::checkAll(const Model_Checking::Data &tran, const int accountID, const std::map<int, Model_Splittransaction::Data_Set>& split) { bool ok = true; //wxLogDebug("Check date? %i trx date:%s %s %s", getDateRangeCheckBox(), tran.TRANSDATE, getFromDateCtrl().GetDateOnly().FormatISODate(), getToDateControl().GetDateOnly().FormatISODate()); if (getAccountCheckBox() && (getAccountID() != tran.ACCOUNTID && getAccountID() != tran.TOACCOUNTID)) ok = false; else if ( getDateRangeCheckBox() && !Model_Checking::TRANSDATE(tran).IsBetween( getFromDateCtrl().GetDateOnly(), getToDateControl().GetDateOnly()) ) ok = false; else if (getPayeeCheckBox() && !checkPayee<Model_Checking>(tran)) ok = false; else if (getCategoryCheckBox() && !checkCategory<Model_Checking>(tran, split)) ok = false; else if (getStatusCheckBox() && !compareStatus(tran.STATUS)) ok = false; else if (getTypeCheckBox() && !allowType(tran.TRANSCODE, accountID == tran.ACCOUNTID)) ok = false; else if (getAmountRangeCheckBoxMin() && getAmountMin() > tran.TRANSAMOUNT) ok = false; else if (getAmountRangeCheckBoxMax() && getAmountMax() < tran.TRANSAMOUNT) ok = false; else if (getNumberCheckBox() && getNumber() != tran.TRANSACTIONNUMBER) ok = false; else if (getNotesCheckBox() && !tran.NOTES.Lower().Contains(getNotes().Lower())) ok = false; return ok; }
void AbstractItem::getChildren() { getNotes(); }
QDeclarativeListProperty<QObject> NotesManager::noteSet() { m_notes = getNotes(m_search); return QDeclarativeListProperty<QObject>(this, m_notes); }