electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Developers' Corner
Matlab/Simulink and Audio/Midi
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
phoenix



Joined: Dec 09, 2005
Posts: 33
Location: munich, germany
G2 patch files: 1

PostPosted: Mon Oct 30, 2006 10:11 am    Post subject:  Matlab/Simulink and Audio/Midi
Subject description: Realtime rapid prototyping using rtw or rtai
Reply with quote  Mark this post and the followings unread

Hello my friends,

Is anyone into analyzing or synthesizing MIDI/Audio signals using Matlab/Simulink realtime workshop (rtw)?

Or did anyone do it WITHOUT rtw? (As a simulation?)

How did you do it? Is it possible to access ASIO in realtime, has anyone built a Simulink block or written a matlab driver function which does this?

Greetings phoenix

_________________
www.myspace.com/birdflame

talk to me per skype: electrobias
(My real name is Tobias Wink
Back to top
View user's profile Send private message Send e-mail
jksuperstar



Joined: Aug 20, 2004
Posts: 2503
Location: Denver
Audio files: 1
G2 patch files: 18

PostPosted: Mon Oct 30, 2006 7:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

Are you an RTW user?!!!

I think the cost of the system is just generally prohibitive for your typical audio user Smile My last (cancelled) project was designing & developing an PCI/FPGA card for RTW, which I had working, and still have all the code & drivers I wrote Smile
Back to top
View user's profile Send private message Visit poster's website
phoenix



Joined: Dec 09, 2005
Posts: 33
Location: munich, germany
G2 patch files: 1

PostPosted: Tue Oct 31, 2006 8:53 am    Post subject: Reply with quote  Mark this post and the followings unread

I use rtai- it is opensource Very Happy
https://www.rtai.org/
but less widely distributed.

_________________
www.myspace.com/birdflame

talk to me per skype: electrobias
(My real name is Tobias Wink
Back to top
View user's profile Send private message Send e-mail
jksuperstar



Joined: Aug 20, 2004
Posts: 2503
Location: Denver
Audio files: 1
G2 patch files: 18

PostPosted: Tue Oct 31, 2006 12:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

I haven't used rtai before, it seems similar to Simulink, but I wonder how common the drivers are? I have no idea, but I've heard RTW is based on something other than windows, dos, or linux (I'm speaking of the target, not the host).

Anyway, on an RTW target, using a very fast system, I was able to get down to 33usec timing resolution, running little code. My aim was to run 40kHz servo loops, but obviously couldn't get there. Still, it was very useable. I wonder how close RTAI can get to that. I suppose it depends on how much of a kernel & linux system you are running.
Back to top
View user's profile Send private message Visit poster's website
jksuperstar



Joined: Aug 20, 2004
Posts: 2503
Location: Denver
Audio files: 1
G2 patch files: 18

PostPosted: Tue Oct 31, 2006 12:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Maybe this is a good idea for this other project:
http://electro-music.com/forum/viewtopic.php?highlight=electronix&t=12799

I haven't heard of any hard-real time linux audio systems out there.
Back to top
View user's profile Send private message Visit poster's website
phoenix



Joined: Dec 09, 2005
Posts: 33
Location: munich, germany
G2 patch files: 1

PostPosted: Wed Nov 01, 2006 10:03 am    Post subject: Reply with quote  Mark this post and the followings unread

Quote:

I have no idea, but I've heard RTW is based on something other than windows, dos, or linux (I'm speaking of the target, not the host).

RTW can have as target all sorts of systems: PCs, Embedded controllers etc.

RTAI is a Linux specific realtime-interface which has to be compiled as module into the kernel. RTAI considers Linux as a background task running when no real time activity occurs.
Simulink can compile code that uses RTAI as realtime communication interface (Simulink models can be compiled and run outside Matlab/Simulink in realtime using RTAI and RTW).

I think I could use linux' JACK as audio/midi interface, connected to my audio/midi card. If an interface from Jack to RTAI exists, I think I could code synthesis and analysis tools quickly using matlab/simulink. Has anyone done this?

_________________
www.myspace.com/birdflame

talk to me per skype: electrobias
(My real name is Tobias Wink
Back to top
View user's profile Send private message Send e-mail
phoenix



Joined: Dec 09, 2005
Posts: 33
Location: munich, germany
G2 patch files: 1

PostPosted: Wed Nov 01, 2006 10:14 am    Post subject: Reply with quote  Mark this post and the followings unread

jksuperstar wrote:
Maybe this is a good idea for this other project:
http://electro-music.com/forum/viewtopic.php?highlight=electronix&t=12799

I haven't heard of any hard-real time linux audio systems out there.


I think that is a very interesting idea. We should discuss this. RTAI is spreading in control engineering where the realtime affordances are very tight. And it is open source. If you want to turn your linux-PC into a no-nonsense realtime system, it might be the best choice.

_________________
www.myspace.com/birdflame

talk to me per skype: electrobias
(My real name is Tobias Wink
Back to top
View user's profile Send private message Send e-mail
jksuperstar



Joined: Aug 20, 2004
Posts: 2503
Location: Denver
Audio files: 1
G2 patch files: 18

PostPosted: Wed Nov 01, 2006 5:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

I was speaking of compiling RTW in "stand alone" mode, where you boot up a PC with the special RTW floppy/CD, then a seperate PC running the simulink/rtw host connects & controls it. The other methods of running under windows, linux, etc, don't come close to the performance of stand-alone mode (as would be expected).

I did a fair amount of research, and the preemption and low-latency patches (now almost entirely part of the kernel source from 2.6.18 on) offer basically the same performance as RTAI does. Rather than bury linux proper on a layer "beneath" RTAI, the PREEMPT_RT patches modify the kernel to allow all the necessary spinlocks and preemption to hit a very low latency, real-time target. This allows one to use the same Linux API, rather than a seperate API like RTAI has.

I am already running this kernel, and can get below 2ms latency on a system that couldn't get below 12ms on Windows or standard Linux kernels. I think this is very good, and on a newer system (or PPC) would have even better IRQ response.

So, really, this type of effort may be a serious waste of time. Sad
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use