is it possible, (yet), to record and playback midi sequences in pd with any externals? thanks, ken
Hallo, Ken hat gesagt: // Ken wrote:
is it possible, (yet), to record and playback midi sequences in pd with any externals?
You can do a lot even without any externals: For example, using the [timer] object and a handful of dollars in messages, you can record the data coming in from a [notein] object into a qlist:
[notein ] | | | [t b b f] | | | | | | | [timer] | | | | | | | | | | | [pack 0 0 0 0] | [add $1 NOTE $2 $3 $4( | [qlist]
Then you can playback the [qlist] and will receive the stored sequence in a receiver called [r NOTE], which you can connect to [noteout] for example. Similar constructs canbe used for [ctlin] etc.
Another approach would be the use of data structures and [del] or [pipe]
See http://royalrabbit.goto10.org/svn/goto10/pd-patches/fbar/pipeseq for an example of this approach.
Frank Barknecht _ ______footils.org_ __goto10.org__
Frank Barknecht wrote:
Hallo, Ken hat gesagt: // Ken wrote:
is it possible, (yet), to record and playback midi sequences in pd with any externals?
You can do a lot even without any externals: For example, using the [timer] object and a handful of dollars in messages, you can record the data coming in from a [notein] object into a qlist:
[notein ] | | | [t b b f] | | | | | | | [timer] | | | | | | | | | | | [pack 0 0 0 0] | [add $1 NOTE $2 $3 $4( | [qlist]
Then you can playback the [qlist] and will receive the stored sequence in a receiver called [r NOTE], which you can connect to [noteout] for example. Similar constructs canbe used for [ctlin] etc.
I'm thinking of using this technique as a way to input events to my midifile writer, which I will code as soon as I can get some time (unless somebody else does it first...). The ideal would be to have midifile work the same way as qlist, with only the internal encoding of the data being different, the advantage being that other sequencers besides pd will be able to read it.
Martin
Hallo!
(unless somebody else does it first...). The ideal would be to have midifile work the same way as qlist, with only the internal encoding of the data being different, the advantage being that other sequencers besides pd will be able to read it.
you could also use the xeq external to read and write MIDI files ... (and I think there is also an other one)
LG Georg
Georg Holzmann wrote:
Hallo!
(unless somebody else does it first...). The ideal would be to have midifile work the same way as qlist, with only the internal encoding of the data being different, the advantage being that other sequencers besides pd will be able to read it.
you could also use the xeq external to read and write MIDI files ... (and I think there is also an other one)
xeq looks very complicated to me, and I can't find any help patches for it, and it's a library. None of these issues may be important to you. But I wanted a simple record/playback type external that could be used in place of a midiin or midiout object. midifile so far can read a file and play it back at any speed from any start time. It outputs its current time so you can use that to loop it as I have done in the help patch. It won't play backwards (yet) and you can't edit the file because it seems more useful to use a qlist, which may be edited in a text editor, as the input to the (not_yet_implemented) midifile writer. Speaking of which it would be a lot easier for me to have midifile accept an entire qlist as input, that way I don't have to preallocate memory for an arbitrarily large MIDI stream...or is it better to allocate linked blocks with getbytes() as needed? I'm afraid it might glitch the audio if allocation takes the OS too long.
Martin
Hallo!
xeq looks very complicated to me, and I can't find any help patches for it, and it's a library. None of these issues may be important to you.
well, there is documentation: http://suita.chopin.edu.pl/~czaja/miXed/externs/xeq.html
But I wanted a simple record/playback type external that could be used in place of a midiin or midiout object.
yes, that can be done ... and it has some really nice feature ...
I attached patches for simple reading and writing of midi files (note: it's an "old-style" GOP patch)
LG Georg
#N canvas 627 49 384 186 12; #X text 16 21 _play_midi_file::::; #X msg 232 323 edit; #X obj 198 352 xeq $0-x; #X msg 57 264 rewind , flush; #X msg 65 297 stop , flush; #X obj 46 332 xeq_parse $0-x; #X obj 198 267 openpanel; #X msg 198 296 mfread $1; #X obj 46 363 outlet; #X obj 9 106 bng 15 250 50 0 empty empty play 0 -6 0 6 -24198 -1 -1 ; #X obj 150 110 bng 15 250 50 0 empty empty pause 0 -6 0 6 -262144 -1 -1; #X obj 228 110 bng 15 250 50 0 empty empty stop 0 -6 0 6 -262144 -1 -1; #X obj 303 110 bng 15 250 50 0 empty empty open 0 -6 0 6 -262144 -1 -1; #X msg 46 233 rewind , bang; #X obj 155 233 spigot; #X obj 76 107 tgl 15 0 empty empty loop 0 -6 0 6 -262144 -1 -1 0 1 ; #X connect 1 0 2 0; #X connect 3 0 5 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 5 7 14 0; #X connect 6 0 7 0; #X connect 7 0 2 0; #X connect 9 0 13 0; #X connect 10 0 4 0; #X connect 11 0 3 0; #X connect 12 0 6 0; #X connect 13 0 5 0; #X connect 14 0 13 0; #X connect 15 0 14 1; #X coords 0 0 1 1 180 60 1;
#N canvas 495 204 291 123 12; #X text 17 17 _record_midi_file::::; #X obj 234 66 bng 15 250 50 0 empty empty save 0 -6 0 6 -262144 -1 -1; #X obj 20 64 bng 15 250 50 0 empty empty rec 0 -6 0 6 -258699 -1 -1 ; #X obj 70 65 bng 15 250 50 0 empty empty stop 0 -6 0 6 -262144 -1 -1 ; #X obj 128 66 bng 15 250 50 0 empty empty play 0 -6 0 6 -24198 -1 -1 ; #X obj 72 189 outlet; #N canvas 598 460 730 457 inside 0; #X obj 122 27 inlet; #X obj 202 27 inlet; #X obj 278 28 inlet; #X obj 429 28 inlet; #X obj 31 32 inlet; #X msg 144 318 edit; #X msg 119 190 restop; #X msg 144 293 readd 144 $1 $2 1; #X obj 107 358 xeq_record $0-x; #X msg 189 319 rewind; #X msg 47 139 record , retrack 1-track; #X msg 229 244 mfwrite $1; #X obj 229 213 savepanel; #X msg 372 263 rewind , flush; #X msg 380 296 stop , flush; #X obj 361 331 xeq_parse $0-x; #X obj 361 362 outlet; #X msg 361 232 rewind , bang; #X obj 202 53 t b b; #X obj 477 232 spigot; #X obj 352 28 inlet; #X connect 0 0 10 0; #X connect 1 0 18 0; #X connect 2 0 17 0; #X connect 3 0 12 0; #X connect 4 0 7 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 9 0 8 0; #X connect 10 0 8 0; #X connect 11 0 8 0; #X connect 12 0 11 0; #X connect 13 0 15 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 15 7 19 0; #X connect 17 0 15 0; #X connect 18 0 13 0; #X connect 18 1 6 0; #X connect 19 0 17 0; #X connect 20 0 19 1; #X restore 72 165 pd inside; #X obj 72 138 inlet; #X obj 181 66 tgl 15 0 empty empty loop 0 -6 0 6 -262144 -1 -1 0 1 ; #X connect 1 0 6 5; #X connect 2 0 6 1; #X connect 3 0 6 2; #X connect 4 0 6 3; #X connect 6 0 5 0; #X connect 7 0 6 0; #X connect 8 0 6 4; #X coords 0 0 1 1 160 60 1;
Georg Holzmann wrote:
Hallo!
xeq looks very complicated to me, and I can't find any help patches for it, and it's a library. None of these issues may be important to you.
well, there is documentation: http://suita.chopin.edu.pl/~czaja/miXed/externs/xeq.html
It says there "This version is obsolete", and only the first three links work (xeq, xeq_host and xeq_parse), today anyway. It could be fleshed out a bit to make things clearer for those who don't already know how it works. Examples are always useful. Thanks for the two patches, together with those I can begin to understand the docs. Why not use them as part of help-xeq? I guess these are really questions for Krzysztof.
Martin
Hallo!
It says there "This version is obsolete", and only the first three links work (xeq, xeq_host and xeq_parse), today anyway. It could be fleshed out a bit to make things clearer for those who don't already know how it works. Examples are always useful. Thanks for the two patches, together with those I can begin to understand the docs. Why not use them as part of help-xeq? I guess these are really questions for Krzysztof.
yes that's true - it's not so easy to come into all the xeq stuff (e.g. if you only want to build a midi file player ;)
anyway, if you are patching now something with it and try to understand the docs, can you upload your example patches (if you have some) somewhere or commit it into the cvs as part of xeq maybe ? would be a big help ...
LG Georg