Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to program a simple music sequencer for Android (Java) [closed]

What I want to do:

I would like to program a very simple music sequencer for Android. But I've never worked with audio on Android or in Java, respectively.

What the application should do:

  • play back samples (WAVE/OGG files)
  • play several audio channels simultaneously (e.g. the trumpet and the flute should play simultaneously, maximum of 10 instruments)
  • change the pitch of the samples (e.g. the trumpet WAVE file must be played in normal pitch (c4) and lower/higher pitch (e2/g6) and so on)

This is what the application should be able to do in general.

What components do I need? A normal media player (AudioManager?) won't work, right?

There are already some applications which do what I am thinking about:

  • FingerBeat for iOS
  • FL Studio Mobile for iOS
  • Uloops Studio for Android

Thanks in advance for your help!

like image 536
caw Avatar asked Oct 19 '11 15:10

caw


People also ask

Can sequencers record sound?

A music sequencer (or audio sequencer or simply sequencer) is a device or application software that can record, edit, or play back music, by handling note and performance information in several forms, typically CV/Gate, MIDI, or Open Sound Control (OSC), and possibly audio and automation data for DAWs and plug-ins.

How does a MIDI sequencer work?

The MIDI sequencer allows the user to record and edit a musical performance without using an audio-based input source. The performance is recorded as a series of events that would ordinarily be played in from a keyboard instrument.

What is a sequencer in music production?

Sequencers allow you to program a combination of notes, rhythms, articulations and effects that can be sent to anything from your DAW of choice to hardware synths. By programming your patterns, melodies and loops, you free yourself up to experiment with mixing, dynamics and performing with other instruments.


2 Answers

There is very simple open source beat sequencer for Android called SoundFuse. They have description and screenshots on the page.

Here is the github repository.

like image 97
Lycha Avatar answered Sep 22 '22 22:09

Lycha


You have not one simple requirement, but three very different requirements.

  1. Playing WAV should be supported out of the box by the JRE with the help of the classes in javax.sound.sampled, it jsut requires some code to wire it up (not too sure about android).

  2. Playing OGG is not supported out of the box. There is an open source implementation for OGG called jOrbis, see their web site. Again this can require some wiring code to hook into your application.

  3. For a Sequencer, you could just use MIDI. Again it should be supported by the JRE, and if it is not on your platform, you can use Gervill - a pure Java MIDI sequencer (Project web site).

  4. There is also a ModPlayer that can play good old Soundtracker and some others. This can also be abused as a Sequencer of some sort if you know the Soundtracker or Screamtracker module format (ancient format, but descriptions are still available on the net). Player with source can be found here. The Tracker formats are not all that ancient by the way, some of todays game engines still make use of them.

  5. If you really want, you can cook up your own Sequencer, all the basic stuff if there in javax.sound.sampled. It just requires some basic knowledge about digital sound and a big lot of wiring code.

There is no single solution for all your needs, you will have to stitch you own together from the building blocks freely available.

like image 45
Durandal Avatar answered Sep 22 '22 22:09

Durandal