当前位置:首页 > 芯闻号 > 充电吧
[导读]Atitit jfugue midi make tour attilx sumup目录1.1. Jyepu prob not support ,gazi nonge map trans支持简谱解决方案

Atitit jfugue midi make tour attilx sumup

目录

1.1. Jyepu prob not support ,gazi nonge map trans支持简谱解决方案 1

1.2. Tone len problem??note 音符 音长 1

1.3. Jyepai spltor prob ,,mosi not need   jyepu hto d just for readd 节拍分隔符问题 1

1.4. 保存为mid文件 1

1.5. 分析mid文件为txt 4

 

1.1. Jyepu prob not support ,gazi nonge map trans支持简谱解决方案1.2. Tone len problem??note 音符 音长

A5h   ,,must mid has 5.beir ingore

 

1.3. Jyepai spltor prob ,,mosi not need   jyepu hto d just for readd 节拍分隔符问题

 

1.4. 保存为mid文件

 

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 will 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("



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(indexlast);

String newtone=li_lasttone+"5H";

li.remove(indexlast);

li.add(newtone);

continue;

}

}


 

return li;

}

}

 

1.5. 分析mid文件为txt

 

 

Player player = new Player();

//两只老虎Pattern pattern1 = new Pattern("I[40] C5q D5q E5q C5q");

//跑得快Pattern pattern2 = new Pattern("E5q F5q G5h");

//一只没有眼睛Pattern pattern3 = new Pattern("G5i A5i G5i F5i E5q C5q");

//真奇怪Pattern pattern4 = new Pattern("C5q G4q C5h");

// Put all of the patters together to form the songPattern song = new Pattern();song.add(pattern1, 2);

// Adds 'pattern1' to 'song' twicesong.add(pattern2, 2); // Adds 'pattern2' to 'song' twicesong.add(pattern3, 2);

// Adds 'pattern3' to 'song' twicesong.add(pattern4, 2);

 // Adds 'pattern4' to 'song' twice

// Play the song!player.play(song);

本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除。
换一批
延伸阅读

Atitit 格式转换的艺术以excel转换txt为例 目录1. 需要的技术 11.1. 遍历 与循环 11.2. 序列化 31.3. 文本序列化 json csv 32. Bp最佳实践与流程总结 3

关键字: atitit 遍历与循环模式

Atitit 网络设备的自动发现机制需求如下:1、自动获取当前设备所在网段及当前与当前网段有连接的网段的所有IP,并判断出是哪类设备。如:服务器、交换机、防火墙等。2、如何根据第1点得到的信息,获取设

关键字: atitit 网络设备

Atitit  依赖管理之道1. 概念 依赖管理,是指在什么地方以什么形式引入外部代码。 11.1.1. 理解模块化和依赖管理: 11.2. 依赖管理,有三个层面。 单一职责原则,协议对象引用,依赖逻

关键字: atitit

Atitit 知识点 文章 框架 结构 大纲 attilax  总结 艾提拉总结 技术掌握文档总结的 v5 s420.docx1.1. Preface前言 序言 12. 技术流程了解》》选型(标准化与

关键字: atitit

Atitit 健康减肥与软件健康减肥的总结 attilax著 1. 几大最佳实践减肥行为 11.1. 控制饮食分量用小碗 小盘子 小餐具 11.2. 软件如何减肥,控制资源占有率,比如体积 打包体积小

关键字: atitit 封装

Atitit 艾提拉整理清明节的诗歌集合 清明节的特征  万物复苏 百草发芽  尝试从股市 其他外国诗歌集 得到清明的诗歌 约谈春天 歌颂春天下雨 不见方三日、 夜来风雨声,花落知多少。(孟浩然:《春

关键字: atitit

Atitit 知识与学科的分类 杜威十进分类法 图书分类法已经采用二十二个大类 目录1.1. 类知识的积累是一个从少到多的过程 11.2. 杜威十进分类法(Dewey Decimal Classifi

关键字: atitit

Atitit webdav 的问题 -------------大文件传输问题 在某些版本的 Windows 操作系统中,WebDAV 驱动器的最大文件大小被限制为 50MB。如果你试图复制超过 50M

关键字: atitit webdav 大文件传输

Atitit oil painting article list sumup s55  C:\Users\Administrator\Desktop\油画技术资料包\Atitit Atitit 图像处

关键字: atitit

Atitit 培训之道 attilax著 1. 概念 培训就是及教育 11.1. 知识体系化 21.2. 组织架构 21.3. 人员架构 梯队化培训 22. 培训目标,尽可能与项目相关技术点,或者向上

关键字: atitit
关闭