Skip to content

Commit

Permalink
Removed static arrays for better compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
someguynamedjosh committed Mar 25, 2021
1 parent e9a0e89 commit 21d4034
Show file tree
Hide file tree
Showing 22 changed files with 292 additions and 256 deletions.
8 changes: 4 additions & 4 deletions components/audiobench/src/engine/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ impl<'a> CodeGenerator<'a> {
" static_index += 1\n", // grumble grumble
" global_input = GlobalInput(midi_controls, pitch_wheel, bpm, elapsed_time, ",
"elapsed_beats)\n",
" start_trigger = Trigger(note_input.start_trigger, repeat([false], buffer_length - 1)...)\n",
" release_trigger = Trigger(note_input.release_trigger, repeat([false], buffer_length - 1)...)\n",
" start_trigger = Trigger(reshape([note_input.start_trigger, repeat([false], buffer_length - 1)...], (1, buffer_length)))\n",
" release_trigger = Trigger(reshape([note_input.release_trigger, repeat([false], buffer_length - 1)...], (1, buffer_length)))\n",
" note_output = NoteOutput()\n",
" context = NoteContext(global_input, note_input, note_output)\n",
" view = ()\n",
Expand All @@ -143,7 +143,7 @@ impl<'a> CodeGenerator<'a> {
for _ in 0..feedback_widget_selectors.len() {
exec_body.push_str("Vector{Float32}(), ");
}
exec_body.push_str(")\n\n @. context.note_out.audio = 0.0\n");
exec_body.push_str(")\n\n context.note_out.audio .= 0f0\n");
let automation_code = AutomationCode {
ordered_modules: ordered_modules.clone(),
};
Expand Down Expand Up @@ -181,7 +181,7 @@ impl<'a> CodeGenerator<'a> {
exec_body.push_str(" if do_feedback\n");
}
exec_body.push_str(&format!(
" push!(feedback.m{}w{}, m{}c{}[%, 1, 1])\n",
" push!(feedback.m{}w{}, m{}c{}[1, 1])\n",
index, widget_index, index, control_index
));
}
Expand Down
2 changes: 2 additions & 0 deletions components/audiobench/src/engine/julia_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ impl JuliaThread {
"Encountered Julia error while executing, see message log for details.\n\n{}",
err
);
eprintln!("{}", err);
// This error is "recoverable"
self.report_julia_error(message);
}
Expand Down Expand Up @@ -212,6 +213,7 @@ impl JuliaThread {
"Encountered Julia error while executing, see message log for details.\n\n{}",
err
);
eprintln!("{}", err);
self.report_julia_error(message);
// This error is "recoverable"
None
Expand Down
4 changes: 2 additions & 2 deletions components/audiobench/src/engine/program_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ impl AudiobenchExecutor {
parameters: &GlobalParameters,
) -> Result<Self, String> {
let mut base = ExecutionEngine::new();
base.add_global_code(julia_helper::include_packed_library!("StaticArrays"))
.unwrap();
// base.add_global_code(julia_helper::include_packed_library!("StaticArrays"))
// .unwrap();
let mut this = AudiobenchExecutor {
base,
// This is a quick and dirty way of getting the executor to rebuild when we use
Expand Down
Loading

0 comments on commit 21d4034

Please sign in to comment.