Skip to content

Commit

Permalink
MIDI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Jun 25, 2024
1 parent 4f4f7ea commit 148ac77
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions libraries/steve/src/ConfigItemList.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "Chord.h"
#include "Instrument.h"
#include "Rand.h"
#include "Scale.h"

namespace steve {
Expand Down
2 changes: 1 addition & 1 deletion libraries/steve/src/Music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Music::Music(const Config& config)
for(NoteValue j = get_beat_value(); j >= NoteValue(0); j = NoteValue(uint32_t(j) - 1)) {
const auto ticks = ticks_for(j);
if((i / ticks) * ticks == i) {
if(Rand::next(0ul, (uint32_t(get_beat_value()) - uint32_t(j)) * 2) == 0) {
if(Rand::next(0u, (uint32_t(get_beat_value()) - uint32_t(j)) * 2) == 0) {
_beats[i] = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/steve/src/Rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using namespace steve;

std::default_random_engine Rand::generator;
std::mt19937_64 Rand::generator;
static std::uniform_real_distribution<float> nf_dist(0.f, 1.f);
static std::normal_distribution<float> nn_dist(0.5f, 0.1f);

Expand Down
2 changes: 1 addition & 1 deletion libraries/steve/src/Rand.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace steve {
class Rand {
public:
static std::default_random_engine generator;
static std::mt19937_64 generator;
static float next_float();
static float next_normal();

Expand Down
1 change: 1 addition & 0 deletions libraries/steve/src/Steve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <iostream>
#include <cassert>
#include <cstring>

#include "Chord.h"

Expand Down
1 change: 1 addition & 0 deletions libraries/steve/src/Steve.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <cstdint>
#include <map>
#include <set>
#include <vector>
Expand Down

0 comments on commit 148ac77

Please sign in to comment.