summaryrefslogtreecommitdiff
path: root/drumgizmo
diff options
context:
space:
mode:
authorSander Vocke <sandervocke@gmail.com>2024-07-28 09:24:01 +0200
committerSander Vocke <sandervocke@gmail.com>2024-07-28 09:24:01 +0200
commitfaaaf5d328429fd2c3f38131f7a874d056761f3f (patch)
treec49575d96ac820addefcf184ec7ad4f0151bc716 /drumgizmo
parentf6660bc51fe8c02ff7c3b6188e8437c67712bddf (diff)
Openness development
Diffstat (limited to 'drumgizmo')
-rw-r--r--drumgizmo/drumgizmoc.cc12
-rw-r--r--drumgizmo/input/jackmidi.cc9
-rw-r--r--drumgizmo/input/midifile.cc4
-rw-r--r--drumgizmo/input/test.cc2
4 files changed, 21 insertions, 6 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc
index bca55d2..5b44e6a 100644
--- a/drumgizmo/drumgizmoc.cc
+++ b/drumgizmo/drumgizmoc.cc
@@ -137,6 +137,8 @@ static std::string arguments()
"Sample selection parameters:\n"
" close: The importance given to choosing a sample close to\n"
" the actual velocity value (after humanization). [0,1]\n"
+ " openness: The importance given to choosing a sample close to\n"
+ " the actual openness value (after humanization). [0,1]\n"
" diverse: The importance given to choosing samples\n"
" which haven't been played recently. [0,1]\n"
" random: The amount of randomness added. [0,1]\n"
@@ -615,6 +617,16 @@ int main(int argc, char* argv[])
}
settings.sample_selection_f_close.store(val);
}
+ else if(token.key == "openness")
+ {
+ auto val = atof_nol(token.value.data());
+ if(val < 0 || val > 1)
+ {
+ std::cerr << "openness range is [0, 1].\n";
+ return 1;
+ }
+ settings.sample_selection_f_openness.store(val);
+ }
else if(token.key == "diverse")
{
auto val = atof_nol(token.value.data());
diff --git a/drumgizmo/input/jackmidi.cc b/drumgizmo/input/jackmidi.cc
index 7081bf1..2637cc5 100644
--- a/drumgizmo/input/jackmidi.cc
+++ b/drumgizmo/input/jackmidi.cc
@@ -3,7 +3,7 @@
* jackmidi.cc
*
* Mo 25. Jan 11:26:06 CET 2016
- * Copyright 2016 Christian Glöckner
+ * Copyright 2016 Christian Gl�ckner
* cgloeckner@freenet.de
****************************************************************************/
@@ -50,7 +50,7 @@ bool JackMidiInputEngine::init(const Instruments& instruments)
{
if(!loadMidiMap(midimap_file, instruments))
{
- std::cerr << "[MidifileInputEngine] Failed to parse midimap '"
+ std::cerr << "[JackMidiInputEngine] Failed to parse midimap '"
<< midimap_file << "'\n";
return false;
}
@@ -114,7 +114,10 @@ void JackMidiInputEngine::process(jack_nframes_t num_frames)
// It might not be though in case the system is under heavy load.
// Make room for both the new and old events to make sure we don't throw
// anything away.
- events.reserve(events.size() + num_events);
+
+ // FIXME: NarcoticV: Had to comment out the line below on my system
+ // (pipewire-jack), otherwise I got race conditions and crashes.
+ // events.reserve(events.size() + num_events);
for(jack_nframes_t i = 0; i < num_events; ++i)
{
diff --git a/drumgizmo/input/midifile.cc b/drumgizmo/input/midifile.cc
index c0b8e73..0eb1add 100644
--- a/drumgizmo/input/midifile.cc
+++ b/drumgizmo/input/midifile.cc
@@ -3,7 +3,7 @@
* midifile.cc
*
* Mi 20. Jan 16:07:57 CET 2016
- * Copyright 2016 Christian Glöckner
+ * Copyright 2016 Christian Gl�ckner
* cgloeckner@freenet.de
****************************************************************************/
@@ -166,7 +166,7 @@ void MidifileInputEngine::run(size_t pos, size_t len, std::vector<event_t>& even
else
{
assert(len >= 1);
- events.push_back({EventType::Stop, 0, len-1, 0.f});
+ events.push_back({EventType::Stop, 0, len-1, InstrumentStateKind::NoneOrAny, 0.f});
}
}
}
diff --git a/drumgizmo/input/test.cc b/drumgizmo/input/test.cc
index bc88c48..c23fa18 100644
--- a/drumgizmo/input/test.cc
+++ b/drumgizmo/input/test.cc
@@ -105,7 +105,7 @@ void TestInputEngine::run(size_t pos, size_t len, std::vector<event_t>& events)
event.instrument = rand() % 32;
}
- event.velocity = (float)rand()/(float)RAND_MAX;
+ event.velocity_or_state = (float)rand()/(float)RAND_MAX;
event.offset = len;
}