Go Down

Topic: Play music with an buzzer by Matlab (Read 1 time) previous topic - next topic


Dec 30, 2016, 01:14 am Last Edit: Dec 30, 2016, 01:19 am by asys
would you like to help me  playing music in Matlab. there are lots of example to play on IDE but I couldn't find a code to play a ton by Matlab.


What are you having trouble with?  I assume you want to use MATLAB to generate/play music in real-time while the Arduino is connected to the computer?  

I assume you know how to use MATLAB?  (I'm not a MATLAB user.)  

If you can figure-out to how to send data from MATLAB to the serial port, you can use one or more of the Arduino serial read commands to read the information/commands into your Arduino sketch.

But WHY do this???    If you're running MATLAB on a computer, your computer has a soundcard with more sound capability than the Arduino...     And, with the computer you'd have the option of using MIDI (if MIDI is applicable to what you're doing.)  


@DVDdoung thanks for answering.
I'm not a professional Matlab user too.
the main problem is how can I regenerate this code to Matlab

int melody[] = {  C,  b,  g,  C,  b,   e,  R,  C,  c,  g, a, C };
int beats[]  = { 16, 16, 16,  8,  8,  16, 32, 16, 16, 16, 8, 8 };
so I'm looking for an example.

Go Up