Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: Midi in Android Studio

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Midi in Android Studio

    I search for a "simple code to play a sound note" in Android but can not find anything. In Java Eclipse, it is easy to use javax.sound.midi.*.
    Synthesizer midiSynth = MidiSystem.getSynthesizer();
    midiSynth.open();
    Instrument[] instr = midiSynth.getDefaultSoundbank().getInstruments();
    MidiChannel[] mChannels = midiSynth.getChannels();
    midiSynth.loadInstrument(instr[8]); //load an instrument
    mChannels[0].noteOn(60, 1000); //On channel 0, play note number 60 with velocity 1000

    I need help for the simple code like this in Android Studio. to generate a tone, e.g. DO/ RE/ MI note in Android app

  2. The Following User Says Thank You to docco2020 For This Useful Post:

    Promiseoracle (September 23rd, 2021)

Similar Threads

  1. Replies: 6
    Last Post: May 21st, 2019, 07:42 PM
  2. Android studio | how to make a button text unchangable after changing it once
    By kukupie123 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 21st, 2019, 04:17 AM
  3. Facing a problem in android studio ( java )
    By fallen01 in forum Android Development
    Replies: 22
    Last Post: December 31st, 2018, 03:07 AM
  4. android studio problem
    By pingusteam in forum Android Development
    Replies: 3
    Last Post: August 30th, 2018, 03:27 PM
  5. Integrate Android studio with lwuit
    By youssef77 in forum Android Development
    Replies: 0
    Last Post: August 2nd, 2014, 08:17 AM