Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C library for loading, saving and converting FM sound chip voice files in various formats

License

NotificationsYou must be signed in to change notification settings

vampirefrog/libfmvoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project status

Linux Build

Code for loading and saving various FM voice formats meant for the Yamaha YM series of chips (OPL, OPM, OPN etc.), format autodetection code, and conversion between the various formats.

This library is meant to be used infmtoy andvgm2x.

File Formats

FormatTypeOpMax voices
INSOPN41
DMPOPN41
OPMOPM4unlimited
TFIOPN41
Y12OPN41
SBIOPL21
INSOPL21
BNKOPL265536
IBKOPL2128
CMFOPL2128/256/65536

Structures

OPL

FieldBitDescription
76543210
ch_fb_cnt[0]DCBAFBCNTChannel mask, feedback, connection
dam_dvb_ryt_bd_sd_tom_tc_hhAMVIBRYTBDSDTOMTCHH
am_vib_eg_ksr_mulAMVIBEGTKSRMUL
ksl_tlKSLTL
ar_drARDR
sl_rrSLRR
wsWSWaveform select

Conversion

Conversion between OPL, OPM and OPN voices is only possible in some cases, in other cases it involves approximation, and in others it is not possible.

OPM files

Reading:

uint8_t*data;// Have your data in this buffersize_tdata_len;// with this lengthstructopm_fileopm;intr=opm_file_load(&opm,data,data_len);if(r!=OPM_FILE_SUCCESS) {fprintf(stderr,"Could not load file: %s (%d)\n",opm_file_error_string(r),r);exit(1);}

Writing:

size_twrite_fn(void*buf,size_tbufsize,void*data_ptr) {FILE*f= (FILE*)data_ptr;returnfwrite(buf,1,bufsize,f);}structopm_fileopm;opm_file_init(&opm);FILE*f=fopen("out.opm","w");intopm_file_save(&opm,write_fn,f);fclose(f);

Building with emscripten

emmake make libfmvoice.a

Formulae

OPM LFO

$f_{LFO} = \frac{f_{master}}{(8 \times (256 - R))}$

OPN LFO

$f_{LFO} = \frac{f_{master}}{2^{LFO\_DIV} \times (108 - LFO\_FREQ)}$

About

C library for loading, saving and converting FM sound chip voice files in various formats

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp