Releases: tesselode/kira
v0.6.0 beta 2
- Remove
Clock
andClocks
from the public API - Sounds and effects now have an
on_clock_tick
callback instead of having a&Clocks
argument passed intoprocess
- Remove parameters
- Settings that were previously
Value
s can now be tweened directly without needing to link them to a parameter - All functions that send commands to the renderer now use
CommandError
as their error type - Effects now have a similar structure to sounds
EffectBuilder
- trait for types that can be converted to anEffect
and a handleEffect
- runs on the renderer
TrackSettings
is nowTrackBuilder
. Effects can be added by passing anEffectBuilder
toTrackBuilder::add_effect
.- Changes to the built-in effects:
- Removed
Distortion
from the public API,DistortionSettings
is nowDistortionBuilder
, addedDistortionHandle
- Removed
Delay
from the public API,DelaySettings
is nowDelayBuilder
, addedDelayHandle
- Removed
Reverb
from the public API,ReverbSettings
is nowReverbBuilder
, addedReverbHandle
- Removed
Filter
from the public API,FilterSettings
is nowFilterBuilder
, addedFilterHandle
- Removed
- Renamed
Tweenable
toTweener
- Added a
Tweenable
trait for things that aTweener
can control.Tweener
is now generic over the type of theTweenable
value - Volume settings now use the
Volume
type instead off64
- Playback rate settings now use the
PlaybackRate
type instead off64
- Clock speed settings now use the
ClockSpeed
type instead off64
- Fix audio artifacts when a static sound loops
- Slight performance improvement when sounds are center-panned
- Allow configuring the main mixer track using a
TrackBuilder
inAudioManagerSettings
v0.6.0 beta 1
- Fix looping static sounds with a loop start position greater than 0.0 starting playback at that position. (The intended behavior is that the sound will still start at the beginning, but jump back to the loop start position after reaching the end.)
v0.6.0 beta 0
Basically everything has changed! I will write a proper blog post-style announcement when v0.6.0 is released.
v0.5.3
v0.5.2
v0.5.1
v0.5.0
Additions
- Added send tracks, which you can route sub-tracks to in addition to their parent track. This is useful for sharing effects between multiple sub-tracks.
- Made the
volume
setting forTrack
s aValue<f64>
, which means you can link it to a parameter - Added
Main
/Sub
/SendTrackHandle::set_volume
- Added an
init
callback to theEffect
trait - Added new effects:
Distortion
,Delay
, andReverb
- Added a
mix
setting for effects, which lets you blend dry and wet signal - Added
InstanceHandle::position
, which gets the current playback position of the instance - Added
CachedValue::with_valid_range
for clamping values
Bugfixes
- The default filter cutoff is no longer outside of the range of human hearing
Other changes
- Changed settings structs with an
id
field to useOption<Id>
. This eliminates a confusing situation where cloning the same settings struct and passing it to multiple objects results in each object overwriting the previous one since it has the same ID. - Changes to errors related to sending commands to the audio thread:
- Command-sending related errors are now listed in the
CommandError
enum BackendDisconnected
is no longer included in error enums- Handle structs whose only error variant was
BackendDisconnected
now
return aCommandError
TrackHandleError
was split intoAddEffectError
andRemoveEffectError
- Command-sending related errors are now listed in the
MetronomeHandle.event_iter
has been replaced withMetronomeHandle.pop_event
, which works the same way asSequenceInstanceHandle.pop_event
- Changed all occurrences of the term "pitch" to "playback rate"
v0.4.1
v0.4.0
wasm32
support
Kira now runs on any platform supporting wasm32
and having a cpal
backend. This means one can now run an instance of Kira in a web browser.
Handle-based API
The API has gone through a major revision. Previously, to do just about anything, you would have to use the AudioManager
:
audio_manager.stop_instance(instance_id)?;
audio_manager.set_metronome_tempo(Tempo(128.0))?;
// etc...
This meant that you had to pass a reference to the audio manager to every part of the code that needs it. It also meant that the AudioManager
struct had an overwhelming number of methods.
The API has been changed so that whenever you create a new thing (like a sound, an instance, or a mixer track), you receive a handle to that thing that you can use to control it.
let mut sound = audio_manager.load_sound("sound.ogg", SoundSettings::default())?;
let mut instance = sound.play(InstanceSettings::default())?;
instance.set_pitch(2.0)?;
Multiple metronomes
You can now create multiple metronomes. Each sequence instance can be assigned to a different metronome, and interval events can be received from a MetronomeHandle
:
let mut metronome = audio_manager.add_metronome(
MetronomeSettings::new().interval_events_to_emit([0.25, 0.5, 1.0]))?;
audio_manager.start_sequence({
let mut sequence = Sequence::<()>::new(SequenceSettings::default());
// sequence code
sequence
}, SequenceInstanceSettings::new().metronome(&metronome))?;
metronome.start()?;
for interval in metronome.event_iter() {
println!("{}", interval);
}
Most people will only need one metronome at a time - the main point of this is to move more functionality out of the AudioManager
struct.
Serde support
Sequences and most config structs now have serialization/deserialization support via the serde_support
feature.
Improved error handling
The capacity limits specified in AudioManagerSettings
are now enforced, and the audio manager will also check that when you remove something with an ID, something with that ID actually exists. Because this creates a lot of new error variants, the large AudioError
enum has been split up into smaller, situational error enums.
v0.3.0
Per-sequence custom event types
Previously, custom events emitted by sequences were retrieved by calling AudioManager::pop_event
, which meant that the audio manager had a generic type parameter for custom events, and every sequence had to emit custom events of the same type.
Now, each sequence has its own custom event type, and you receive those events from an EventReceiver
that the audio manager returns when you call AudioManager::add_sequence
. This gives you more flexibility in how you organize your custom events as well as moving some functionality out of the AudioManager
struct, which already has a lot of methods.
Audio streams
Audio streams provide a way of sending arbitrary audio data to the mixer. Sometimes, you need to play audio that you generate in real time, like voice chats. This feature lets you do that.
Other changes
- Added
Sequence::play_random
- Added
Value::Random
- Renamed
Sound::new
toSound::from_frames
- Audio file format decoding is now gated behind feature flags
- Changed functions for pausing, resuming, and stopping instances to take settings structs (
PauseInstanceSettings
,ResumeInstanceSettings
, andStopInstanceSettings
) - When resuming an instance, you can now choose to have it seek backward to the time when it was paused. This is useful if you need to keep audio synced up with something in-game, but you still want a smooth fade out when pausing the game.
- Renamed
Sequence::emit_custom_event
toSequence::emit
- Added
AudioManager::seek_instance
andAudioManager::seek_instance_to
for changing the playback positions of running instances - Refined the behavior of looping backwards instances
- Added
Tween::linear
- Make
Arrangement::settings
private and add settings parameters toArrangement::new_loop
andArrangement::new_loop_with_intro
Contributors
Shoutouts to @Moxinilian for implementing audio streams and architecting per-sequence custom event types!