This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# init tumblr | |
Tumblr.configure do |config| | |
config.consumer_key = "ASDHASKDJHASKDJHASKD" | |
config.consumer_secret = "ASDHASKDJHASKDJHASKD" | |
config.oauth_token = "ASDHASKDJHASKDJHASKD" | |
config.oauth_token_secret = "ASDHASKDJHASKDJHASKD" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Program Files (x86)\VstPlugins\test\djfilter_x64.dll | |
com.bitwig.flt.library.metadata.reader.exception.CouldNotReadMetadataException: could not read metadata: Could not read VST plug-in metadata | |
64 bit plugin host reported errors: Pluginhost returned non zero exit code -2 | |
Error messages: | |
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 5, message: "Access is denied." } }', src\libcore\result.rs:860 | |
note: Run with `RUST_BACKTRACE=1` for a backtrace. | |
32 bit plugin host reported errors: Pluginhost returned non zero exit code -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl ExPlugin { | |
fn process_one_channel<F: Float + AsPrim>(&mut self, input: &[F], output: &mut [F]) { | |
for (input_sample, output_sample) in input.iter().zip(output) { | |
*output_sample = rand::random::<f64>() as F | |
// error, non-scalar cast | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// READ: using this external library struct - | |
// | |
// https://github.com/overdrivenpotato/rust-vst2/blob/master/src/buffer.rs#L78 | |
// | |
//---------------------------------- | |
// I have a simple function: | |
fn render_next(&self, buffer: &AudioBuffer<F>) { | |
let &(ref inputs, ref outputs) = &buffer.split(); | |
// Error: cannot move out of borrowed content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<T> Default for MyStruct<T> where T: SomeTrait + Default { | |
fn default() -> Self { | |
MyStruct { some_field: SomeTrait::default() } // <-- error | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn set_voice_note_off(&mut self, note_data: NoteData){ | |
for voice in &mut self.voices { | |
match voice.state { | |
// we only care if the note is currently on | |
VoiceState::On => { | |
// check if this voice is currently playing the note desired to be turned off | |
if voice.note_data.note == note_data.note { | |
// success - we found the voice to turn off | |
// replace the stored `voice.note_data` with our new `note_data` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct MyStruct<'a> { | |
stuffs: Vec<&'a AnotherStruct> | |
} | |
pub struct AnotherStruct { | |
some_data: DataStruct | |
} | |
pub struct DataStruct { | |
number: i32, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use asprim::AsPrim; | |
use vst2::buffer::AudioBuffer; | |
use vst2::api::Events; | |
use vst2::event::Event; | |
use num_traits::Float; | |
use voice::{Voice, VoiceState, Renderable}; | |
use utility::*; | |
use utility::note::{NoteData, NoteState}; | |
/// The base structure for handling voices, sounds, and processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use asprim::AsPrim; | |
use vst2::buffer::AudioBuffer; | |
use vst2::api::Events; | |
use vst2::event::Event; | |
use num_traits::Float; | |
use voice::{Voice, VoiceState, Renderable}; | |
use utility::*; | |
use utility::note::{NoteData, NoteState}; | |
/// The base structure for handling voices, sounds, and processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn set_voice_note_on(&mut self, note_data: NoteData){ | |
// loop over all available voices | |
for voice in &mut self.voices { | |
// check the `VoiceState` and find one that's off | |
if voice.state == VoiceState::Off { | |
// send a note to an unused voice. | |
voice.note_data = note_data; | |
// add our voice to our vector of used voice references | |
self.voices_in_use.push(voice); // <===== compiles if removed | |
break |