# Processing.sound: Target VM failed

**URL:** https://discourse.processing.org/t/processing-sound-target-vm-failed/30186
**Category:** Libraries
**Created:** [May 20, 2021, 9:31am UTC](https://discourse.processing.org/t/processing-sound-target-vm-failed/30186 "2021-05-20T09:31:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pokelan](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@pokelan](https://discourse.processing.org/u/pokelan)
#### Post date: [May 20, 2021, 9:31am UTC](https://discourse.processing.org/t/processing-sound-target-vm-failed/30186/1 "2021-05-20T09:31:13Z")

</div>

Hi all

I am using Processing 3.5.4 on linux. According to the Contribution Manager the sound library from The Processing Foundation is installed.

I tried to run this code from the Sound tutorial ([Sound \ Processing.org](https://processing.org/tutorials/sound/)):

```auto
/**
 * Processing Sound Library, Example 1
 * 
 * Five sine waves are layered to construct a cluster of frequencies. 
 * This method is called additive synthesis. Use the mouse position 
 * inside the display window to detune the cluster.
 */

import processing.sound.*;

SinOsc[] sineWaves; // Array of sines
float[] sineFreq; // Array of frequencies
int numSines = 5; // Number of oscillators to use

void setup() {  
  size(640, 360);
  background(255);

  sineWaves = new SinOsc[numSines]; // Initialize the oscillators
  sineFreq = new float[numSines]; // Initialize array for Frequencies

  for (int i = 0; i < numSines; i++) {
    // Calculate the amplitude for each oscillator
    float sineVolume = (1.0 / numSines) / (i + 1);
    // Create the oscillators
    sineWaves[i] = new SinOsc(this);
    // Start Oscillators
    sineWaves[i].play();
    // Set the amplitudes for all oscillators
    sineWaves[i].amp(sineVolume);
  }
}

void draw() {
  //Map mouseY from 0 to 1
  float yoffset = map(mouseY, 0, height, 0, 1);
  //Map mouseY logarithmically to 150 - 1150 to create a base frequency range
  float frequency = pow(1000, yoffset) + 150;
  //Use mouseX mapped from -0.5 to 0.5 as a detune argument
  float detune = map(mouseX, 0, width, -0.5, 0.5);

  for (int i = 0; i < numSines; i++) { 
    sineFreq[i] = frequency * (i + 1 * detune);
    // Set the frequencies for all oscillators
    sineWaves[i].freq(sineFreq[i]);
  }
}

```

I receive the following error message:  
Could not run the sketch (Target VM failed to initialize).

Thanks for your help!

---

<div class="post-metadata">

### Author: ![pokelan](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@pokelan](https://discourse.processing.org/u/pokelan)
#### Post date: [May 30, 2021, 11:11am UTC](https://discourse.processing.org/t/processing-sound-target-vm-failed/30186/2 "2021-05-30T11:11:59Z")

</div>

Anyone having an idea to that?
