Cacofonix

Cacofonix is a library to create midi files.
393 Downloads
Updated 6 Feb 2012

View License

Cacofonix is a library to create midi files. A complete documentation is provided in the archive.

To preview a little more, this is an (advanced, don't panic) example:

NoteInit

COUPLET = Note( 'Marker', 'COUPLET' );

RYTHMIC = [ ...
R:N8 G:N8 A:N8 C++C:N8 bar ...
~C++C:N2 R:N8 G:N8 A:N8 D++D:N8 bar ...
~D++D:N2 R:N8 D++D:N8 E++E:N8 F++F:N8 bar ...
~F++F:[N2 N8] F:N8 G:N8 C++C:N8 bar ...
~C++C:N2 ];

RIFF = [ V-0:N8 bar ~V-0:[N2 N4'] ];

CHOEUR = [ C*CM*RIFF D*CM*RIFF F*CM*RIFF C*CM*RIFF ];

CHOEUR2 = [ (-G+C+E)*RIFF (-Fs+-A+C+D)*RIFF (-A+C)*RIFF (-E+-G+C)*RIFF ];

CHOEUR3 = [ ~COUPLET R:N4' C*RIFF D*RIFF F*RIFF C*CM:N8 bar ...
~C:N8 G:N8 A:N8 +C:N4 R:N4' bar ];

LYRIC = [ ~COUPLET ...
R:N8 C:N8 E:N8 G:N8 bar ...
A:N8 A:N8 G:N4 E:N4 D:N8 C:N8 bar ...
C:N8 D:N4 -A:N4 -G:N8 -A:N8 C:N8 bar ...
~C:N4 G:N4 E:N4 D:N8 C:N8 bar ...
R:N bar ];

PIANO = [ Note('--') RYTHMIC COUPLET RYTHMIC ~C++C:N2 bar ] / ...
[ R:N4' CHOEUR2*2 ~-E+-G+C:N8 bar ];

BASS = [ Note('-') ~COUPLET [ RYTHMIC ~C++C:N2 ] / ...
[R:N4' CHOEUR R:N8 ] bar ];

PERCU = [ R:N2 bar 8*[ [ V R V V V R V R ].*N16 R:N2 bar ] ];

TAMBO = [ R:N2 bar 8*[ R V bar ].*N2 ];

cacofonix( 'F@#getYou_CeeLoGreen', 'Tempo', 130, ...
'Honky-tonk Piano', PIANO, ...
'Solo Synth Vox', LYRIC, ...
'Voice Oohs', CHOEUR3, ...
'Acoustic Bass', BASS, ...
'Acoustic Grand Piano', BASS, ...
'Low Bongo', PERCU, ...
'Tambourine', TAMBO );

If you can modify the sound font of your player, I used ChoriumRevA: you can get it on the web for free. But don't worry if you can't, or if you don't know what is a sound font.

Cite As

Benoit Charles (2024). Cacofonix (https://www.mathworks.com/matlabcentral/fileexchange/34945-cacofonix), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0