Converting Midicents to midinote for use in vst~

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
tmrolls
Posts: 14
Joined: Sat Aug 09, 2014 3:43 pm

Converting Midicents to midinote for use in vst~

Post by tmrolls » Sun Aug 17, 2014 4:05 am

Daniele, or anyone on the list,
I am looking to use vst~, but I cannot seem to convert midicents in to midi note numbers. I tried running a bach./ object to divide the midicents by 100, but I got some odd numbers. I've spent an hour working on this trying to figure it out. When the number comes out of the first outlet of bach.unpacknote it is in midicents, after I but in a bach./ 100, i get a number that is closer to dividing by 2. I'm missing something here that is probably obvious, but I can't think what it could be. I know I'm not close to getting this to work, but if I can't get the vst~ to accept a note number, I'm not going to get to the next mistake. Can what I'm trying to do even be done? Thanks for any help. Sorry if this seems a little scattered, I've been up too late and working on this one thing too long.

Regards,
Tim
---------------------------------------
Timothy Michael Rolls, D.M.A.
Associate Professor of Music Theory/Composition/Music Technology
Fort Hays State University

tmrolls
Posts: 14
Joined: Sat Aug 09, 2014 3:43 pm

Re: Converting Midicents to midinote for use in vst~

Post by tmrolls » Sun Aug 17, 2014 4:19 am

Ok, I figured out that problem. I was trying to use a bach object and all I needed was simple max object. Now I just need to figure out how to get the vst~ object to respond to durations. Anyone done this before. I've never gotten vst~ to respond to note lengths send from anything. Sorry about the previous message. It's what I happen when I follow a bad line of thought.

Regards again,
Tim
---------------------------------------
Timothy Michael Rolls, D.M.A.
Associate Professor of Music Theory/Composition/Music Technology
Fort Hays State University

danieleghisi
Site Admin
Posts: 1349
Joined: Fri Dec 03, 2010 1:25 pm

Re: Converting Midicents to midinote for use in vst~

Post by danieleghisi » Sun Aug 17, 2014 7:52 pm

Hi tmrolls,

[bach./] and [/] are equivalent objects, with the difference that the former one also operates on lllls (= nested lists).
That being said, you have to use the @out t attribute if you need a bach object to output data as ordinary Max lists: have a look at the first tutorial (Hello world), especially to the last sections (native or text lllls). The point is that bach lists can have any length or depth whereas Max lists are extremely limited in size: the price to be paid is that lllls are by default in a "native" unreadable format, and you need to put the @out t attribute if you need to communicate with standard Max objects.

So [bach./ 100 @out t] should absolutely work (although [/ 100] is preferable in this simple case); if it doesn't work, don't hesitate to post a patch showing the problem.

I'm no expert in vst~s, however since this is a general Max question you might also find an answer by browsing or asking in the cycling '74 forum (www.cycling74.com).

Daniele

tmrolls
Posts: 14
Joined: Sat Aug 09, 2014 3:43 pm

Re: Converting Midicents to midinote for use in vst~

Post by tmrolls » Mon Aug 18, 2014 12:46 am

Daniele,
Thanks for the reply. I recall the @out from the tutorials, but forgot all about it when trying to figure this out. I'll probably post on the Cycling forum in a couple days if I can't work out how to create a "send 0 velocity after X milliseconds, where X is the the number of milliseconds of the note length." vst~ seems to not make timing issues easy to navigate.

Thanks again,
TIm
---------------------------------------
Timothy Michael Rolls, D.M.A.
Associate Professor of Music Theory/Composition/Music Technology
Fort Hays State University

andreaagostini
Posts: 209
Joined: Fri Dec 03, 2010 1:51 pm

Re: Converting Midicents to midinote for use in vst~

Post by andreaagostini » Thu Aug 21, 2014 6:58 am

Dear Tim,

just a couple of remarks:

- bach./ is not an exact equivalent of / for lllls, since when dividing two integers it returns a rational - e.g., [bach./ 100] receiving 6250 in its left inlet will return 125/2. If you always want an integer result when dividing two integers, you should use something like [bach.expr $x1 // 100]; or, you can make sure that you are dividing by a float with [bach./ 100.] - this will always return a float.

- vst~ does not have a notion of note durations, since it implements a strictly real-time paradigm. You have to explicitly send a note-off message when you want each note to be released. Max's makenote object is meant for the purpose, but if you need bach.roll or bach.score to drive vst~ you will probably want to use the outlet of [bach.ezmidiplay @noteout 0]: this will save you the hassle of dealing with the intricacies of bach.roll's (or bach.score's) playout format, and will also help you manage microtonality. Note that the outlet returns a standard Max message, so you don't have to worry about the @out attribute.

Hth
andrea

tmrolls
Posts: 14
Joined: Sat Aug 09, 2014 3:43 pm

Re: Converting Midicents to midinote for use in vst~

Post by tmrolls » Fri Aug 22, 2014 12:33 am

Andrea,
Thanks for the response. I got it working with the makenote object, using the duration output of the bach.noteunpack object into a dial (can't figure out why I have to go through a dial, but it seems to only recognize it this way) then in to the third input. It works well with monophonic lines, but I have some issues with noteoffs with harmony. But I consider this a triumph for me, as I am horrible at problemsolving in Max! I'll try using bach.ezmidiplay and see if it helps with that issue. Thanks again, I seem to always be trying to make things more difficult than they need to be.

Regards,
Tim
---------------------------------------
Timothy Michael Rolls, D.M.A.
Associate Professor of Music Theory/Composition/Music Technology
Fort Hays State University

Post Reply