Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
153 views
5 pages
Arduino Music Lavender Town PDF Free
Uploaded by
miojomaromba
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save pdfcoffee.com_arduino-music-lavender-town-pdf-free For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
153 views
5 pages
Arduino Music Lavender Town PDF Free
Uploaded by
miojomaromba
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save pdfcoffee.com_arduino-music-lavender-town-pdf-free For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save pdfcoffee.com_arduino-music-lavender-town-pdf-free For Later
You are on page 1
/ 5
Search
Fullscreen
void setup() {
// iterate over the notes of the melody:
for (int thisNote = 0; thisNote < 8; thisNote++) {
// to calculate the note duration, take one second
// divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
int noteDuration = 1000/noteDurations[thisNote];
tone(8, melody[thisNote],noteDuration);
// to distinguish the notes, set a minimum time between them.
// the note's duration + 30% seems to work well:
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(8);
}
}
void loop() {
// no need to repeat the melody.
}
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978
//this noteLibrary depicts the frequencies of each note.
z=0
b2=123
c3=131
cs31=39
d3=147
ds3=156
e3=165
f3=175
fs3=185
g3=196
gs3=208
a3=220
as3=233
b3=247
c4=262
cs4=277
d4=294
ds4311
e4=330
f4=349
fs4=370
g4=392
gs4=415
a4=440
as4=466
b4=494
c5=523
cs5=554
d5=587
ds5=622
e5=659
f5=698
fs5=740
g5=784
gs5=831
a5=880
as5=932
b5=988
c6=1047
cs6=1109
d6=1175
ds6=1245
e6=1319
f6=1397
fs6=1480
g6=1568
gs6=1661
a6=1760
as6=1865
b6=1976
c7=2093
cs7=2217
d7=2349
ds7=2489
e7=2637
f7=2794
fs7=2960
g7=3136
gs7=3322
a7=3520
as7=3729
b7=3951
c8=4186
cs8=4435
d8=4699
ds8=4978
//tone[inputPin, melody[], noteDuration[]]
//This is code which uses the lock of an arduino to play notes in a sequ
ence at particular durations
//as well as particular pitches.
//As the arduino can only play one tone at a time, this code is simply a
mockup for a more
//powerful arduino such as th arduino Mega.
//inputPin# denotes which pin# is being used as a digital output to the
circuit which leads to the speaker.
//melody plays a specific frequency
//melody has a list of notes which have been specifiied earlier
//to correspond to particular frequencies i.e. keys.
//noteDuration corresponds to a formula which is altered through tempo t
o specific particlaur length to
//each note played by tone.
//MaximumOneNote=8
//MaximumOneNote denotes the fractional length of the smallest note such
that
//MaximumOneNote's value times the smallest note is a whole note
int tempo=120
//this tempo is particular to lavender town, it is different for every s
ong.
//noteDuration[]=(1/tempo)*15*oneNote[]
//Through this equation, noteDuration plays the speed at which is desire
d without
//having to lookup how many fractions of a second each note is.
int melody[161:0]={c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, z, gs4, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
b4, gs4, b4, z, b4,
b4, gs4, b4, z, b4,
b4, gs4, b4, z, b4,
c5, gs4, z, b4, z, f4, z,
z, gs4, z, b4, z, f4, z,
z, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z,
c5, gs4, z, b4, z, f4, z}
//array of notes to be played
int oneNote[161:0]={2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 2, 1, 1, 1,
2, 2, 1, 1, 1,
2, 2, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1}
int noteDuration[161:0]=(1/tempo)*15*oneNote[161:0]
//corresponding array of durations each note is played, each denotes a m
ultiple of the smallest fraction
tone[inputPin1, melody[161:0], noteDuration[161:0]]
//this plays the tune through input 1; this tune can be played on the arduino gi
ven.
//the other tunes which add to a song found below
//not accurate in programming t the moment, numbers must be changed
int melody[57:0]={z, z, z, z,
gs4, gs4, e5, e5, gs4, f4, e5, b4, e5, c5, b4, e
5,
gs4, gs4, e5, e5, gs4, f4, e5, b4, e5, c5, b4, e
5,
gs4, gs4, e5, e5, gs4, f4, e5, b4, e5, c5, b4, e
5,
gs4, gs4, e5, e5, gs4, f4, e5, b4, e5, g4, f4, b
4,
c5, z, c5, z, z, z}
int oneNote[57:0]={8, 8, 8, 8
4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2,
4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2,
4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2,
4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2,
2, 6, 2, 6, 8, 8,}
int noteDuration[57:0]=(1/tempo)*15*oneNote[57:0]
tone[inputPin2, melody[57:0], noteDuration[57:0]]
//this is the limit of the arduino
melody[33:0]={z, z, z, z,
e5, d5, c5, cs5, cs5,
e5, z, d5, c5, z,
e5, z, d5, c5, cs5, cs5,
c5, z, c5, z, c5, z, z,
e5, d5, c5, e5, c5, b4, e5}
int oneNote[33:0]={8, 8, 8, 8,
8, 8, 8, 4, 4,
2, 6, 8, 8, 8,
2, 6, 8, 8, 4, 4,
2, 6, 2, 6, 2, 6, 8,
8, 8, 8, 2, 2, 2, 2}
itn noteDuration[33:0]=(1/tempo)*15*oneNote[33:0]
tone[inputPin3, melody[33:0], noteDuration[33:0]]
//If tune works, should play Lavender Town theme from Pokemon Red/Blue/Y
ellow
You might also like
Manual Bluelight Bl6-U
PDF
100% (3)
Manual Bluelight Bl6-U
238 pages
Arduino Due
PDF
No ratings yet
Arduino Due
3 pages
NANO MinipopsWithClock
PDF
No ratings yet
NANO MinipopsWithClock
41 pages
Práctica # 5 Reproductor de Música
PDF
No ratings yet
Práctica # 5 Reproductor de Música
14 pages
Arduino Song
PDF
No ratings yet
Arduino Song
3 pages
bachGPT - Prompt
PDF
No ratings yet
bachGPT - Prompt
6 pages
Codigos Arduino
PDF
No ratings yet
Codigos Arduino
19 pages
Arduino Functions Tone
PDF
No ratings yet
Arduino Functions Tone
11 pages
Musical Instruments from Around the World (Karen (Sgaw)-English): Language Lizard Bilingual Explore
From Everand
Musical Instruments from Around the World (Karen (Sgaw)-English): Language Lizard Bilingual Explore
Emily Kobren
No ratings yet
Pirates of The Caribbean Theme Song Mustfa
PDF
No ratings yet
Pirates of The Caribbean Theme Song Mustfa
7 pages
Exercises 3 B
PDF
No ratings yet
Exercises 3 B
8 pages
Something Maybe?
PDF
No ratings yet
Something Maybe?
5 pages
Project 3 Passive Buzzer
PDF
No ratings yet
Project 3 Passive Buzzer
9 pages
Gibran, La Cucaracha
PDF
No ratings yet
Gibran, La Cucaracha
5 pages
Tsubasa Wo Kudasai Arduino Code
PDF
No ratings yet
Tsubasa Wo Kudasai Arduino Code
10 pages
Arduino Functions Tone
PDF
No ratings yet
Arduino Functions Tone
11 pages
Star-Wars Ino
PDF
No ratings yet
Star-Wars Ino
3 pages
DEBER Ard
PDF
No ratings yet
DEBER Ard
8 pages
Ipoduino Code
PDF
No ratings yet
Ipoduino Code
6 pages
M7T1V6-Hardware Demo E Buzzer
PDF
No ratings yet
M7T1V6-Hardware Demo E Buzzer
4 pages
Experiment IV
PDF
No ratings yet
Experiment IV
7 pages
Arduino Music - Lavender Town
PDF
0% (3)
Arduino Music - Lavender Town
5 pages
Diome pt1 Tutorial en Texto
PDF
No ratings yet
Diome pt1 Tutorial en Texto
4 pages
Project 5 PIEZO BUZZER
PDF
No ratings yet
Project 5 PIEZO BUZZER
5 pages
M2
PDF
No ratings yet
M2
5 pages
Arduino Mario Bros Tunes
PDF
No ratings yet
Arduino Mario Bros Tunes
11 pages
Piezo
PDF
No ratings yet
Piezo
3 pages
Diome Tutorial Parte 2
PDF
No ratings yet
Diome Tutorial Parte 2
5 pages
Proj 2
PDF
No ratings yet
Proj 2
3 pages
Im Smartcool e 6877419 V1.5.0 10 14
PDF
No ratings yet
Im Smartcool e 6877419 V1.5.0 10 14
222 pages
Arduino Pitches
PDF
No ratings yet
Arduino Pitches
25 pages
Starry Sky
PDF
No ratings yet
Starry Sky
3 pages
Games 1
PDF
No ratings yet
Games 1
5 pages
Proyecto Final // Una Bella Melodía para Oboe, Violin, Contrabajo
PDF
No ratings yet
Proyecto Final // Una Bella Melodía para Oboe, Violin, Contrabajo
6 pages
Whack A Mole Game
PDF
No ratings yet
Whack A Mole Game
21 pages
Mozard (Ino)
PDF
No ratings yet
Mozard (Ino)
2 pages
Mozard (Ino)
PDF
No ratings yet
Mozard (Ino)
2 pages
Control de Sonido
PDF
No ratings yet
Control de Sonido
3 pages
Introduction On UEFI History
PDF
100% (1)
Introduction On UEFI History
4 pages
Manual Configuracao Honeywell Eclipse Ms 5145
PDF
No ratings yet
Manual Configuracao Honeywell Eclipse Ms 5145
117 pages
Arduino LED Music Visualizer
PDF
No ratings yet
Arduino LED Music Visualizer
4 pages
Modul Cu Buzzer
PDF
No ratings yet
Modul Cu Buzzer
2 pages
Creating The LACE (V5.1)
PDF
No ratings yet
Creating The LACE (V5.1)
29 pages
CPEN 100 Laboratory No. 3
PDF
No ratings yet
CPEN 100 Laboratory No. 3
7 pages
Arduino Knight Rider
PDF
No ratings yet
Arduino Knight Rider
8 pages
Brahmslullaby Ino
PDF
No ratings yet
Brahmslullaby Ino
3 pages
ELE 301, Fall 2010 Laboratory No. 2: 1 Background
PDF
No ratings yet
ELE 301, Fall 2010 Laboratory No. 2: 1 Background
6 pages
Play A Song With P5.js
PDF
No ratings yet
Play A Song With P5.js
2 pages
Nikunjkumar Dineshbhai Patel s271457
PDF
No ratings yet
Nikunjkumar Dineshbhai Patel s271457
7 pages
Arduino Mario Bros Tunes With Piezo Buzzer and PWM
PDF
No ratings yet
Arduino Mario Bros Tunes With Piezo Buzzer and PWM
6 pages
Clocksbuzzercode
PDF
No ratings yet
Clocksbuzzercode
6 pages
CitectSCADA 7.20 User Guide-1
PDF
No ratings yet
CitectSCADA 7.20 User Guide-1
100 pages
Código para Criação Das Notas Musicais e Melodia
PDF
No ratings yet
Código para Criação Das Notas Musicais e Melodia
4 pages
Const Int Buzzerpin 13
PDF
No ratings yet
Const Int Buzzerpin 13
7 pages
Bakery Management Synopsis
PDF
No ratings yet
Bakery Management Synopsis
13 pages
Matlab Exercise 5
PDF
No ratings yet
Matlab Exercise 5
6 pages
Arduino Ultrasonic Musical Instrument
PDF
No ratings yet
Arduino Ultrasonic Musical Instrument
9 pages
Jingle Ee
PDF
No ratings yet
Jingle Ee
2 pages
Buzzer Con Arduino
PDF
No ratings yet
Buzzer Con Arduino
8 pages
Happy Birthday Music Arduino Code
PDF
No ratings yet
Happy Birthday Music Arduino Code
1 page
Tetris Theme Arduino Code
PDF
No ratings yet
Tetris Theme Arduino Code
2 pages
Lab 1new
PDF
No ratings yet
Lab 1new
7 pages
31 R20 M1-Sept-2023
PDF
No ratings yet
31 R20 M1-Sept-2023
7 pages
(K ROSET) (Online - Function - Manual) (E)
PDF
No ratings yet
(K ROSET) (Online - Function - Manual) (E)
27 pages
Capital One Offers Terms and Conditions
PDF
No ratings yet
Capital One Offers Terms and Conditions
4 pages
Blanket Purchase Order
PDF
No ratings yet
Blanket Purchase Order
8 pages
Comenzi Cisco
PDF
No ratings yet
Comenzi Cisco
3 pages
TMCQ
PDF
No ratings yet
TMCQ
14 pages
The Lang Lang Piano Method Level 4
From Everand
The Lang Lang Piano Method Level 4
Lang Lang
No ratings yet
Chapter 5
PDF
No ratings yet
Chapter 5
41 pages
Hamburg Bonnet Knitting Pattern
From Everand
Hamburg Bonnet Knitting Pattern
Agnese Iskrova
No ratings yet
Stuttgart Bonnet Knitting Pattern
From Everand
Stuttgart Bonnet Knitting Pattern
Agnese Iskrova
No ratings yet
Berlin Pixie Bonnet Knitting Pattern
From Everand
Berlin Pixie Bonnet Knitting Pattern
Agnese Iskrova
No ratings yet
Munster Bonnet Knitting Pattern
From Everand
Munster Bonnet Knitting Pattern
Agnese Iskrova
No ratings yet
Technical Service Guide: General Electric Side-by-Side Knob Control/Metal Liner Refrigerator
PDF
No ratings yet
Technical Service Guide: General Electric Side-by-Side Knob Control/Metal Liner Refrigerator
70 pages
31-TMSS-01-R2 (Relay and Control Panels)
PDF
No ratings yet
31-TMSS-01-R2 (Relay and Control Panels)
35 pages
50watts Audio Amplifier Using TDA7265
PDF
No ratings yet
50watts Audio Amplifier Using TDA7265
26 pages
Unit 1 Introduction To Cloud Computing: Structure
PDF
No ratings yet
Unit 1 Introduction To Cloud Computing: Structure
17 pages
Robotic Manipulator: Kartik Tripathi
PDF
No ratings yet
Robotic Manipulator: Kartik Tripathi
26 pages
Flask WTF
PDF
No ratings yet
Flask WTF
29 pages
The Definitive PS2 Trimming Guide - BitBuilt - Giving Life To Old Consoles
PDF
No ratings yet
The Definitive PS2 Trimming Guide - BitBuilt - Giving Life To Old Consoles
13 pages
Electronic Devices and Circuits: Faculty: Mr. M Srinivas Reddy
PDF
No ratings yet
Electronic Devices and Circuits: Faculty: Mr. M Srinivas Reddy
32 pages
Khan Sir OP
PDF
No ratings yet
Khan Sir OP
1 page
Solved - Discuss The Difference Between Resource Loading and Resource Leveling, and Provide An Example..
PDF
No ratings yet
Solved - Discuss The Difference Between Resource Loading and Resource Leveling, and Provide An Example..
2 pages
AWS Concierge: Billing and Pricing
PDF
No ratings yet
AWS Concierge: Billing and Pricing
13 pages
Image Steganography: Protection of Digital Properties Against Eavesdropping
PDF
No ratings yet
Image Steganography: Protection of Digital Properties Against Eavesdropping
8 pages
Database Deign UG - G Assignment 1 Semester 1 2021
PDF
No ratings yet
Database Deign UG - G Assignment 1 Semester 1 2021
4 pages
Quotation # SO2023/3378851: Your Reference: Recurrence: Quotation Date: Expiration: Salesperson
PDF
No ratings yet
Quotation # SO2023/3378851: Your Reference: Recurrence: Quotation Date: Expiration: Salesperson
1 page
Khanum
PDF
No ratings yet
Khanum
3 pages
AMS Non-Disclosure Agreement v1
PDF
No ratings yet
AMS Non-Disclosure Agreement v1
1 page