Issues with sound output


#1

I’m new in this stuff and my code can’t sound. Someone can help me to make that code sound? Thank you

import ddf.minim.*;
import ddf.minim.ugens.*;

Minim minim;
AudioOutput out;

void setup(){
minim = new Minim(this);
 AudioOutput out = minim.getLineOut();
 out.setTempo(100);
   out.resumeNotes(); 
   
   String[] seq_bass = {"C2","E2”,”G2”,”B2”,”C3”,”B2","G2","E2","C2","E2”,”G2”,”B2”,”C3”,”B2","G2","E2"};
    for (int bar=0;bar<16;bar++){
  for (int i=0;i<seq_bass.length;i++){
    out.playNote( bar*8+0.25*i, 0.06, seq_bass[i] );
    out.playNote( 0.25*i+0.375, 0.06, seq_bass[i] );
    }
}


   out.pauseNotes();
}

#2

What’s wrong here?

first of all the TITLE,
pls edit to something useful so readers might want to help you.

also the code should be formatted
using the Preformatted text feature

</>

when you start using a big library like

minim

you start from a example,
and to help us, so we not have to search 20min where you start from
you should point out here from what example you started.

also there might be too many problems involved, your computer,
operating system, sound hardware…
so you should test first the example ( without any changes )
and report here that with that you hear the sound,
but after making following change … NOT.

now to your problem:
i see some basic problems about variables
and also about resume / pause
so i made it to give out ( not sound ), some terrible noise!!
you are very lucky that it does not work.

import ddf.minim.*;
import ddf.minim.ugens.*;

Minim minim;
AudioOutput out;

void setup() {
  minim = new Minim(this);
  out = minim.getLineOut();
  out.setTempo(100);
  out.pauseNotes();

  String[] seq_bass = {"C2", "E2", "G2", "B2", "C3", "B2", "G2", "E2", "C2", "E2", "G2", "B2", "C3", "B2", "G2", "E2"};
  for (int bar=0; bar<16; bar++) {
    for (int i=0; i<seq_bass.length; i++) {
      out.playNote( bar+0.25*i, 0.06, seq_bass[i] );
      out.playNote( 0.25*i+0.375, 0.06, seq_bass[i] );
    }
  }
  out.resumeNotes();
}

void draw() {
}


#3

@mllobet We hope the example helps. Feel free to let us know if you have any more questions or comments.

Also, here are some tips that can help you get assistance with your questions quicker. - Guidelines—Tips on Asking Questions

Best of luck on your project :slight_smile: