[Csnd] ways to process midi or use vst plugin
Date | 2010-01-10 11:40 |
From | Michael Mossey |
Subject | [Csnd] ways to process midi or use vst plugin |
I have a dream for a system that integrates csound with a midi sequencer or general source of midi events like Finale, in the following way. Regular midi "note on" messages aren't adequate to convey how a note should be played by the csound instrument; it needs to know the duration and how that note is connected to the following note (legato, staccato) ahead of time. Maybe there is a way to write a vst plugin or something like that that preprocesses the midi so that additional messages can be sent to the csound instrument defining the actual note duration and type of connection; or maybe even things like the vibrato intensity, general dynamic contour of the note, etc. The final system would operate like this: if I'm in a sequencer, or in Finale, I just start up the playback of a midi track. After perhaps a latency, the preprocessor sends enough information to csound to start rendering notes. For those here who know more about these possibilities than I, does this sound feasible? Thanks, Mike Send bugs reports to this list. To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2010-01-10 13:04 |
From | Rory Walsh |
Subject | [Csnd] Re: ways to process midi or use vst plugin |
Note-ons can be sent to Csound without Csound needing to know the note duration. When the corresponding note-off message comes it will stop the note. Using one of the 'r' family envelopes will mean you don't get a sudden drop in audio but a user-definable fade out. Setting things like vibrato intensity is a little more tricky but I guess you could send some kind of midi program event from the sequencer that Csound will read as a vibrato rate. The limitations here seem to be on the midi end but I still don't understand where the problem is. Can you tell us what sequencer you are using and what OS you are on? If you're working on windows for example you can install midiox and send midi notes from your sequencer directly to a Csound instrument set up to listen for midi events. You can send as many midi events as you like from your sequencer score, it's down to Csound to interpret them. You can interpret aftertouch for example in any way you like within your Csound instrument. If you're not working on windows there are still similar things you can do in all the other operating systems. In my experience sequencing is a very time consuming process. So much so that I gave up on it years ago in favor of writing plain old Csound scores instead. Rory. 2010/1/10 Michael Mossey |
Date | 2010-01-10 15:00 |
From | Michael Gogins |
Subject | [Csnd] Re: ways to process midi or use vst plugin |
It is possible to do what you wish, with the exception of tieing one note to another, using MIDI and Csound in a sequencer today, and I have done it. The solution is CsoundVST together with MIDI opcodes used by sequencers to send MIDI controllers, pitch pend, and so on to VST instruments. Currently this only works on Windows but there is no reason it could not work on Linux and OS X with some tweaks to the code. "A Csound Tutorial" by me describes most of this, but does not go into MIDI controllers or pitch bend. However, that stuff is not difficult. Hope this helps, Mike On 1/10/10, Michael Mossey |
Date | 2010-01-10 20:37 |
From | Michael Mossey |
Subject | [Csnd] Re: Re: ways to process midi or use vst plugin |
Michael Gogins wrote: > It is possible to do what you wish, with the exception of tieing one > note to another, using MIDI and Csound in a sequencer today, and I > have done it. The solution is CsoundVST together with MIDI opcodes > used by sequencers to send MIDI controllers, pitch pend, and so on to > VST instruments. Currently this only works on Windows but there is no > reason it could not work on Linux and OS X with some tweaks to the > code. > > "A Csound Tutorial" by me describes most of this, but does not go into > MIDI controllers or pitch bend. However, that stuff is not difficult. > > Hope this helps, > Mike > I think this is part of it, but let me be more specific. I plan to have a csound instrument that "shapes" the note---for example applying vibrato with changing intensity over time, or varying the "brightness" of the note over time. Because of how it computes the shapes, it needs to know the duration ahead of time, as well as the parameters that control the shape. Note that I'm not talking about 'tieing' notes to each other, but a separated versus smooth connection, which affects how the csound instrument plays the last few ms of the note. Again this needs to be known ahead of time; it can't wait until receiving a midi off message. So if I am going to be driving this via a program that produces midi, such as a sequencer or Finale, I need to send extra information to csound, which I understand can be sent via the midi controllers (in particular controllers I don't need to actually function in their original meaning). There is an additional wrinkle; I can write an algorithm that determines the "shapes" involved in playing the notes by inspecting the composition, so they are determined automatically. I actually do not want to determine them manually. So that leads to the question of how to write a plug-in that can inspect the score. A hack would be to write a plugin that uses a delay in order to receive most note off messages before it needs to start a csound note. This would work as long as every note duration is less than the delay. Thanks, Mike Send bugs reports to this list. To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2010-01-10 20:50 |
From | Steven Yi |
Subject | [Csnd] Re: Re: Re: ways to process midi or use vst plugin |
Hi Michael, I don't know if you've tried my software blue, but I would say it may work for your situation since it works with Csound note data directly. It is also one of the reasons I developed blue in the first place in that one can program instruments to depend on duration of notes, which is something I do often. I would also say that with the Python NoteProcessor and some scripting, you can have it filter your lists of notes to change pfield settings depending on duration, location in note list, check if the note has space behind it, etc. Maybe modify note durations and things like that to have more legato versus stoccato. Plus the source of the notes don't have to be hand-typed note lists, they could come from one of the other soundObjects in blue such as the PianoRoll, PatternObject, etc. The trouble with working with MIDI and Csound in regards to composition like this where material is pre-formed before performance is there is a fundamental difference in representation of musical information, specifically the one you cited about duration vs. note-on and note-off. The latter is definitely modeled on a performance-based view of musical information while Csound has duration involved. blue is modeled more on the pre-formed composition view and based a lot on notation of ideas versus performance of ideas. I would think it would be very difficult to achieve what you are thinking of doing without what I'd call hacks to the representation of musical information for MIDI, such that the information no longer matches up with the intention of the compositional idea. That's fine if you're comfortable with it but for me presents a lot of cognitive dissonance that slows down the music-making process. I'd recommend giving blue a try to see if it can work out for your needs; if not, then maybe it will at least give you ideas on how to proceed further. Thanks! steven On Sun, Jan 10, 2010 at 3:37 PM, Michael Mossey |
Date | 2010-01-10 21:42 |
From | Michael Gogins |
Subject | [Csnd] Re: Re: Re: ways to process midi or use vst plugin |
Some sequencers send note duration data if known. MKG from cell phone On Jan 10, 2010 3:38 PM, "Michael Mossey" <mpm@alumni.caltech.edu> wrote: |
Date | 2010-01-10 22:33 |
From | Brian Wong |
Subject | [Csnd] RE: Re: Re: Re: ways to process midi or use vst plugin |
As an example Michael, here is a work in progress I am doing that uses related techniques. Instruments like the "guitar" and hi-hat have the note duration automatically calculated by the time difference to the next note. The guitar phrase is created from a fractal and uses locations in the note list and the fractal to alter the phrase so it "leads-in" to the the next bar. The piece is rough, experimental and unfinished, but it should demonstrate some of blue's capabilities to do what Steven is describing here. Note that I don't create a full score then analyze it, I just generate the data I need first (for example a list of note start times, or the list of fractal values), then create the score using that afterwards. http://www.csounds.com/node/1359 Of course you could do the same thing writing directly in Python or another scripting language; I use blue. As far as using MIDI goes, I don't know. BW > Date: Sun, 10 Jan 2010 15:50:54 -0500 > From: stevenyi@gmail.com > To: csound@lists.bath.ac.uk > Subject: [Csnd] Re: Re: Re: ways to process midi or use vst plugin > > Hi Michael, > > I don't know if you've tried my software blue, but I would say it may > work for your situation since it works with Csound note data directly. > It is also one of the reasons I developed blue in the first place in > that one can program instruments to depend on duration of notes, which > is something I do often. I would also say that with the Python > NoteProcessor and some scripting, you can have it filter your lists of > notes to change pfield settings depending on duration, location in > note list, check if the note has space behind it, etc. Maybe modify > note durations and things like that to have more legato versus > stoccato. Plus the source of the notes don't have to be hand-typed > note lists, they could come from one of the other soundObjects in blue > such as the PianoRoll, PatternObject, etc. > > The trouble with working with MIDI and Csound in regards to > composition like this where material is pre-formed before performance > is there is a fundamental difference in representation of musical > information, specifically the one you cited about duration vs. note-on > and note-off. The latter is definitely modeled on a performance-based > view of musical information while Csound has duration involved. > > blue is modeled more on the pre-formed composition view and based a > lot on notation of ideas versus performance of ideas. I would think > it would be very difficult to achieve what you are thinking of doing > without what I'd call hacks to the representation of musical > information for MIDI, such that the information no longer matches up > with the intention of the compositional idea. That's fine if you're > comfortable with it but for me presents a lot of cognitive dissonance > that slows down the music-making process. > > I'd recommend giving blue a try to see if it can work out for your > needs; if not, then maybe it will at least give you ideas on how to > proceed further. > > Thanks! > steven > > > On Sun, Jan 10, 2010 at 3:37 PM, Michael Mossey <mpm@alumni.caltech.edu> wrote: > > > > > > Michael Gogins wrote: > >> > >> It is possible to do what you wish, with the exception of tieing one > >> note to another, using MIDI and Csound in a sequencer today, and I > >> have done it. The solution is CsoundVST together with MIDI opcodes > >> used by sequencers to send MIDI controllers, pitch pend, and so on to > >> VST instruments. Currently this only works on Windows but there is no > >> reason it could not work on Linux and OS X with some tweaks to the > >> code. > >> > >> "A Csound Tutorial" by me describes most of this, but does not go into > >> MIDI controllers or pitch bend. However, that stuff is not difficult. > >> > >> Hope this helps, > >> Mike > >> > > > > I think this is part of it, but let me be more specific. > > > > I plan to have a csound instrument that "shapes" the note---for example > > applying vibrato with changing intensity over time, or varying the > > "brightness" of the note over time. Because of how it computes the shapes, > > it needs to know the duration ahead of time, as well as the parameters that > > control the shape. > > > > Note that I'm not talking about 'tieing' notes to each other, but a > > separated versus smooth connection, which affects how the csound instrument > > plays the last few ms of the note. Again this needs to be known ahead of > > time; it can't wait until receiving a midi off message. > > > > So if I am going to be driving this via a program that produces midi, such > > as a sequencer or Finale, I need to send extra information to csound, which > > I understand can be sent via the midi controllers (in particular controllers > > I don't need to actually function in their original meaning). > > > > There is an additional wrinkle; I can write an algorithm that determines the > > "shapes" involved in playing the notes by inspecting the composition, so > > they are determined automatically. I actually do not want to determine them > > manually. So that leads to the question of how to write a plug-in that can > > inspect the score. > > > > A hack would be to write a plugin that uses a delay in order to receive most > > note off messages before it needs to start a csound note. This would work as > > long as every note duration is less than the delay. > > > > Thanks, > > Mike > > > > > > Send bugs reports to this list. > > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe > > csound" > > > > > Send bugs reports to this list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2010-01-11 00:49 |
From | Michael Mossey |
Subject | [Csnd] Re: Re: Re: Re: ways to process midi or use vst plugin |
Steven Yi wrote: > Hi Michael, > > I don't know if you've tried my software blue, but I would say it may > work for your situation since it works with Csound note data directly. I appreciate your taking the time to explain blue to me. I am interested in it. However, the problem is that I want my csound instrument to be integrated with a midi sequencer or a notation program like Finale because I plan to create midi content via improvising on a midi keyboard and/or entering regular musical notation. I don't know if there is any way to do that with blue. Thanks, Mike Send bugs reports to this list. To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2010-01-11 00:57 | |
From | cameron bobro | |
Subject | [Csnd] Re: Re: Re: Re: Re: ways to process midi or use vst plugin | |
|
Date | 2010-01-11 02:32 |
From | Michael Mossey |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: ways to process midi or use vst plugin |
cameron bobro wrote: > Do you want Csound to be doing it's thing on the fly as you play (kind > of hard without a time machine)? Why not record in your sequencer than > either run the midi files directly in Csound, or with Csound being > driven by the sequencer, with a delay? > Hi Cameron, Well, no I don't expect Csound to function as a time machine. I will use a regular sampler to hear what I am improvising as I play it. However, I would then like to render the midi a few moments later. Midi files are a bit awkward as an interface. The advantage of playing the midi directly from the sequencer or notation program is that you can use all their facilities for selecting which midi sections to play, varying the tempo, soloing tracks, and anything else it can do. Capturing the midi realtime in a separate program, using a delay to capture note off, and then calling Csound via the API is my only idea so far. It's a bit of a hack, but it's the best idea I have. Thanks, Mike Send bugs reports to this list. To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2010-01-11 03:25 |
From | Steven Yi |
Subject | [Csnd] Re: Re: Re: Re: Re: ways to process midi or use vst plugin |
HI Michael, blue does not currently handle taking input from MIDI and mapping to SoundObjects but it is on my list of features for the next version of blue. I had worked on a notation object for blue a long time ago but never finished it. Perhaps after the next version it will be interesting to check blue once MIDI input is working. Cheers! steven On Sun, Jan 10, 2010 at 7:49 PM, Michael Mossey |
Date | 2010-01-11 04:47 |
From | Jim Aikin |
Subject | [Csnd] Re: Re: Re: ways to process midi or use vst plugin |
michael.gogins wrote: > > Some sequencers send note duration data if known. > This is the first time I've heard of that, and I've used a lot of MIDI sequencers -- what sequencer are you thinking of? You could do it in Max, of course. Looking back at the original poster's question, you could control a Csound instrument's vibrato rate or whatever k-rate parameter you like using MIDI Control Change messages from the sequencer. This wouldn't be too tricky, and it might get you where you want to go. OTOH, I think I agree with Rory (if I'm not putting words into his mouth, which I probably am) that this sounds like a case of trying to put a round peg in a square hole. The "notes" in a Csound score are not very analogous to MIDI notes. Each system has its own strengths and its own limitations, but they're very different! And a notation-based interface is yet further afield from Csound. If you want to generate synthesized sound from a program like Finale, using conventional VST synthesizers would be a lot easier, and it might be more musically congruent as well. Or at least, that's my best guess, without really knowing what you have in mind musically. --Jim Aikin |
Date | 2010-01-11 09:27 |
From | Andres Cabrera |
Subject | [Csnd] Re: Re: Re: Re: ways to process midi or use vst plugin |
Hi, On Mon, Jan 11, 2010 at 4:47 AM, Jim Aikin |
Date | 2010-01-11 09:33 |
From | Rory Walsh |
Subject | [Csnd] Re: Re: Re: Re: Re: ways to process midi or use vst plugin |
Mikes midi command line flags made a big improvement with regards to midi, I wonder if they could be extended so that users could pass control change data via the command line too? I haven't checked the code but it would seem to me to be relatively straightforward? That way users could pass control change as p-fields to their instruments. Mike will know better. Rory. 2010/1/11 Andres Cabrera |
Date | 2010-01-11 09:43 |
From | Andres Cabrera |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: ways to process midi or use vst plugin |
Hi, That would be nice, but the big limitation is that they would only be passed at initialization, not as real control changes... which makes them much less useful, and they won't work as people are used to.... They could however be passed say in a global k-rate variable, but I'm not sure it's such a good idea to allow the definition of a global variable from the command line. Sounds a bit messy to me. Cheers, Andrés On Mon, Jan 11, 2010 at 9:33 AM, Rory Walsh |
Date | 2010-01-11 09:45 |
From | Rory Walsh |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: ways to process midi or use vst plugin |
Good point, I wasn't thinking straight! They can be passed as is using the midi opcodes so I guess with a bit of work all control changes can be utilised within an instrument. Rory. 2010/1/11 Andres Cabrera |
Date | 2010-01-11 16:51 |
From | Jason a |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: ways to process midi or use vst plugin |
Mike, i think building a Max widget would be the simplest solution. you can build in a control rate for vibrato/attack parameters/ that is based off of velocity very easily, and don't forget about aftertouch and other midi info, like comparing note-off messages with incoming note-on messages thus handling your legato/staccato issue. if you're using a mac, then you can use Midi Pipe to easily send info (without the risk of feedback which you can get by using the iac and not properly handling the midi end in, say, Logic's Environment screen). I use Csound all of the time in my compositions as a sound source (using a max widget and midi pipe for midi info, and soundflower for audio related stuff, ie. processing) and processing. if you're not a Max user, i could probably whip something up that could at least get you back to creating as soon as possible if you need it... just email me... FWIW, blue is awesome. you may like that. and about all of the rest of the suggestions come from super-geniuses so they may be the ones to listen too. ciao, jadams email (just in case you decide to take me up on the offer): electronic.adams@gmail.com On Mon, Jan 11, 2010 at 4:45 AM, Rory Walsh <rorywalsh@ear.ie> wrote: Good point, I wasn't thinking straight! They can be passed as is using -- ciao, jAdams |
Date | 2010-01-11 17:04 |
From | Rory Walsh |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: ways to process midi or use vst plugin |
I guess you could also do this using Pd, which is open source. Rory. 2010/1/11 Jason a |
Date | 2010-01-11 18:34 |
From | Michael Mossey |
Subject | [Csnd] Re: ways to process midi or use vst plugin |
Hi Jason, So if I understand, MAX/MSP is a commercial program, right? Does it have programmable synthesis capabilities that resemble csound? Thanks, Mike Jason a wrote: > Mike, i think building a Max widget would be the simplest solution. you > can build in a control rate for vibrato/attack parameters/ that is based > off of velocity very easily, and don't forget about aftertouch and other > midi info, like comparing note-off messages with incoming note-on > messages thus handling your legato/staccato issue. if you're using a > mac, then you can use Midi Pipe to easily send info (without the risk of > feedback which you can get by using the iac and not properly handling > the midi end in, say, Logic's Environment screen). > > I use Csound all of the time in my compositions as a sound source (using > a max widget and midi pipe for midi info, and soundflower for audio > related stuff, ie. processing) and processing. if you're not a Max > user, i could probably whip something up that could at least get you > back to creating as soon as possible if you need it... just email me... > > FWIW, blue is awesome. you may like that. and about all of the rest of > the suggestions come from super-geniuses so they may be the ones to > listen too. > > ciao, > jadams > Send bugs reports to this list. To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2010-01-11 18:42 |
From | Michael Gogins |
Subject | [Csnd] Re: Re: ways to process midi or use vst plugin |
Yes and no. Csound has more capabilities. For example, Csound will automatically allocate voices as required to render polyphonic scores. You have to pre-allocate voices in Max/MSP. Csound has more opcodes, and better time/frequency tools. But, Max/MSP has a much better user interface and is more widely used. The synthesis and time/frequency capabilities are not bad, either -- just not as complete as Csound's. Pure Data is an open source, freely available package that is more or less a low-rent clone of Max/MSP. Hope this helps, Mike On 1/11/10, Michael Mossey |
Date | 2010-01-11 19:02 |
From | Rory Walsh |
Subject | [Csnd] Re: Re: ways to process midi or use vst plugin |
It certainly does although it's a graphical data flow language rather than a text based one. Pd is often referred to as the ugly sister of Max/MSP. It's true it doesn't look as good but it's free, has a huge community with a great mailing list and functions just as well as Max/MSP in my humble opinion. Both systems let you interact directly with an instance Csound. Rory. 2010/1/11 Michael Mossey |
Date | 2010-01-11 19:13 |
From | Brian Redfern |
Subject | [Csnd] Re: Re: Re: ways to process midi or use vst plugin |
You can also interact with csound using nyquist on linux with lisp. Also Chuck is pretty cool software and uses the stk library so any synthesis you do with stk opcodes in csound can also be done with Chuck. On Mon, Jan 11, 2010 at 11:02 AM, Rory Walsh |