资源简介
哼唱检索是基于旋律内容的音乐检索,指用户通过唱出歌词或者哼出歌曲旋律作为输入检索数据,从旋律数据库中检索相对应音乐的检索方法;相对于传统的基于文本的音乐检索,哼唱检索给用户提供了更便捷友好的查询方式,不仅可以作为基于文本的音乐检索一种有益补充,而且还能带来更佳的用户体验。
代码片段和文件信息
#include
#include
#include
#include “midifile.h“
/*
* Data Types
*/
struct MidiFile
{
int file_format;
MidiFileDivisionType_t division_type;
int resolution;
int number_of_tracks;
struct MidiFileTrack *first_track;
struct MidiFileTrack *last_track;
struct MidiFileEvent *first_event;
struct MidiFileEvent *last_event;
};
struct MidiFileTrack
{
struct MidiFile *midi_file;
int number;
long end_tick;
struct MidiFileTrack *previous_track;
struct MidiFileTrack *next_track;
struct MidiFileEvent *first_event;
struct MidiFileEvent *last_event;
};
struct MidiFileEvent
{
struct MidiFileTrack *track;
struct MidiFileEvent *previous_event_in_track;
struct MidiFileEvent *next_event_in_track;
struct MidiFileEvent *previous_event_in_file;
struct MidiFileEvent *next_event_in_file;
long tick;
MidiFileEventType_t type;
union
{
struct
{
int channel;
int note;
int velocity;
}
note_off;
struct
{
int channel;
int note;
int velocity;
}
note_on;
struct
{
int channel;
int note;
int amount;
}
key_pressure;
struct
{
int channel;
int number;
int value;
}
control_change;
struct
{
int channel;
int number;
}
program_change;
struct
{
int channel;
int amount;
}
channel_pressure;
struct
{
int channel;
int value;
}
pitch_wheel;
struct
{
int data_length;
unsigned char *data_buffer;
}
sysex;
struct
{
int number;
int data_length;
unsigned char *data_buffer;
}
meta;
}
u;
int should_be_visited;
};
/*
* Helpers
*/
static signed short interpret_int16(unsigned char *buffer)
{
return ((signed short)(buffer[0]) << 8) | (signed short)(buffer[1]);
}
static signed short read_int16(FILE *in)
{
unsigned char buffer[2];
fread(buffer 1 2 in);
return interpret_int16(buffer);
}
static void write_int16(FILE *out signed short value)
{
unsigned char buffer[2];
buffer[0] = (unsigned char)((value >> 8) & 0xFF);
buffer[1] = (unsigned char)(value & 0xFF);
fwrite(buffer 1 2 out);
}
static unsigned short interpret_uint16(unsigned char *buffer)
{
return ((unsigned short)(buffer[0]) << 8) | (unsigned short)(buffer[1]);
}
static unsigned short read_uint16(FILE *in)
{
unsigned char buffer[2];
fread(buffer 1 2 in);
return interpret_uint16(buffer);
}
static void write_uint16(FILE *out unsigned short value)
{
unsigned char buffer[2];
buffer[0] = (unsigned char)((value >> 8) & 0xFF);
buffer[1] = (unsigned char)(value & 0xFF);
fwrite(buffer 1 2 out);
}
static unsigned long interpret_uint32(unsigned char *buffer)
{
return ((unsigned long)(buffer[0]) << 24) | ((unsigned long)(buffer[1]) << 16) | ((unsigned long)(buffer[2]) << 8) | (unsigned long)(buffer[3]);
}
static unsigned long read_uint32(FILE *in)
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 204800 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHBuildModel\SDHBuildModel.exe
..AD... 0 2014-03-19 14:51 盛大语音创新院哼唱检索开源软件\bin\SDHBuildModel
文件 128000 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHumming\0ef43554d_768.wav
文件 182612 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHumming\QBHModel.dat
文件 1144 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHumming\QBHModel.info
文件 32387 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHumming\res.txt
文件 711 2010-09-29 17:48 盛大语音创新院哼唱检索开源软件\bin\SDHumming\result.txt
文件 74 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHumming\run.bat
文件 104448 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHumming\SDFuzzySearch.dll
文件 65536 2010-09-30 09:04 盛大语音创新院哼唱检索开源软件\bin\SDHumming\SDHumming.exe
文件 120354 2010-09-30 10:03 盛大语音创新院哼唱检索开源软件\bin\SDHumming\test.wav
..AD... 0 2014-03-19 14:51 盛大语音创新院哼唱检索开源软件\bin\SDHumming
..AD... 0 2014-03-19 14:51 盛大语音创新院哼唱检索开源软件\bin
文件 35193 2010-09-30 10:51 盛大语音创新院哼唱检索开源软件\COPYRIGHT.txt
文件 1164 2010-09-30 09:24 盛大语音创新院哼唱检索开源软件\demo\100Songs.txt
文件 136192 2010-09-30 12:48 盛大语音创新院哼唱检索开源软件\demo\README.doc
文件 119830 2010-09-30 16:44 盛大语音创新院哼唱检索开源软件\demo\README.pdf
文件 4422371 2010-09-30 16:25 盛大语音创新院哼唱检索开源软件\demo\SDHummingDemoSetup.exe
..AD... 0 2014-03-19 14:51 盛大语音创新院哼唱检索开源软件\demo
文件 374 2010-09-30 10:04 盛大语音创新院哼唱检索开源软件\lib\README.txt
文件 36864 2010-09-29 21:20 盛大语音创新院哼唱检索开源软件\lib\win32\SDFuzzySearch.dll
文件 2104 2010-09-29 21:20 盛大语音创新院哼唱检索开源软件\lib\win32\SDFuzzySearch.lib
..AD... 0 2014-03-19 14:51 盛大语音创新院哼唱检索开源软件\lib\win32
文件 25600 2010-09-29 21:08 盛大语音创新院哼唱检索开源软件\lib\win64\SDFuzzySearch.dll
文件 2102 2010-09-29 21:08 盛大语音创新院哼唱检索开源软件\lib\win64\SDFuzzySearch.lib
..AD... 0 2014-03-19 14:51 盛大语音创新院哼唱检索开源软件\lib\win64
..AD... 0 2014-03-19 14:51 盛大语音创新院哼唱检索开源软件\lib
文件 1164 2010-09-30 09:24 盛大语音创新院哼唱检索开源软件\model\100Songs.txt
文件 182616 2010-09-16 00:19 盛大语音创新院哼唱检索开源软件\model\QBH.Model
文件 3926 2010-09-14 18:57 盛大语音创新院哼唱检索开源软件\model\QBHModel.info
............此处省略32个文件信息
评论
共有 条评论