MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / RandomizeVelocities

Method RandomizeVelocities

Source/NoteStepSequencer.cpp:1258–1287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1256}
1257
1258void NoteStepSequencer::RandomizeVelocities()
1259{
1260 for (int i = 0; i < mLength; ++i)
1261 {
1262 if (ofRandom(1) <= mRandomizeVelocityChance)
1263 {
1264 int newVelocity = 0;
1265 if (ofRandom(1) < mRandomizeVelocityDensity)
1266 {
1267 switch (gRandom() % 4)
1268 {
1269 case 0:
1270 newVelocity = 50;
1271 break;
1272 case 1:
1273 newVelocity = 80;
1274 break;
1275 case 2:
1276 newVelocity = 110;
1277 break;
1278 default:
1279 newVelocity = 127;
1280 break;
1281 }
1282 }
1283
1284 mVels[i] = newVelocity;
1285 }
1286 }
1287}
1288
1289void NoteStepSequencer::RandomizeLengths()
1290{

Callers

nothing calls this directly

Calls 1

ofRandomFunction · 0.85

Tested by

no test coverage detected