Skip to content

Releases: tesselode/kira

v0.6.0 beta 2

04 Jan 03:29
Compare
Choose a tag to compare
v0.6.0 beta 2 Pre-release
Pre-release
  • Remove Clock and Clocks from the public API
  • Sounds and effects now have an on_clock_tick callback instead of having a &Clocks argument passed into process
  • Remove parameters
  • Settings that were previously Values 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 an Effect and a handle
    • Effect - runs on the renderer
  • TrackSettings is now TrackBuilder. Effects can be added by passing an EffectBuilder to TrackBuilder::add_effect.
  • Changes to the built-in effects:
    • Removed Distortion from the public API, DistortionSettings is now DistortionBuilder, added DistortionHandle
    • Removed Delay from the public API, DelaySettings is now DelayBuilder, added DelayHandle
    • Removed Reverb from the public API, ReverbSettings is now ReverbBuilder, added ReverbHandle
    • Removed Filter from the public API, FilterSettings is now FilterBuilder, added FilterHandle
  • Renamed Tweenable to Tweener
  • Added a Tweenable trait for things that a Tweener can control. Tweener is now generic over the type of the Tweenable value
  • Volume settings now use the Volume type instead of f64
  • Playback rate settings now use the PlaybackRate type instead of f64
  • Clock speed settings now use the ClockSpeed type instead of f64
  • 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 in AudioManagerSettings

v0.6.0 beta 1

24 Dec 18:44
Compare
Choose a tag to compare
v0.6.0 beta 1 Pre-release
Pre-release
  • 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

05 Dec 17:22
Compare
Choose a tag to compare
v0.6.0 beta 0 Pre-release
Pre-release

Basically everything has changed! I will write a proper blog post-style announcement when v0.6.0 is released.

v0.5.3

31 May 22:33
Compare
Choose a tag to compare
  • Fixed an issue where the AudioManager cleanup would fail if there are existing track handles

v0.5.2

28 Apr 03:14
Compare
Choose a tag to compare
  • Added Sound::from_mp3_reader, Sound::from_ogg_reader, Sound::from_flac_reader, and Sound::from_wav_reader (thanks @zicklag!)
  • (Hopefully) fixed an issue where capacities (the maximum number of instances, sequences, etc.) could decrease over time

v0.5.1

08 Apr 16:11
Compare
Choose a tag to compare
  • Added a Default implementation for TrackSends
  • Fixed a compile error when building Kira with the serde_support feature enabled

v0.5.0

08 Mar 01:07
Compare
Choose a tag to compare

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 for Tracks a Value<f64>, which means you can link it to a parameter
  • Added Main/Sub/SendTrackHandle::set_volume
  • Added an init callback to the Effect trait
  • Added new effects: Distortion, Delay, and Reverb
  • 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 use Option<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 a CommandError
    • TrackHandleError was split into AddEffectError and RemoveEffectError
  • MetronomeHandle.event_iter has been replaced with MetronomeHandle.pop_event, which works the same way as SequenceInstanceHandle.pop_event
  • Changed all occurrences of the term "pitch" to "playback rate"

v0.4.1

24 Jan 02:18
Compare
Choose a tag to compare

Added serde support for Arrangements and SoundClips

v0.4.0

23 Jan 22:31
Compare
Choose a tag to compare

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

26 Dec 07:49
Compare
Choose a tag to compare

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 to Sound::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, and StopInstanceSettings)
  • 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 to Sequence::emit
  • Added AudioManager::seek_instance and AudioManager::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 to Arrangement::new_loop and Arrangement::new_loop_with_intro

Contributors

Shoutouts to @Moxinilian for implementing audio streams and architecting per-sequence custom event types!