var searchIndex = {}; searchIndex["synth"] = {"doc":"Implementation of the `Synth` struct for basic polyphonic, multi-oscillator envelope synthesis.","items":[[8,"EnvelopeTrait","synth","Types representable as an Envelope.",null,null],[16,"Points","","An iterator yielding references to `P`s.",0,null],[10,"points","","An iterator yielding the `Point`s of the Envelope.",0,null],[11,"point_idx_before","","The index of the `Point` that comes directly before the given `x`.",0,null],[11,"point_idx_on_or_before","","The index of the `Point` that either lands on or comes directly before the given `x`.",0,null],[11,"point_idx_after","","The index of the `Point` that comes directly after the given `x`.",0,null],[11,"point_idx_on_or_after","","The index of the `Point` that comes directly after the given `x`.",0,null],[11,"point_before","","A reference to the first point that comes before the given `x`.",0,null],[11,"point_on_or_before","","A reference to the first point that is equal to or comes before the given `x`.",0,null],[11,"point_before_with_idx","","A reference to the first point that comes before the given `x` along with its index.",0,null],[11,"point_on_or_before_with_idx","","A reference to the first point that is equal to or comes before the given `x` along with\nits index.",0,null],[11,"point_after","","A reference to the first point that comes after the given `x`.",0,null],[11,"point_on_or_after","","A reference to the first point that is equal to or comes after the given `x`.",0,null],[11,"point_after_with_idx","","A reference to the first point that comes after the given `x` along with its index.",0,null],[11,"point_on_or_after_with_idx","","A reference to the first point that is equal to or comes after the given `x` along with\nits index.",0,null],[11,"point_at","","A reference to the first point lying directly on the given `x` if there is one.",0,null],[11,"point_at_with_idx","","A reference to the first point (along with it's index) lying directly on the given `x` if\nthere is one.",0,null],[11,"surrounding_points","","The points that lie on either side of the given `x`.",0,null],[11,"closest_point","","A reference point that is closest to the given `x` if there is one.",0,null],[11,"y","","Return `y` for the given `x`.",0,null],[3,"Synth","","The `Synth` generates audio via a vector of `Voice`s, while a `Voice` generates audio via a\nvector of `Oscillator`s, creating a small DSP tree.",null,null],[12,"oscillators","","Oscillators for playback.",1,null],[12,"mode","","The mode of note playback.",1,null],[12,"channels","","The amplitude for each channel.",1,null],[12,"voices","","The voices used by the Synth.\n- If the Synth is in Poly mode, it will play one voice at a time.\n- If the Synth is in Mono mode, it will play all voices at once.",1,null],[12,"detune","","The amount each voice's note_on should be detuned.",1,null],[12,"spread","","The amount each voice should be spread across the available channels.",1,null],[12,"duration","","Duration of the Synth instrument in samples.",1,null],[12,"base_pitch","","Base pitch of the Synth instrument in Steps.",1,null],[12,"volume","","Amplitude multiplier (volume).",1,null],[12,"note_freq_gen","","The duration at which it takes to drift from the current note to some new note.",1,null],[12,"loop_data","","Data used for looping over a duration of the Synth.",1,null],[12,"fade_data","","Data used for fading in / out from playback.",1,null],[12,"is_paused","","Is the playback currently paused?",1,null],[3,"Voice","","A single Voice. A Synth may consist\nof any number of Voices.",null,null],[12,"oscillator_states","","The current phase for each oscillator owned by the Synth.",2,null],[12,"maybe_note","","Data for a note, if there is one currently being played.",2,null],[12,"playhead","","Playhead over the current note.",2,null],[12,"loop_playhead","","Playhead over the loop duration.",2,null],[0,"dynamic","","",null,null],[3,"Synth","synth::dynamic","A wrapper for extending the functionality of a completely dynamic Synth.",null,null],[12,"0","","",3,null],[5,"new","","Construct the default dynamic synth.",null,{"inputs":[],"output":{"name":"synthtype"}}],[0,"oscillator","","",null,null],[5,"new","synth::dynamic::oscillator","Construct a new dynamic oscillator.",null,{"inputs":[],"output":{"name":"oscillator"}}],[6,"Oscillator","","An alias for a totally dynamic Oscillator.",null,null],[6,"SynthType","synth::dynamic","An alias for a completely dynamic synth.",null,null],[11,"decode","","",3,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",3,null],[11,"clone","","",3,null],[11,"fmt","","",3,null],[11,"deref","","",3,null],[11,"deref_mut","","",3,null],[11,"audio_requested","","",3,null],[11,"set_mode","","Set the mode of the synth.",3,null],[11,"set_note_freq_gen","","Set the note frequency generator to be used by the synth.",3,null],[0,"envelope","synth","",null,null],[8,"Trait","synth::envelope","Types representable as an Envelope.",null,null],[16,"Points","","An iterator yielding references to `P`s.",0,null],[10,"points","","An iterator yielding the `Point`s of the Envelope.",0,null],[11,"point_idx_before","","The index of the `Point` that comes directly before the given `x`.",0,null],[11,"point_idx_on_or_before","","The index of the `Point` that either lands on or comes directly before the given `x`.",0,null],[11,"point_idx_after","","The index of the `Point` that comes directly after the given `x`.",0,null],[11,"point_idx_on_or_after","","The index of the `Point` that comes directly after the given `x`.",0,null],[11,"point_before","","A reference to the first point that comes before the given `x`.",0,null],[11,"point_on_or_before","","A reference to the first point that is equal to or comes before the given `x`.",0,null],[11,"point_before_with_idx","","A reference to the first point that comes before the given `x` along with its index.",0,null],[11,"point_on_or_before_with_idx","","A reference to the first point that is equal to or comes before the given `x` along with\nits index.",0,null],[11,"point_after","","A reference to the first point that comes after the given `x`.",0,null],[11,"point_on_or_after","","A reference to the first point that is equal to or comes after the given `x`.",0,null],[11,"point_after_with_idx","","A reference to the first point that comes after the given `x` along with its index.",0,null],[11,"point_on_or_after_with_idx","","A reference to the first point that is equal to or comes after the given `x` along with\nits index.",0,null],[11,"point_at","","A reference to the first point lying directly on the given `x` if there is one.",0,null],[11,"point_at_with_idx","","A reference to the first point (along with it's index) lying directly on the given `x` if\nthere is one.",0,null],[11,"surrounding_points","","The points that lie on either side of the given `x`.",0,null],[11,"closest_point","","A reference point that is closest to the given `x` if there is one.",0,null],[11,"y","","Return `y` for the given `x`.",0,null],[3,"Envelope","","An alias for the envelope to be used used for amp and freq interpolation.",null,null],[12,"points","","",4,null],[6,"Point","","An alias to the type of point to be used for amp and freq interpolation.",null,null],[11,"encode","","",4,null],[11,"decode","","",4,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"fmt","","",4,null],[11,"clone","","",4,null],[11,"from_iter","","",4,{"inputs":[{"name":"t"}],"output":{"name":"self"}}],[11,"from","","",4,{"inputs":[{"name":"vec"}],"output":{"name":"self"}}],[11,"points","","",4,null],[0,"mode","synth","",null,null],[3,"Mono","synth::mode","Monophonic playback.",null,null],[12,"0","","",5,null],[12,"1","","",5,null],[3,"Poly","","Polyphonic playback.",null,null],[4,"MonoKind","","The state of monophony.",null,null],[13,"Retrigger","","New notes will reset the voice's playheads",6,null],[13,"Legato","","If a note is already playing, new notes will not reset the voice's playheads.\nA stack of notes is kept - if a NoteOff occurs on the current note, it is replaced with the\nnote at the top of the stack if there is one. The stacked notes are reset if the voice\nbecomes inactive.",6,null],[4,"Dynamic","","The mode in which the Synth will handle notes.",null,null],[13,"Mono","","Single voice (normal or legato) with a stack of fallback notes.",7,null],[13,"Poly","","Multiple voices.",7,null],[8,"Mode","","The "mode" with which the Synth will handle notes.",null,null],[10,"note_on","","Handle a `note_on` event.",8,null],[10,"note_off","","Handle a `note_off` event.",8,null],[11,"stop","","Handle a `stop` event.",8,null],[11,"encode","","",5,null],[11,"decode","","",5,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"fmt","","",5,null],[11,"clone","","",5,null],[11,"encode","","",6,null],[11,"decode","","",6,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"fmt","","",6,null],[11,"clone","","",6,null],[11,"encode","","",9,null],[11,"decode","","",9,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"fmt","","",9,null],[11,"clone","","",9,null],[11,"encode","","",7,null],[11,"decode","","",7,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"fmt","","",7,null],[11,"clone","","",7,null],[11,"retrigger","","Construct a default Retrigger mono mode.",5,{"inputs":[],"output":{"name":"mono"}}],[11,"legato","","construct a default Legato mono mode.",5,{"inputs":[],"output":{"name":"mono"}}],[11,"retrigger","","Construct a default Retrigger mono mode.",7,{"inputs":[],"output":{"name":"dynamic"}}],[11,"legato","","Construct a default Legato mono mode.",7,{"inputs":[],"output":{"name":"dynamic"}}],[11,"poly","","Construct a default Poly mode.",7,{"inputs":[],"output":{"name":"dynamic"}}],[11,"note_on","","Handle a note_on event.",5,null],[11,"note_off","","Handle a note_off event.",5,null],[11,"stop","","Handle a stop event.",5,null],[11,"note_on","","",9,null],[11,"note_off","","",9,null],[11,"note_on","","Handle a note_on event.",7,null],[11,"note_off","","",7,null],[11,"stop","","",7,null],[0,"note_freq","synth","",null,null],[3,"Portamento","synth::note_freq","A PortamentoNote generator.",null,null],[12,"0","","",10,null],[3,"PortamentoFreq","","A note that interpolates between to given frequencies over the given duration.",null,null],[4,"DynamicGenerator","","A wrapper for switching between NoteFreqGenerators at runtime.",null,null],[13,"Portamento","","",11,null],[13,"Constant","","",11,null],[4,"Dynamic","","A warpper for switching between different NoteFreqs at runtime.",null,null],[13,"Portamento","","",12,null],[13,"Constant","","",12,null],[8,"NoteFreqGenerator","","Types designed to modulate the state of a Node.",null,null],[16,"NoteFreq","","The note frequency generated by the NoteFreqModulator type.",13,null],[10,"generate","","Construct a new note_freq from the note_hz given by a note_event and the last voice that\nhandled a note.",13,null],[8,"NoteFreq","","Types to be generated by `NoteFreqGenerator` types.",null,null],[11,"step_frame","","Step the NoteFreq forward one frame.",14,null],[10,"hz","","Step the NoteFreq forward one frame and return the hz for the current frame.",14,null],[11,"decode","","",10,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",10,null],[11,"fmt","","",10,null],[11,"clone","","",10,null],[11,"decode","","",15,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",15,null],[11,"fmt","","",15,null],[11,"clone","","",15,null],[11,"decode","","",11,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",11,null],[11,"fmt","","",11,null],[11,"clone","","",11,null],[11,"decode","","",12,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",12,null],[11,"fmt","","",12,null],[11,"clone","","",12,null],[11,"portamento","","Construct a default portamento.",11,{"inputs":[{"name":"ms"}],"output":{"name":"dynamicgenerator"}}],[11,"generate","","",10,null],[11,"step_frame","","",15,null],[11,"hz","","",15,null],[11,"generate","","",11,null],[11,"step_frame","","",12,null],[11,"hz","","",12,null],[0,"oscillator","synth","",null,null],[3,"Oscillator","synth::oscillator","The fundamental component of a synthesizer.",null,null],[12,"waveform","","Waveform used for phase movement.",16,null],[12,"amplitude","","Envelope for amplitude interpolation.",16,null],[12,"frequency","","Envelope for frequency interpolation.",16,null],[12,"freq_warp","","A type used for warping the Oscillator's frequency.",16,null],[12,"is_muted","","Whether or not the Oscillator is currently muted.",16,null],[0,"waveform","","",null,null],[3,"Sine","synth::oscillator::waveform","A sine wave.",null,null],[3,"Saw","","A sawtooth wave.",null,null],[3,"SawExp","","An exponential sawtooth wave.",null,null],[12,"0","","",17,null],[3,"Square","","A square wave.",null,null],[3,"Noise","","A noise signal.",null,null],[3,"NoiseWalk","","A random noise walk wave.",null,null],[4,"Dynamic","","An Oscillator must use one of a variety\nof waveform types.",null,null],[13,"Sine","","Sine Wave",18,null],[13,"Saw","","Saw Wave",18,null],[13,"Square","","Square Wave",18,null],[13,"Noise","","Noise",18,null],[13,"NoiseWalk","","Noise Walk",18,null],[13,"SawExp","","Exponential Saw Wave.",18,null],[6,"Steepness","","Represents the "steepness" of the exponential saw wave.",null,null],[8,"Waveform","","Some type that can return an amplitude given some phase.",null,null],[10,"amp_at_phase","","Return the amplitude given some phase.",19,null],[11,"process_hz","","An optional method for processing the frequency.",19,null],[11,"decode","","",18,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",18,null],[11,"eq","","",18,null],[11,"ne","","",18,null],[11,"fmt","","",18,null],[11,"clone","","",18,null],[11,"decode","","",20,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",20,null],[11,"fmt","","",20,null],[11,"clone","","",20,null],[11,"decode","","",21,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",21,null],[11,"fmt","","",21,null],[11,"clone","","",21,null],[11,"decode","","",17,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",17,null],[11,"fmt","","",17,null],[11,"clone","","",17,null],[11,"decode","","",22,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",22,null],[11,"fmt","","",22,null],[11,"clone","","",22,null],[11,"decode","","",23,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",23,null],[11,"fmt","","",23,null],[11,"clone","","",23,null],[11,"decode","","",24,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",24,null],[11,"fmt","","",24,null],[11,"clone","","",24,null],[11,"amp_at_phase","","Return the amplitude of a waveform at a given phase.",18,null],[11,"amp_at_phase","","",20,null],[11,"amp_at_phase","","",21,null],[11,"amp_at_phase","","",17,null],[11,"amp_at_phase","","",22,null],[11,"amp_at_phase","","",23,null],[11,"amp_at_phase","","",24,null],[11,"process_hz","","",24,null],[0,"amplitude","synth::oscillator","",null,null],[4,"Dynamic","synth::oscillator::amplitude","A type that allows dynamically switching between constant and enveloped amplitude.",null,null],[13,"Envelope","","",25,null],[13,"Constant","","",25,null],[6,"Envelope","","Alias for the Envelope used.",null,null],[8,"Amplitude","","Types for generating the amplitude given some playhead position.",null,null],[10,"amp_at_playhead","","Return the amplitude given some percentage through the duration of the Synth.\n- 0.0 < perc < 1.0.",26,null],[11,"decode","","",25,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",25,null],[11,"clone","","",25,null],[11,"fmt","","",25,null],[11,"is_env","","Return whether or not the Dynamic is an Envelope.",25,null],[11,"amp_at_playhead","","",27,null],[11,"amp_at_playhead","","",25,null],[0,"frequency","synth::oscillator","",null,null],[4,"Dynamic","synth::oscillator::frequency","A type that allows dynamically switching between constant and enveloped frequency.",null,null],[13,"Envelope","","",28,null],[13,"Hz","","",28,null],[6,"Envelope","","Alias for the Envelope used.",null,null],[8,"Frequency","","Types for generating the frequency given some playhead position.",null,null],[10,"hz_at_playhead","","Return the frequency given some playhead percentage through the duration of the Synth.\n- 0.0 < perc < 1.0l",29,null],[11,"freq_perc_at_playhead","","Return the frequency as a percentage.",29,null],[11,"decode","","",28,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",28,null],[11,"clone","","",28,null],[11,"fmt","","",28,null],[11,"is_env","","Return whether or not the Dynamic is an Envelope.",28,null],[11,"to_env","","Convert the dynamic to its Envelope variant.",28,null],[11,"to_hz","","Convert the dynamic to its Hz variant.",28,null],[11,"hz_at_playhead","","",30,null],[11,"freq_perc_at_playhead","","",30,null],[11,"hz_at_playhead","","",28,null],[0,"freq_warp","synth::oscillator","",null,null],[3,"Gaussian","synth::oscillator::freq_warp","A type for warping the frequency via gaussian randomness.",null,null],[12,"0","","",31,null],[3,"PitchDrift","","A type for slowly drifting an oscillators pitch via a noise walk.",null,null],[12,"hz","","The frequncy at which the pitch should drift.",32,null],[12,"amp","","How much the pitch should drift in steps.",32,null],[4,"Dynamic","","A type that allows switching between various kinds of FreqWarp at runtime.",null,null],[13,"None","","",33,null],[13,"Gaussian","","",33,null],[13,"PitchDrift","","",33,null],[8,"FreqWarp","","Types that produce a warped frequency in hz for some given frequency in hz.",null,null],[11,"step_phase","","Step the phase of the frequency warp if necessary.",34,null],[10,"warp_hz","","Return a warped hz given some hz, sample rate and phase.",34,null],[11,"decode","","",31,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",31,null],[11,"fmt","","",31,null],[11,"clone","","",31,null],[11,"decode","","",32,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",32,null],[11,"fmt","","",32,null],[11,"clone","","",32,null],[11,"decode","","",33,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",33,null],[11,"fmt","","",33,null],[11,"clone","","",33,null],[11,"gaussian","","Construct a gaussian.",33,{"inputs":[{"name":"f32"}],"output":{"name":"dynamic"}}],[11,"pitch_drift","","Construct a pitch drift.",33,{"inputs":[{"name":"f32"},{"name":"f64"}],"output":{"name":"dynamic"}}],[11,"warp_hz","","",31,null],[11,"step_phase","","",32,null],[11,"warp_hz","","",32,null],[11,"step_phase","","",33,null],[11,"warp_hz","","",33,null],[11,"decode","synth::oscillator","",16,{"inputs":[{"name":"__dwaffw"}],"output":{"name":"result"}}],[11,"encode","","",16,null],[11,"clone","","",16,null],[11,"fmt","","",16,null],[11,"new","","Oscillator constructor.",16,{"inputs":[{"name":"w"},{"name":"a"},{"name":"f"},{"name":"fw"}],"output":{"name":"oscillator"}}],[11,"waveform","","Waveform builder method.",16,null],[11,"amplitude","","Amplitude envelope builder method.",16,null],[11,"frequency","","Amplitude envelope builder method.",16,null],[11,"amp_at","","Calculate and return the amplitude at the given ratio.",16,null],[11,"next_phase","","Calculate and return the phase that should follow some given phase.",16,null],[11,"decode","synth","",1,{"inputs":[{"name":"__dmnfgwaffw"}],"output":{"name":"result"}}],[11,"encode","","",1,null],[11,"clone","","",1,null],[11,"fmt","","",1,null],[11,"new","","Constructor for a new Synth.",1,{"inputs":[{"name":"m"},{"name":"nfg"}],"output":{"name":"self"}}],[11,"num_voices","","Return the synth with the given number of voices.",1,null],[11,"set_num_voices","","Set the number of voices that the Synth shall use.",1,null],[11,"mode","","Changes the mode of the Synth.",1,null],[11,"oscillator","","Add an oscillator to a Synth.",1,null],[11,"oscillators","","Add multiple oscillators to a Synth.",1,null],[11,"duration","","Set the Synth's duration.",1,null],[11,"channels","","Set the amplitude for each channel.",1,null],[11,"stereo_pan","","Set the amplitude of each channel according to a given stereo pan between -1.0 and 1.0.\nIf the given value is outside the range -1.0..1.0, it will be clamped to range.\nThe synth's number of channels will be set to two if it does not already have two.",1,null],[11,"base_pitch","","Set the Synth's base pitch.",1,null],[11,"detune","","Set the Synth's detune amount.",1,null],[11,"spread","","Set the Synth's spread amount.",1,null],[11,"volume","","Set the Synth's volume.",1,null],[11,"note_freq_generator","","Set the Synth's portamento duration in milliseconds.",1,null],[11,"loop_points","","Set the loop data for the synth.",1,null],[11,"fade","","Set the fade data for the synth.",1,null],[11,"loop_start","","Set the start loop point.",1,null],[11,"loop_end","","Set the end loop point.",1,null],[11,"attack","","Set the attack.",1,null],[11,"release","","Set the release.",1,null],[11,"add_oscillator","","Add an oscillator.",1,null],[11,"remove_oscillator","","Remove and return the oscillator at the given idx.",1,null],[11,"is_active","","Return whether or not there are any currently active voices.",1,null],[11,"note_on","","Begin playback of a note. Synth will try to use a free `Voice` to do this.\nIf no `Voice`s are free, the one playing the oldest note will be chosen to\nplay the new note instead.",1,null],[11,"note_off","","Stop playback of the note that was triggered with the matching frequency.",1,null],[11,"pause","","Pause playback.",1,null],[11,"unpause","","Unpause playback.",1,null],[11,"stop","","Stop playback and clear the current notes.",1,null],[11,"audio_requested","","",1,null],[11,"decode","","",2,{"inputs":[{"name":"__dnf"}],"output":{"name":"result"}}],[11,"encode","","",2,null],[11,"fmt","","",2,null],[11,"clone","","",2,null],[11,"new","","Constructor for a Voice.",2,{"inputs":[{"name":"usize"}],"output":{"name":"voice"}}],[11,"reset_playheads","","Reset the voice's playheads.",2,null],[11,"note_on","","Trigger playback with the given note, resetting all playheads.",2,null],[11,"note_off","","Release playback of the current not eif there is one.",2,null],[11,"stop","","Stop playback of the current note if there is one and reset the playheads.",2,null],[11,"fill_buffer","","Generate and fill the audio buffer for the given parameters.",2,null]],"paths":[[8,"Trait"],[3,"Synth"],[3,"Voice"],[3,"Synth"],[3,"Envelope"],[3,"Mono"],[4,"MonoKind"],[4,"Dynamic"],[8,"Mode"],[3,"Poly"],[3,"Portamento"],[4,"DynamicGenerator"],[4,"Dynamic"],[8,"NoteFreqGenerator"],[8,"NoteFreq"],[3,"PortamentoFreq"],[3,"Oscillator"],[3,"SawExp"],[4,"Dynamic"],[8,"Waveform"],[3,"Sine"],[3,"Saw"],[3,"Square"],[3,"Noise"],[3,"NoiseWalk"],[4,"Dynamic"],[8,"Amplitude"],[6,"Envelope"],[4,"Dynamic"],[8,"Frequency"],[6,"Envelope"],[3,"Gaussian"],[3,"PitchDrift"],[4,"Dynamic"],[8,"FreqWarp"]]}; initSearch(searchIndex);