Atitit jfugue midi make tour ATTILX SUMUP directory 1.1. Jyepu prob not supported, Gazi Nonge map Trans supports simplified resolution

Source: Internet
Author: User
Tags join trim

Atitit jfugue midi make tour ATTILX SumUp

Directory

1.1. Jyepu prob not supported, Gazi Nonge map trans Support simplified solution 1

1.2. Tone len problem?? Note Note Syllables 1

1.3. Jyepai spltor prob, mosi not need Jyepu Hto D just for readd beat separator problem 1

1.4. Save as Mid file 1

1.5. Analyze the mid file as txt 4

1.1. Jyepu prob not supported, Gazi Nonge map Trans supports simplified solution 1.2. Tone len problem?? Note Note Syllables

A5H, must mid has 5.beir Ingore

1.3. Jyepai spltor prob, mosi not need Jyepu hto D-Just for readd beat separator problem

1.4. Saving as mid file

Package Midtool;

import java.io.File;

import java.io.IOException;

import Java.util.HashMap;

import java.util.List;

import Java.util.Map;

import Org.jfugue.midi.MidiFileManager;

import Org.jfugue.pattern.Pattern;

import Org.jfugue.player.Player;

import org.staccato.ReplacementMapPreprocessor;

import Org.staccato.maps.SolfegeReplacementMap;

import Com.attilax.collection.listBuilder;

import Com.attilax.util.timestampUtil;

import Com.google.common.base.Joiner;

import com.google.common.collect.Lists;

Public class Solfegereplacementmapdemo {

Public Static void Main (string[] args) throws IOException {

Map Rules = new HashMap () {{

Put ("1", "C");

Put ("2", "D");

Put ("3", "E");

Put ("4", "F");

Put ("5", "G");

Put ("6", "a");

Put ("7", "B");

Put ("H", "H");

}};

Replacementmappreprocessor RMP = Replacementmappreprocessor.getinstance ();

Rmp.setreplacementmap (Rules). Setrequireanglebrackets (false);

Player player = new player ();

Player.play (New Pattern ("Do Re mi fa so la ti do"); This would play "C D E F G A B"

This next example brings back the brackets so durations can be added

Rmp.setrequireanglebrackets (TRUE);

Player.play (New Pattern ("<do>q <re>q <mi>h | <mi>q <fa>q <so>h | <so>q <fa>q <mi>h | <mi>q <re>q <do>h "));

Pattern Pattern1 = new pattern ();

String s= "1155665-4433221-5544332-5544332-1155665-4433221-";//5544332 5544332 1155665 4433221

Listbuilder Listbuilder = strservice.$ (s). Replace ("AAA", "\\|"). ToList (). Trimelement ();

List Li=processtonelen (listbuilder.liobj,rules);

String s2=listbuilder.join (""). Build ();

String joinspaceafted = Joiner.on (""). Join (LI);

System. out. println (joinspaceafted);

Pattern1.add (joinspaceafted);

File File = new file (Timestamputil.join ("C:\\0log\\atifirstmid@tmstmp@.mid"). Astimestamp_millsec _filenameencode ());

New Midifilemanager (). Savepatterntomidi (Pattern1, file);

System. out. println ("--");

}

Private Static List Processtonelen (list liobj, Map rules) {

List Li=lists.newarraylist ();

String Lasttone;

for (Object Object : Liobj) {

String Tone= (string) object.tostring (). Trim ();

if (Tone.trim (). Length () ==0)

continue;

if (!tone.equals ("-"))

{

String TrueTone= (string) rules.get (tone);

Li.add (TrueTone); continue;

}

if (Tone.equals ("-"))

{

int indexlast = li.size ()-1;

String Li_lasttone= (string) li.get (

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.