NoteScheduler

org.soundsofscala.transport.NoteScheduler
final case class NoteScheduler(tempo: Tempo, lookAheadMs: LookAhead, scheduleAheadTimeSeconds: ScheduleWindow)

The NoteScheduler is responsible for scheduling the notes of a single track. It uses the ScheduleStatus to determine if the next note should be scheduled. We can start them at a precise time with the currentTime property of the AudioContext. The method of scheduling notes in the browser is derived from the following: https://web.dev/articles/audio-scheduling https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Advanced_techniques#playing_the_audio_in_time

Value parameters

lookAheadMs

The time in milliseconds to look ahead to determine if the next note should be scheduled

scheduleAheadTimeSeconds

The time window in seconds in which to schedule notes ahead of time

tempo

The tempo of the song. This is needed to determine the how many seconds a note is played for

Attributes

Source
NoteScheduler.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def scheduleInstrument[Settings](musicalEvent: MusicalEvent, instrument: Instrument[Settings], settings: Settings)(using audioContext: AudioContext): IO[Unit]

Attributes

Source
NoteScheduler.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product