[LAD] send midi message
Hi all, I try to write a c program that sends midi notes to the Hydrogen drum sequencer. I use the alsa library to create a client with an output port. I attached two files. loopqueue.c works but loop.c doesn't. A base drum (note:28) is being send. I am not succeeding to use direct delivery, but it only works with the queue. Any ideas why? Regards, Dave #include alsa/asoundlib.h #include unistd.h int main() { snd_seq_t* seq; int port; snd_seq_event_t ev; snd_seq_open(seq, default, SND_SEQ_OPEN_DUPLEX, 0); snd_seq_set_client_name(seq, monprog); port = snd_seq_create_simple_port(seq, port1,SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ,SND_SEQ_PORT_TYPE_APPLICATION); getchar(); // time to start a softsynth ;) snd_seq_ev_clear(ev); snd_seq_ev_set_source(ev, port); snd_seq_ev_set_subs(ev); snd_seq_ev_set_direct(ev); snd_seq_ev_set_note(ev, 0, 28, 127, 3); snd_seq_event_output_direct(seq, ev); snd_seq_drain_output(seq); snd_seq_free_event(ev); sleep(1) ; return 0; } #include alsa/asoundlib.h #include unistd.h int main() { snd_seq_t* seq; int port, queue; snd_seq_queue_tempo_t* tempo; snd_seq_event_t ev; snd_seq_open(seq, default, SND_SEQ_OPEN_DUPLEX, 0); snd_seq_set_client_name(seq, monprog); port = snd_seq_create_simple_port(seq, port1,SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ,SND_SEQ_PORT_TYPE_APPLICATION); queue = snd_seq_alloc_queue(seq); getchar(); // time to start a softsynth ;) snd_seq_start_queue(seq, queue, NULL); snd_seq_ev_clear(ev); snd_seq_ev_set_source(ev, port); snd_seq_ev_set_subs(ev); snd_seq_ev_set_direct(ev); snd_seq_ev_schedule_tick(ev, queue, 0, 0); snd_seq_ev_set_note(ev, 0, 28, 127, 3); snd_seq_event_output_direct(seq, ev); snd_seq_drain_output(seq); snd_seq_free_event(ev); sleep(1) ; return 0; } ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev
[LAD] LMMS Trippleoscillator, LV2/linuxVST-version possitiblity?
My question is, quite simply, since LMMS is FLOSS, would making Trippleoscilator + perhaps other instruments in LMMS into plugins (lv2/linuxVST) be a realistic possibility? Bear with me, I'm no developer but merely a musician, so I really don't know what I'm asking/talking about. But I have a firm belief that a plugin-version of these instruments, usable in for example Ardour3 when that arrives, would make a great addition to the Linux-musician community. Technically it should be doable, but one would need to go in the code of LMMS to check it out. Sometime the code is almost usable directly in plugins. I'm working on porting the internal modules from AlsaModularSynth into LV2 plugins at the moment. Once I'm finished with that, I could take a look into it. (http://sourceforge.net/projects/avwlv2/) (ps. Is there anything similar already existing perhaps? ds.) You should check AlsaModularSynth, coupled with Seq24... The instrument you described look like a synth with 3 oscillators (dh, that would explain the name!). AMS comes with great examples, and building a Synth with 3 VCO (Oscillators) should be pretty easy. Yoshimi comes to mind as well (although it is way more complicated). Oh, and if you have some courage, feel free to try my plugins with Ingen :D P.S: I forwarded your mail to the LAU list. Some users there might have other ideas for similar synths. Hope that helps, Aurélien ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev
Re: [LAD] send midi message
Hi, On Thursday 05 January 2012, Dave Stikkolorum wrote: Hi all, I try to write a c program that sends midi notes to the Hydrogen drum sequencer. I use the alsa library to create a client with an output port. I attached two files. loopqueue.c works but loop.c doesn't. A base drum (note:28) is being send. I am not succeeding to use direct delivery, but it only works with the queue. Any ideas why? In both programs you need to connect the output port to some input port (for instance, a soft synth). To do so, you can insert a call to snd_seq_connect_to() after creating your port: snd_seq_connect_to(seq, port, 20, 0); Where 20:0 are the client:port numbers of the receiving port. The problem in loop.c is that you are using the function snd_seq_ev_set_note() that includes a duration as the 5th parameter. This function will create two MIDI events in a queue, the first one will be the noteon event, and the second one will be a noteoff event, scheduled adding the specified duration to the start time of the former noteon event. That requires a queue for event scheduling. If you don't mind about noteoff events, because most percussion synths don't bother about them anyway, replace that function call by snd_seq_ev_set_noteon(). There is also a snd_seq_ev_set_noteoff() function as well. You may be interested in my C++/Qt4 wrapper around the ALSA sequencer API: http://drumstick.sourceforge.net/docs/index.html Here is how a simple program playing a note-on MIDI message using drumstick looks like: #include QApplication #include drumstick.h int main(int argc, char **argv) { QApplication app(argc, argv, false); // create a client object on the heap drumstick::MidiClient *client = new drumstick::MidiClient; client-open(); client-setClientName( MyClient ); // create the port drumstick::MidiPort *port = client-createPort(); port-setPortName( MyPort ); port-setCapability( SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ ); port-setPortType( SND_SEQ_PORT_TYPE_MIDI_GENERIC ); // subscribe the port to some other client:port port-subscribeTo( 20:0 ); // or name:port, like in KMidimon:0 // create an event object on the stack, to send a note on message drumstick::NoteOnEvent ev( 0, 66, 100 ); ev.setSource( port-getPortId() ); ev.setSubscribers(); // deliver to all the connected ports ev.setDirect();// not scheduled, deliver immediately client-output( ev ); // or outputDirect() if you prefer not buffered client-drainOutput(); // flush the buffer // close and clean client-close(); delete client; return 0; } One program that uses Drumstick to play metronome and drum patterns is KMetronome: http://kmetronome.sourceforge.net/kmetronome.shtml Regards, Pedro ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev
Re: [LAD] send midi message
On Thursday 05 January 2012, Dave Stikkolorum wrote: On 05-01-12 15:31, Pedro Lopez-Cabanillas wrote: The problem in loop.c is that you are using the function snd_seq_ev_set_note() that includes a duration as the 5th parameter. This function will create two MIDI events in a queue, the first one will be the noteon event, and the second one will be a noteoff event, scheduled adding the specified duration to the start time of the former noteon event. That requires a queue for event scheduling. So in fact with a message that contains a duration for a note is always a queue involved? Yes, but this macro snd_seq_ev_set_note() is the only one that includes a duration parameter. It is not really a MIDI message, but the sequencer event is converted into two MIDI messages (noteOn + noteOff). There aren't MIDI messages containing durations. OTOH any event using the macros snd_seq_ev_schedule_real() or snd_seq_ev_schedule_tick() requires a queue as well, because the message delivering time will be scheduled in the future. Events using the macros snd_seq_ev_set_queue_control(), snd_seq_ev_set_queue_start(), snd_seq_ev_set_queue_stop(), snd_seq_ev_set_queue_continue() or snd_seq_ev_set_queue_tempo() also require a queue, because all these macros have a queue parameter. Regards, Pedro ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev
[LAD] Automation with Ardour and DDX3216
HI Guys happy new year. Has anyone got the autofaders to work with Ardour and a DDX? I believe this is possible but can find no info as yet. Thanks for your time Cheers Bob ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev
[LAD] LAC Deadline Extension - now January 22, 2012
Dear All, The Linux Audio Conference submissions deadline has been extended! It is now January 22nd, 2012. So, if you were considering submitting a paper but couldn't make up your mind yet, here is your chance to become active! Never forget that this conference lives through the people participating in it. January 22nd is the new deadline for all submission types: papers, music, installations, workshop proposals. Notifications of acceptance will still be sent out on February 6th, 2012. Check out the link below more info: http://lac.linuxaudio.org/2012/participation Please spread this information to anyone who might be interested. Questions? Drop us a line at l...@linuxaudio.org We are looking forward to seeing you at Stanford in April! Thanks, The LAC 2012 organization team ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev
Re: [LAD] JACK Timemachine patch that allows OSC port to be specified at start up
On 01/03/2012 08:17 PM, Tristan Strange wrote: Hi all, I've been trying to get the attached patch to steve at plugin dot org dot uk unfortunately his email address has been unavailable for 5 days now. The attached patch allows the OSC port a timemachine instance is listening on to be specified at startup with a -o flag. Can anyone else commit this to the project's git repository whilst he's unavailable (providing it's up to scratch of course!) or forward this on to Steve for me please? This is the first patch I'll have submitted to a well used open source project so I'm super keen to see it in timemachines code base. in case steve doesn't catch this mail via the list, he can sometimes be found as swh on #lad @ irc.freenode.net, if you hang out there for a couple of days... ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev
Re: [LAD] LMMS Trippleoscillator, LV2/linuxVST-version possitiblity?
Yes. And 3xOsc is the next one I am implementing. ___ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev