Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
xasopheno committed Aug 1, 2023
1 parent 9666d3b commit fd7759b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 17 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ exclude = [
"imgs/*",
]

[build]
rustflags = ["-Z", "sanitizer=leak"]

[profile.release]
debug = true

[package.metadata.arch]
arch = ["x86_64"]
makedepends = ["cargo", "lame", "vorbis-tools"]
Expand Down
2 changes: 1 addition & 1 deletion core/src/manager/render_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl RenderManager {
.filter_map(|voice| {
voice
.get_batch(Settings::global().buffer_size, None)
.map(|mut batch| {
.map(|batch| {
(
if vtx.is_some() {
batch.iter().filter(|op| op.index == 0).cloned().collect()
Expand Down
4 changes: 1 addition & 3 deletions core/src/portaudio/real_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ pub fn real_time(
.filter_map(|voice| {
let ops = voice.get_batch(Settings::global().buffer_size, None);
match ops {
Some(mut batch) => {
Some((batch.clone(), batch.render(&mut voice.oscillator, None)))
}
Some(batch) => Some((batch.clone(), batch.render(&mut voice.oscillator, None))),
None => None,
}
})
Expand Down
2 changes: 1 addition & 1 deletion core/src/portaudio/real_time_render_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn get_output_settings(pa: &pa::PortAudio) -> Result<pa::stream::OutputSetti

let output_settings = pa::OutputStreamSettings::new(
output_params,
Settings::global().sample_rate as f64,
Settings::global().sample_rate,
Settings::global().buffer_size as u32,
);

Expand Down
11 changes: 0 additions & 11 deletions instrument/src/oscillator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,6 @@ impl Oscillator {
r_voice.update(op, offset);
}

// pub fn generate(&mut self, op: &RenderOp, offset: &Offset) -> StereoWaveform {
// let (ref mut l_voice, ref mut r_voice) = self.voices;

// let (l_buffer, r_buffer) = rayon::join(
// || l_voice.generate_waveform(op, offset),
// || r_voice.generate_waveform(op, offset),
// );

// StereoWaveform { l_buffer, r_buffer }
// }

pub fn generate(&mut self, op: &RenderOp, offset: &Offset) -> StereoWaveform {
let (ref mut l_voice, ref mut r_voice) = self.voices;

Expand Down
2 changes: 1 addition & 1 deletion instrument/src/renderable/render_voice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl RenderVoice {
) -> Option<StereoWaveform> {
let batch = self.get_batch(n_samples, None);

batch.map(|mut b| b.render(&mut self.oscillator, offset))
batch.map(|b| b.render(&mut self.oscillator, offset))
}
}

Expand Down

0 comments on commit fd7759b

Please sign in to comment.