[Csnd] Is it possible to control a variable with a MIDI controller?
Date | 2012-11-14 06:16 |
From | Cacophony7 |
Subject | [Csnd] Is it possible to control a variable with a MIDI controller? |
...In real time? and another question. Say if I had an audio interface, could I use Csound as an FX processor for my guitar in real time? -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-14 06:34 |
From | Jim Aikin |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI controller? |
> Is it possible to control a variable with a MIDI controller? > ...In real time? Short answer: yes. Slightly longer answer: Read the section "Real-time MIDI Support" in the manual. > and another question. > Say if I had an audio interface, could I use Csound as an FX processor for > my guitar in real time? Basically, yes -- but the results will depend on the latency of your system. If you have a fast computer and you're using ASIO on the PC, CoreAudio on the Mac, or [mumble] on Linux, you should be able to get the latency down to less than 20 milliseconds, which you may find acceptable. However, you may need to tweak the effects code to make it efficient in order to use a smaller buffer size without hearing the sound break up. If you need more specifics, please ask again. --JA -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717899.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-14 07:11 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI controller? |
What instrument(s) do you play Jim? -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717900.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-14 08:25 |
From | Rory Walsh |
Subject | Re: [Csnd] Is it possible to control a variable with a MIDI controller? |
ctrl7 is your friend, just don't forget to the use the -M flag in your .csd options. On 14 November 2012 06:16, Cacophony7 |
Date | 2012-11-14 14:16 |
From | Adam Puckett |
Subject | Re: [Csnd] Is it possible to control a variable with a MIDI controller? |
Or if you have Vista/7 on the PC you can use WASAPI (not available on XP, sorry). On 11/14/12, Rory Walsh |
Date | 2012-11-14 14:30 |
From | Justin Smith |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI controller? |
On Tue, Nov 13, 2012 at 10:34 PM, Jim Aikin <midiguru23@sbcglobal.net> wrote: > Is it possible to control a variable with a MIDI controller? On Linux, it would be jackd. less than 20 milliseconds, which you may find acceptable. However, you may |
Date | 2012-11-14 15:25 |
From | Anders Genell |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI controller? |
Or plain alsa (on Linux), unless you need to route audio between different software or have several program accessing the sound card simultaneously... Regards, /Anders
|
Date | 2012-11-14 15:36 |
From | Justin Smith |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI controller? |
Things can be tricky with alsa. Being sure you are using a real rather than virtual device, using optimal buffer sizes for compatibility with your own code and your latency needs. Jack acts as a single point of articulation where you have one well documented place to make these choices, rather than having to learn the quirks of how each of your programs use alsa. I don't know whether csound can configure alsa to work as efficiently as jack can. I do know that the performance of many apps is improved by using jack as an intermediary, because the jack developers know the most efficient way to set up the alsa subsystem. I would be surprised if csound could configure alsa to perform better than jack does. Additionally, for many professional quality devices, the alsa driver is not the best available, and jack can use the alternate driver (at least at one point this was the case for firewire devices, for example). On Wed, Nov 14, 2012 at 7:25 AM, Anders Genell <anders.genell@gmail.com> wrote:
|
Date | 2012-11-14 17:19 |
From | Tarmo Johannes |
Subject | Re: [Csnd] Is it possible to control a variable with a MIDI controller? |
If you use CsoundQt and it is compiled with rt-midi support (you can see your MIDI interface in Configure->General->internal MIDI interface), for me would be the most easy way to create a CsoundQt widget (a slider for example), attach a midi controller (insert channel number and controller number to the widget's properties' dialog box) and off you go! ctrl7 is of course the straight way to do it csound. tarmo On Tuesday, November 13, 2012 10:16:32 PM Cacophony7 wrote: > ...In real time? > and another question. > Say if I had an audio interface, could I use Csound as an FX processor for > my guitar in real time? > > > > -- > View this message in context: > http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a- variable-wi > th-a-MIDI-controller-tp5717897.html Sent from the Csound - General mailing > list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe > csound" |
Date | 2012-11-14 18:08 |
From | Anders Genell |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI controller? |
I am sure you are right - I am by no means an expert, but I do believe csound can achieve equally low latency if combinations of -b -B and ksmps are done right. Even when using jack there is some tinkering to be done to various buffer sizes to achieve lowest possible latency. As for firewire devices I have never tried alsa, but there is the ffado project which indeed is supported by jack, and in that respect I completely agree with the use of jack as a "single point", also for those who prefer the still living version of oss. I have beaten my head against the wall a number of time trying to learn how to use alsa as well as jack and I still not sure I do things right. I would absolutely love for some wiz to write the ultimate in-depth how-to on Linux audio that does not expect the reader to be a professional programmer that has read through the entire alsa source code. The Audio Programming Book gave me excellent general understanding that helped me interpret som of the alsa wiki stuff, but far from everything is clear. Regards,
|
Date | 2012-11-14 18:22 |
From | Victor |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
I have used Csound with alsa and -b32. I would say that is achievable with jack too, in realtime mode with the right permissions. There is probably a lot of advice on how to set jack correctly and then it is just a matter of setting -b as low as you get away with. Make sure the jack buffersize is small too. Victor
|
Date | 2012-11-14 22:21 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Thanks y'all. The keys and the mod wheel work with my code. I have 24 knobs and 9 sliders! can I access them with ctrl7's MIDI control number? How do I know what number belongs to what knob, slider ect.? -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717934.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-14 22:25 |
From | Victor |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Check the keyboard manual. On 14 Nov 2012, at 22:21, Cacophony7 |
Date | 2012-11-14 22:28 |
From | joachim heintz |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
or use either the MIDI IO Test in CsoundQt, or even the manual example for the midiin opcode. joachim Am 14.11.2012 23:25, schrieb Victor: > Check the keyboard manual. > > > > On 14 Nov 2012, at 22:21, Cacophony7 |
Date | 2012-11-14 22:42 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Ok, I'm using CsoundQt. How do I use that MIDI IO test? where is it? -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717938.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-15 00:38 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Or just use this UDO http://www.csounds.com/udo/displayOpcode.php?opcode_id=81 It will tell you the controlller number and channel of each of the midi sliders. I find it most useful. On 14 November 2012 22:42, Cacophony7 |
Date | 2012-11-15 01:22 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
the UDO works! great! thanks! -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717950.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-15 08:43 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Um I'm running my instrument for 1000 seconds in my csd file... i 1 0 1000 ...instead of running the instrument properly. where's the better alternative? I'm also getting some throbbing wind noise when I don't want to hear anything when all keys are currently untouched. -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717963.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-15 08:47 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
> i 1 0 1000 > > > ...instead of running the instrument properly. Not sure I understand what you mean? That seems a perfectly normal way to run an instrument? > where's the better alternative? > I'm also getting some throbbing wind noise when I don't want to hear > anything when all keys are currently untouched. It's impossible to tell what the issue might be without seeing some code. You can try simplifying your code and pasting it here. |
Date | 2012-11-15 08:55 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
instr 1 kdum midiMonitor ifreq cpsmidi ifreq = ifreq kmod1 ctrl7 1, 10, 0, 1 kmod2 ctrl7 1, 2, 0, 1 kmod3 ctrl7 1, 12, 0, 1 kmod4 ctrl7 1, 13, 0, 1 kmod5 ctrl7 1, 42, 0, 1 kmod6 ctrl7 1, 34, 0, 1 - kmod5 kmod7 ctrl7 1, 44, 0, 1 kmod8 ctrl7 1, 45, 0, 1 - kmod7 ;kFMmo should be more than zero. kFMmo oscil kmod5, ifreq*kmod1, 1 ;kFMmo is from -1 to 1 kFMmo = kFMmo + 1 ;kFMmo is from 0 to 2 (it touches zero only if kmod5 is 1) ;ifreq*kFMmo+kFMmp sould never be zero or negative so kFMmpA should be less than 1 - kmod5 ;1 - kmod5 >= kFMmpA kFMmpA = kmod6 kFMmp oscil ifreq*kFMmpA, ifreq*kmod2, 1 ;kFMdo should be more than zero. kFMdo oscil kmod7, ifreq*kmod3, 1 ;kFMdo is from -1 to 1 kFMdo = kFMdo + 1 ;kFMdo is from 0 to 2 (it touches zero only if kmod7 is 1) ;kFMdo + kFMdp should never be zero or negative so kFMdpA should be less than 1 - kmod7 kFMdpA = kmod8 kFMdp oscil kFMdpA, ifreq*kmod4, 1 ;I don't want a zero frequency whenever a key is pressed at any time the instrument is active ;The frequency can be zero when the keyboard is idle aout oscil 1/16, (ifreq*kFMmo+kFMmp)/(kFMdo+kFMdp), 3 outs aout, aout endin |
Date | 2012-11-15 09:01 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Do you want the instrument to start each time you press a key? if so you can use f0 3600 in your score and take out the i-statement. If you want to pass midi-key/amplitude information to your instrument through p-fields(I'd recommend it) you should use the midi interop-flags. See trivial example below: |
Date | 2012-11-15 11:20 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
that's strange! I don't see any p fields in the score -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717975.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-15 11:22 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
...let me guess. It's the flags in the options department. -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717976.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-15 11:27 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Sure is. The nice thing about this approach is that you can share instruments quite easily because you are not using an MIDI opcodes in your instruments. It doesn't provide a mechanism for retrieving MIDI CC messages which is the only draw back. It would be nice to do something like -+midi-cc-1:1=6 which would then pipe CC messages from midi controller 1 on channel 1 to p-field 6. Perhaps Mike could be gently persuaded to add this... |
Date | 2012-11-15 11:39 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Now my instrument responds to how hard I hit my key. so cool! thanks! -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717978.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-15 11:48 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Thank Mike Goggins for that! On 15 November 2012 11:39, Cacophony7 |
Date | 2012-11-15 23:17 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Now I'm trying to get the same project to work with the vowgen UDO but it wont play on the keyboard with f0 3600 or even i 1 0 1000. -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5718021.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-15 23:24 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
It's most likely playing but your instrument is just not outputting any sounds? On 15 November 2012 23:17, Cacophony7 |
Date | 2012-11-15 23:34 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
I think your right but here's the changed code on the bottom: aout vowgen ((p4*kFMmo+kFMmp)/(kFMdo+kFMdp)), 30, 0, 3 aout = aout * (p5/8) outs aout, aout endin |
Date | 2012-11-15 23:45 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
When you use f0 3600 and play some notes do you get some text messages from Csound? On 15 November 2012 23:34, Cacophony7 |
Date | 2012-11-16 00:21 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Yes. -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5718026.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-16 00:25 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Then the problem is clearly that your instrument is simply not outputted an audible signal. It's impossible to tell why without looking at the full code, including the CsOptions... On 16 November 2012 00:21, Cacophony7 |
Date | 2012-11-16 00:42 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
I don't understand why it won't work. This is ALL of the code: |
Date | 2012-11-16 01:11 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
I'm not quite sure either. It is odd that it runs with an i-statement but not when using the midi interop flags. I'm afraid I have to call it a night. I can take a closer look tomorrow. I'm quite tired so I wouldn't be surprised if the answer is staring us right in the face! |
Date | 2012-11-16 21:29 |
From | joachim heintz |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
it is in Examples > Useful. Am 14.11.2012 23:42, schrieb Cacophony7: > Ok, I'm using CsoundQt. How do I use that MIDI IO test? where is it? > > > > -- > View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5717938.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > > |
Date | 2012-11-17 00:20 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Aha! perhaps I'm supposed to use a k-rate variable instead of an i-rate for kfund of the vowgen opcode. I need a conversion, right?. -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5718057.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-17 02:50 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
It's still not working. All I wanna do is control the vowgen UDO with my keyboard. -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5718063.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-17 02:56 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Attachments | vowgen.csd |
I'm at a loss here. Just tried to trigger this from MIDI again but with no luck. I don't know if it's something with the tables, or what. If you want to use the UDO with the keyboard you can always just have the instrument always on and use another MIDI controlled instrument to control its amplitude and pitch. See the attached file. You'll need to swap out my CsOptions for your own. And also change the ctrl7 parameters to match your own keyboard. On 17 November 2012 00:20, Cacophony7 |
Date | 2012-11-17 02:57 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
See my previous mail, hopefully it will give you something to play with! On 17 November 2012 02:56, Rory Walsh |
Date | 2012-11-17 03:12 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
Thanks. The code plays the notes on the keyboard. I'll read your code for an hour or so. -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5718067.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-17 04:29 |
From | Cacophony7 |
Subject | [Csnd] Re: Is it possible to control a variable with a MIDI |
...Why is it not necessary to compile 0dbfs = 1? you commented it out ;0dbfs = 1 -- View this message in context: http://csound.1045644.n5.nabble.com/Is-it-possible-to-control-a-variable-with-a-MIDI-controller-tp5717897p5718069.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2012-11-17 13:24 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
It doesn't make any difference in this case. On 17 November 2012 04:29, Cacophony7 |
Date | 2012-11-17 15:49 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
This would be a huge improvement to this wonderful system, Mike? Sent from my iPad. On Nov 15, 2012, at 3:27 AM, Rory Walsh |
Date | 2012-11-17 16:14 |
From | Rory Walsh |
Subject | Re: [Csnd] Re: Is it possible to control a variable with a MIDI |
Hi Richard, are you referring to piping CC message using interop flags? If so then yes, it would be a nice addition indeed but not without its limitations. CC messages during a note would not be passed through. No big deal. Would still be nice. |