Thanks @Sam_Pluta @jamshark70
now there is the problem of remove rest with Rest(0)…
just to clarify the problem.
m = SimpleMIDIFile.read( “~/Desktop/abletonMidi.mid” );
// to have the [\midinote, \dur]
x = m.generatePatternSeqs.flatten(1).postln;
here it’s not amp - dur it’s [\midinote, \dur] something like this:
[ [ 72, 0.25 ], [ rest, 0.25 ], [ 72, 0.25 ], [ rest, 0.25 ], [ 72, 0.25 ], [ 72, 0.25 ] ]
(
x.size.do{|i|
var a;
m.generatePatternSeqs.flatten(1).wrapAt(i).doAdjacentPairs({
arg item,item1, i; [
a = if(item == ‘rest’,{ item = “Rest(0),” + item1 },{ item +“,”+ item1 });
].postln;
});
}
)
// here I’m able to substitute the rest with Rest(0) in the post windows:
[ 72 , 0.25 ][ Rest(0), 0.25 ][ 72 , 0.25 ][ Rest(0), 0.25 ][ 72 , 0.25 ][ 72 , 0.25 ]
but I can’t find a way to have everything in order in a new array.
I mean not in the post window, but in an array, with the correct structure/syntax
[[ 72 , 0.25 ],[ Rest(0), 0.25 ],[ 72 , 0.25 ],[ Rest(0), 0.25 ],[ 72 , 0.25 ],[ 72 , 0.25 ]]
if you have any hint it would be great
thanks like always