Skip to content

Cannot read/play files written by writemidi  #1

Open
@grinsted

Description

@grinsted

The midi files i write appear to be malformed(?). Example

addpath c:\miditoolbox

halftonespan=24;
root=64;
bpm=120;
duration=1/8;

Y=rand(10,1);
Y=round(Y*halftonespan)+root;

nmat=zeros(length(Y),7);
nmat(:,1)=(0:length(Y)-1)*duration;
nmat(:,2)=duration;
nmat(:,3)=1;
nmat(:,4)=Y;
nmat(:,5)=100;
nmat(:,6)=nmat(:,1)*(60/bpm);
nmat(:,7)=nmat(:,2)*(60/bpm);

writemidi(nmat,'test.mid',120,bpm);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions