Packages

  • package root
    Definition Classes
    root
  • package o1

    O1Library is a toolkit designed for the course Programming 1 (a.k.a. O1) at Aalto University.

    O1Library is a toolkit designed for the course Programming 1 (a.k.a. O1) at Aalto University. It contains an assortment of tools; most prominently, it provides a framework for simple graphical programming and utilities for playing sound.

    This is the front page of O1Library’s documentation. However, this is probably not the best place to start learning about O1Library as a student. That’s because the relevant content of this library is introduced bit by bit in the chapters of O1’s custom ebook alongside the associated programming concepts and assignments.

    You may still find this documentation useful as a reference. You can also find some optional content here that you may wish to try.

    This front page lists the content available in the top-level package called simply o1. These tools are available with the simple command import o1._ in your Scala programs. Some of them you’ll use a lot; some of them you won’t necessarily need at all.

    The tools listed here are actually implemented in a number of subpackages (o1.gui, o1.sound, etc.); what you see here are just “shortcut aliases” to those actual implementations. The aliases are here to make that convenient import command work and to provide you with this list of links to some of the more commonly used tools in O1Library. The subpackages also contain additional content not listed here.

    O1Library has been developed by Aleksi Lukkarinen and Juha Sorva. Several of the key components in o1.gui and o1.world are built upon Aleksi’s Scala Media Computation Library. Some parts of O1Library draw inspiration from the “teachpacks” of the Racket programming language.

    We are grateful to Riku Autio, Joonatan Honkamaa, Juhani Numminen, Leo Varis, Veera Kahva, and anonymous students for bug reports and fixes. We thank Otto Seppälä for helpful discussions.

    Definition Classes
    root
  • package sound

    Please see one of the two subpackages:

    Please see one of the two subpackages:

    • o1.sound.midi for MIDI sound described in terms of notes, instruments, and other directives
    • o1.sound.sampled for working with recorded sound samples.
    Definition Classes
    o1
  • package sampled

    This is one of O1’s sound packages (the other being o1.sound.midi).

    This is one of O1’s sound packages (the other being o1.sound.midi). This package provides a simple interface for loading recorded sound samples.

    The contents of the package have aliases in the top-level package o1, so they are accessible to students simply via import o1._.

    Definition Classes
    sound
  • Sound

trait Sound extends AnyRef

Each instance of this trait represents a recorded sound sample.

You create Sounds with the methods on the companion object: Sound("my_sound_file.wav"). The supported formats are WAV, AIFF, AU, AIFC, and SND.

This trait has an alias in the top-level package o1, so it’s accessible to students simply via import o1._.

This type is essentially a wrapper around the key functionality in javax.sound.Sampled, especially its Clip class.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Sound
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract val description: String

    A description of the sound’s origin.

    A description of the sound’s origin. Examples:

    • "file:/D:/O1Course/Pong/bin/sounds/slap.wav"
    • "http://www.aalto.fi/does_not_exist.wav (failed to create)"
  2. abstract def isDefined: Boolean

    whether the Sound object represents a successfully loaded sound sample.

    whether the Sound object represents a successfully loaded sound sample. This will be true if the methods on the companion object successfully loaded the sound from a file or a URL, and false if there was a problem

  3. abstract def play(repeats: Int = 0, volume: Float = this.volume): Unit

    Plays the sound sample, possibly multiple times in sequence.

    Plays the sound sample, possibly multiple times in sequence.

    repeats

    how many additional times the sound should play after being played once; if you pass in KeepRepeating, the sound will repeat indefinitely unless stop is called

    volume

    you may pass in a number to override the sounds’s default volume adjustment

  4. abstract def stop(): Unit

    Stops the playing of the sound sample, previously started with play.

  5. abstract val volume: Float

    an adjustment to the loaded sound sample’s volume: a positive number makes it louder a negative one quieter.

    an adjustment to the loaded sound sample’s volume: a positive number makes it louder a negative one quieter. A value equal to Mute means the sound is completely silent.

  6. abstract def withVolume(differentVolume: Float): Sound

    Returns an other Sound otherwise identical to this one but with the given volume adjustment.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString: String

    A String representation of the sound; equals description.

    A String representation of the sound; equals description.

    Definition Classes
    Sound → AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped