File Exchange

## Theme from Super Mario Brothers Song

version 1.0.0.0 (2.95 KB) by
plays the Super Mario Brothers theme song.

Updated 08 Sep 2005

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Put these two files into the same directory and run mariosong.m. It will play the first part of the mario brothers theme song. You can edit note.m to add qualities to the sound.

### Cite As

James Humes (2021). Theme from Super Mario Brothers Song (https://www.mathworks.com/matlabcentral/fileexchange/8442-theme-from-super-mario-brothers-song), MATLAB Central File Exchange. Retrieved .

I got some error in the code based on the zeros line as follows:
Error using zeros
Size inputs must be integers.
Error in mariosong (line 82)
xt = zeros(1, sum(tdur)*fs+1);

I changed the lines on the code and it runs fine now, as follows:

%xt = zeros(1, sum(tdur)*fs+1);
%xb = zeros(1, sum(bdur)*fs+1);
%xd = zeros(1, sum(ddur)*fs+1);

xt = zeros(1, round(sum(tdur)*fs+1));
xb = zeros(1, round(sum(bdur)*fs+1));
xd = zeros(1, round(sum(ddur)*fs+1));

David Martinez

Lance Cañaveral

Error in Line 90
How can i fix this

Giuseppe Silano

I found and solved some errors in the code. Below the changed lines are reported.

xt = zeros(1, round(sum(tdur)*fs+1));
xb = zeros(1, round(sum(bdur)*fs+1));
xd = zeros(1, round(sum(ddur)*fs+1));

CHENHAO WANG

Anton

Giacomo Alessandroni

Giacomo Alessandroni

I have the same problem of @Tschey

Error in line 90
Attempted to access note(56,0.17); index must be a positive integer or logical.

And if I set n = 3, I abtain:
Attempted to access note(56,3); index out of bounds because size(note)=[1,22051].

Vaishali Parikh

José Goulart

Ayhan

Müthiş... superb !

tej enosh

Super Super Superbb.. Dude Very Nice

yashavantha k

awsm..

Youssef

Aneeta Niazi

i must say...AMAZING!!:D

Kenneth Tam

Dude Thats cool!

savisha mahalingam

Superbb...

Vageesh

Tschey

I cant run it.. always get same erorr..
??? Attempted to access note(56,0.17); index must be a
positive integer or logical.

Error in ==> mariosong at 90
tone=note(keyst(kk), tdur(kk));

Error in ==> run at 57
evalin('caller', [s ';']);

any idea?

Jenny Gao

Sound tickled ~~

David Smith

Soncs

It's awesome!!!

Sisi Ma

Robert

Christian

Funny¡¡¡¡

Oskar Vivero

Husam Aldahiyat

Unbelievable!

use some sptool. Filter out some of the frequencies, we had a blast.

cool matlab shoud be used fo0r this kind of fun

sefsefa wdawa

how do i open that file

-

Kyle Friesen

Jake Horky

True Matlab audio bliss!

RJ Duran

sweetness

Frank Lusher

Thats TOO cool. Do some more stuff like this!

Andrew Schierer

Ahahaha. So good it hurts.

Na Pabo Ng

HOW DID YOU DO THIS? AMAZING!

anun seetun

i love you

scott frushour

by far, cooler then anything I've ever done in Matlab.

jajajaja, very very funny! Excelent!

J Hereford

Very nice work.

Tom Rose

Very Excellent

shachar m

David Blue

Impressive. Good NES timbre emulation.

top kitty

Dude! this program helped me on my final exam!!

kunal kakodkar

LOL! awesome.

Juan Manuel

yeah man, that was cool !

vakeyeshta halilla

thats the cool thing in matlab ever, are you pro?

Jason Armerstrong

WOW! That was way better than I expected.

Maximilien Chaumon

Thanks guys ! Good old days...

Robert Young

Very cool!

##### MATLAB Release Compatibility
Created with R14
Compatible with any release
##### Platform Compatibility
Windows macOS Linux