基本信息
源码名称:源码:MIDI 文件生成音乐乐谱(Midi To Sheet Music)
源码大小:0.26M
文件格式:.zip
开发语言:C#
更新时间:2018-01-16
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

MIDI 文件生成音乐乐谱



/*
 * Copyright (c) 2007-2011 Madhav Vaidyanathan
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 */

using System;
using System.Drawing;
using MidiSheetMusic;

public class MainClass {

    [STAThread]
    public static void Main(string[] argv) {
        if (argv.Length < 2) {
            Console.WriteLine("Usage: sheet input.mid output_prefix(_[page_number].png)");
            return;
        }
        string filename = argv[0];
        SheetMusic sheet = new SheetMusic(filename, null);
		
		int numpages = sheet.GetTotalPages();
		string image_filename = argv[1];
        for (int page = 1; page <= numpages; page  ) {
            Bitmap bitmap = new Bitmap(SheetMusic.PageWidth 40,
                                       SheetMusic.PageHeight 40);
            Graphics g = Graphics.FromImage(bitmap);
            sheet.DoPrint(g, page);
            bitmap.Save(image_filename   "_"   page   ".png",
                        System.Drawing.Imaging.ImageFormat.Png);
            g.Dispose();
            bitmap.Dispose();
        }
    }
}