[Csnd] MIDI input, audio output
Date | 2009-07-31 01:20 |
From | Jim Aikin |
Subject | [Csnd] MIDI input, audio output |
Per Iain's suggestion, I'm attempting to run csound from the DOS Command Prompt. I'm barely competent to do this, so I may be doing any number of things wrong, but I seem to be able to run CsoundVST.csd and send MIDI input to its real-time process. Among the results in the DOS box are the following lines, which print out when I play the MIDI keyboard while the .csd is running: SECTION 1: rtevent: T754.220 TT754.220 M: 0.0 0.0 new alloc for instr 5: midiKeyOct: pfield: 4 value: 8 midiVelocity: pfield: 5 value: 79 rtevent: T787.736 TT787.736 M: 14164.4 14164.4 rtevent: T806.719 TT806.719 M: 10456.8 10456.8 midiKeyOct: pfield: 4 value: 7 midiVelocity: pfield: 5 value: 79 rtevent: T836.654 TT836.654 M: 13442.7 13442.7 rtevent: T920.663 TT920.663 M: 12408.8 12408.8 midiKeyOct: pfield: 4 value: 8 midiVelocity: pfield: 5 value: 98 rtevent: T949.759 TT949.759 M: 128521.8 128521.8 number of samples out of range: 555140 555140 rtevent: T974.774 TT974.774 M: 91585.5 91585.5 number of samples out of range: 698 698 midiKeyOct: pfield: 4 value: 7 midiVelocity: pfield: 5 value: 96 rtevent: T999.497 TT999.497 M: 97347.7 97347.7 number of samples out of range: 357631 357631 rtevent: T1069.081 TT1069.081 M: 87394.1 87394.1 number of samples out of range: 367 367 midiKeyOct: pfield: 4 value: 8 midiVelocity: pfield: 5 value: 112 rtevent: T1090.065 TT1090.065 M: 545175.1 545175.1 number of samples out of range: 818058 818058 rtevent: T1164.072 TT1164.072 M: 528496.9 528496.9 number of samples out of range: 2584 2584 midiKeyOct: pfield: 4 value: 7 midiVelocity: pfield: 5 value: 121 rtevent: T1186.838 TT1186.838 M:1611879.11611879.1 number of samples out of range: 953327 953327 B 0.000 ..3600.000 T3600.000 TT3600.000 M:1137203.01137203.0 number of samples out of range: 3886 3886 Score finished in csoundPerform(). inactive allocs returned to freespace end of score. overall amps:1611879.11611879.1 This is good, because it shows note-ons and note-offs are being received by csound. However, I'm not hearing anything. (Probably just as well, given the amount of clipping shown above.) Conversely, Csound is definitely able to find the audio output bus when run from the GUI (although the output is complete crap today, though it was fine yesterday when I was using a different interface ... something to do with buffering, I'm sure -- God only knows what). In addition to not sending audio anywhere, CSoundVST.csd from the command line quits after a few seconds, even though there's an f0 3600 line in the score. (That's the entire score, in fact.) So I still have at least three problems that I'm aware of: 1) No audio output when csound is run from the command line, even though there's MIDI input. 2) A score that quits when it shouldn't. 3) An audio buffer size/rate problem in real-time rendering that didn't exist yesterday, before I switched from a USB interface to a FireWire interface. Just out of pure academic curiosity, why is it that none of the options in the drop-down under "Real time audio module" are devices that are in my system? Where is the GUI getting its confused misinformation from? What are pa_cb and pa_ci? What, for that matter, is PortAudio? When I run a different .csd from the command line, the audio output is just fine, not glitchy -- but this .csd doesn't seem to want to accept MIDI input from this line in an instr: kctrl2 ctrl7 1, 4, 0, 127 It compiles, but when I wiggle the slider that sends control change 4, I get no audible change and no print statement. I am, needless to say, unable to figure out why. But here's a clue. In order to try to get my uncooperative test file to to respond to MIDI, I next copied the CSOptions from CSoundVST.csd into it, replacing the options I had been using before. The line looks like this: csound -f -h -d -n -m7 --midi-key-oct=4 --midi-velocity=5 When I run my test file again, it quits after a few seconds rather than remaining active as it did before. It didn't quit before; it opened a slider panel and kept right on running (thanks to an f0 3600 score statement). Frolicking through the page that lists the command-line flags, I can't see that any of the above items would cause csound to ignore an f0 3600 and bail out after a few seconds ... but doubtless I'm misunderstanding something basic. As usual. Suggestions most humbly appreciated. --Jim Aikin -- View this message in context: http://www.nabble.com/MIDI-input%2C-audio-output-tp24749297p24749297.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2009-07-31 09:51 |
From | joachim heintz |
Subject | [Csnd] Re: MIDI input, audio output |
Just some ideas to the commandline: csound -f -h -d -n -m7 --midi-key-oct=4 --midi-velocity=5 -n means no sound to disk. This may be the reason of not hearing anything. Have you tried -odac instead? Try removing -h (makes no sense here I think). And also remove -f (to see whether your audio device has a problem with float output). Perhaps the amplitude output is correct if you use --midi-velocity- amp=5 instead of --midi-velocity=5. Hope that helps - joachim Am 31.07.2009 um 02:20 schrieb Jim Aikin: > > Per Iain's suggestion, I'm attempting to run csound from the DOS > Command > Prompt. I'm barely competent to do this, so I may be doing any > number of > things wrong, but I seem to be able to run CsoundVST.csd and send > MIDI input > to its real-time process. Among the results in the DOS box are the > following > lines, which print out when I play the MIDI keyboard while the .csd is > running: > > SECTION 1: > rtevent: T754.220 TT754.220 M: 0.0 0.0 > new alloc for instr 5: > midiKeyOct: pfield: 4 value: 8 > midiVelocity: pfield: 5 value: 79 > rtevent: T787.736 TT787.736 M: 14164.4 14164.4 > rtevent: T806.719 TT806.719 M: 10456.8 10456.8 > midiKeyOct: pfield: 4 value: 7 > midiVelocity: pfield: 5 value: 79 > rtevent: T836.654 TT836.654 M: 13442.7 13442.7 > rtevent: T920.663 TT920.663 M: 12408.8 12408.8 > midiKeyOct: pfield: 4 value: 8 > midiVelocity: pfield: 5 value: 98 > rtevent: T949.759 TT949.759 M: 128521.8 128521.8 > number of samples out of range: 555140 555140 > rtevent: T974.774 TT974.774 M: 91585.5 91585.5 > number of samples out of range: 698 698 > midiKeyOct: pfield: 4 value: 7 > midiVelocity: pfield: 5 value: 96 > rtevent: T999.497 TT999.497 M: 97347.7 97347.7 > number of samples out of range: 357631 357631 > rtevent: T1069.081 TT1069.081 M: 87394.1 87394.1 > number of samples out of range: 367 367 > midiKeyOct: pfield: 4 value: 8 > midiVelocity: pfield: 5 value: 112 > rtevent: T1090.065 TT1090.065 M: 545175.1 545175.1 > number of samples out of range: 818058 818058 > rtevent: T1164.072 TT1164.072 M: 528496.9 528496.9 > number of samples out of range: 2584 2584 > midiKeyOct: pfield: 4 value: 7 > midiVelocity: pfield: 5 value: 121 > rtevent: T1186.838 TT1186.838 M:1611879.11611879.1 > number of samples out of range: 953327 953327 > B 0.000 ..3600.000 T3600.000 TT3600.000 M:1137203.01137203.0 > number of samples out of range: 3886 3886 > Score finished in csoundPerform(). > inactive allocs returned to freespace > end of score. overall amps:1611879.11611879.1 > > This is good, because it shows note-ons and note-offs are being > received by > csound. However, I'm not hearing anything. (Probably just as well, > given the > amount of clipping shown above.) Conversely, Csound is definitely > able to > find the audio output bus when run from the GUI (although the output > is > complete crap today, though it was fine yesterday when I was using a > different interface ... something to do with buffering, I'm sure -- > God only > knows what). > > In addition to not sending audio anywhere, CSoundVST.csd from the > command > line quits after a few seconds, even though there's an f0 3600 line > in the > score. (That's the entire score, in fact.) So I still have at least > three > problems that I'm aware of: > > 1) No audio output when csound is run from the command line, even > though > there's MIDI input. > > 2) A score that quits when it shouldn't. > > 3) An audio buffer size/rate problem in real-time rendering that > didn't > exist yesterday, before I switched from a USB interface to a FireWire > interface. > > Just out of pure academic curiosity, why is it that none of the > options in > the drop-down under "Real time audio module" are devices that are in > my > system? Where is the GUI getting its confused misinformation from? > What are > pa_cb and pa_ci? What, for that matter, is PortAudio? > > When I run a different .csd from the command line, the audio output > is just > fine, not glitchy -- but this .csd doesn't seem to want to accept > MIDI input > from this line in an instr: > > kctrl2 ctrl7 1, 4, 0, 127 > > It compiles, but when I wiggle the slider that sends control change > 4, I get > no audible change and no print statement. I am, needless to say, > unable to > figure out why. But here's a clue. In order to try to get my > uncooperative > test file to to respond to MIDI, I next copied the CSOptions from > CSoundVST.csd into it, replacing the options I had been using > before. The > line looks like this: > > csound -f -h -d -n -m7 --midi-key-oct=4 --midi-velocity=5 > > When I run my test file again, it quits after a few seconds rather > than > remaining active as it did before. It didn't quit before; it opened > a slider > panel and kept right on running (thanks to an f0 3600 score > statement). > Frolicking through the page that lists the command-line flags, I > can't see > that any of the above items would cause csound to ignore an f0 3600 > and bail > out after a few seconds ... but doubtless I'm misunderstanding > something > basic. As usual. > > Suggestions most humbly appreciated. > > --Jim Aikin > > -- > View this message in context: http://www.nabble.com/MIDI-input%2C-audio-output-tp24749297p24749297.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > > Send bugs reports to this list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body > "unsubscribe csound" > |
Date | 2009-07-31 13:17 |
From | Michael Gogins |
Subject | [Csnd] Re: MIDI input, audio output |
CsoundVST.csd is designed to be used within CsoundVST running as a VST plugin, hence the host receives the audio and there is no direct audio output. CsoundAC.csd should do what you want. Hope this helps, Mike On 7/30/09, Jim Aikin |
Date | 2009-07-31 17:38 |
From | Jim Aikin |
Subject | [Csnd] Re: MIDI input, audio output |
Michael Gogins-2 wrote: > > CsoundVST.csd is designed to be used within CsoundVST running as a VST > plugin, hence the host receives the audio and there is no direct audio > output. > > CsoundAC.csd should do what you want. > Possibly. Difficult to be certain. When I attempt to run it (from the DOS prompt) I get no immediate error messages. The first note-on I send causes about 80,000 samples out of range in each channel, the DOS window now says, "begin closing open devices...", and the process is hung. If I get rid of -f (which is probably what's causing the samples out of range), there is no longer _any_ response to MIDI input. In either scenario, the DOS window has hung. Closing the DOS window seems just a trifle inefficient as a way to shut down a running Csound process, more especially if the process _were_ producing music. I did edit the file a bit by commenting out three #define lines, which were obviously inappropriate on my system, and by substituting -M1 and -odac1 in CSoptions. Quite possibly that breaks something instead of fixing it, but those do seem to be the correct numbers for my devices. As an aside, I can't help feeling that it would be a courtesy to folks who are just starting to learn Csound if someone could provide them, in the examples folder, with a simple MIDI synth and complete instructions on how to get it running. A file that includes PianoTeq gives one, if you'll forgive my saying so, rather the impression that one is seeing shovelware. I'm determined to get it running on my system, but I can readily envision the possibility that a lot of potential Csound users would simply give up at this point. --JA -- View this message in context: http://www.nabble.com/MIDI-input%2C-audio-output-tp24749297p24759373.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2009-07-31 17:45 |
From | Jim Aikin |
Subject | [Csnd] Re: MIDI input, audio output |
...and of course, neither CsoundAC.csd nor CsoundAC-MIDI.csd can be run from the GUI in Windows. They both crash the GUI. --JA -- View this message in context: http://www.nabble.com/MIDI-input%2C-audio-output-tp24749297p24759528.html Sent from the Csound - General mailing list archive at Nabble.com. |
Date | 2009-07-31 18:13 |
From | Michael Gogins |
Subject | [Csnd] Re: Re: MIDI input, audio output |
The files you mention run without a hitch from the command line on my systems (windows and Linux), once I set the macros to include or exclude the pianoteq, etc. I do not have the resources to test the files on the variety of systems that might be used by others. For one thing, I do not even have a Mac, although that seems to be the most used platform by Csound musicians. I agree that these issues are annoying to all and more than annoying to some beginners. Dealing with them properly would require re-engineering the input/output driver situation in Csound. it was designed to function on a very wide variety of computers, operating systems, and audio and MIDI devices. It was not designed to be easy to use. One thing that could be added, perhaps, would be a utility to identify all input and output devices on a system and print out the Csound options that would access them. If you come up with an orchestra that you feel works well for you, please send it to me. I'm quite willing to add it to the distribution, or to modify the existing files to reflect your experience. I don't, however, appreciate terms like "shovelware." You are tempting me to use terms that refer to people who either do not read documentation, or pretend not not to read documentation. Regards, Mike On 7/31/09, Jim Aikin |