Table of Contents

Bonsai

Bonsai is a visual reactive programming language for building interactive experiments and processing data streams in real time. It supports a growing ecosystem of hardware and software packages that are commonly used in neuroscience. This article will cover how to start using the Sound Card in Bonsai.

Tip

More information on Bonsai can be found in the official documentation.

First steps

We will use an introductory example to get started with the device in Bonsai. This example plays a sound 5 seconds after the workflow starts. We revisit this example in more detail in the "Examples" section.

Before beginning:

  • Connect an amplifier and speaker to an output channel by following the audio connection instructions.
  • Connect the power supply and USB (Computer) cable by following the power and PC connection instructions.
  • Install Bonsai and add the Harp.SoundCard and Bonsai.StarterPack packages.
  • Upload a sound to sound index 2 with the Sound Card app or in Bonsai.
  • Launch "Bonsai" from the Windows Start menu.
  • Hover over the workflow cell below, and click on the "Copy" icon on the top right.
  • Paste the workflow into Bonsai.

Sound Card first steps

Tip

If your workflow does not look like the one above, make sure that the Harp.SoundCard and Bonsai.StarterPack packages are installed.

  • Click on the SoundCard (Device) operator and set the PortName property to the communications port for the device (e.g. COM8).
  • Click on the SoundCardDataWriter (DeviceDataWriter) operator and set the Path property for the name and location of the save folder (e.g. SoundCard.harp).
  • Press the "Start" button in Bonsai to run the workflow.

After 5 seconds, the sound plays and the AUDIO LED on the device turns on for its duration.

The device is ready to use. If, instead, you hear nothing or an error appears in Bonsai, check out the troubleshooting section.

Next, we suggest going through the "Examples" section if you are not familiar with using Harp devices in Bonsai.

Alternatively, if you have experience with Harp devices, you can check the register table in the reference to access the device functionality directly.



Documentation for release v3.0.0