Mozart/Titan music Line 1

I am trying to code the Titan music line 1

LIne 1

The notation is
B, A# B C#, B C# D#, C# D#, F# E, D# C# B, A# B C#, B C# D#, C# D#, F# E, D# C#

And coded in sonic pi as

use_bpm 120
#B, A# B C#, B C# D#, C# D#, F# E, D# C# B, A# B C#, B C# D#, C# D#, F# E, D# C#
use_synth:piano

play :b4
sleep 1

play :as4
sleep 0.5
play :b4
sleep 0.5
play :cs4
sleep 1

play :b4
sleep 0.5
play :cs4
sleep 0.5
play :ds4
sleep 1

play :cs4
sleep 0.5
play :ds4
sleep 1

play :fs4
sleep 0.5
play :e4
sleep 1

play :ds4
sleep 0.5
play :cs4
sleep 0.5
play :b4
sleep 1

play :as4
sleep 0.5
play :b4
sleep 0.5
play :cs4
sleep 1

play :b4
sleep 1
play :cs4
sleep 0.5
play :ds4
sleep 1

play :cs4
sleep 0.5
play :ds4
sleep 1

play :fs4
sleep 0.5
play :e4
sleep 1

play :ds4
sleep 0.5
play :cs4
sleep 1

But I am not getting the exact music.
Where should I change.

Hi,

Well if you put a # at the start of A# B C# etc. it should work. # comments the line.
Does it help ?

I have commented out these lines already. But the Quote option ‘’ in the forum is not taking it.
Now those lines are removed.

Hi @vinodv :slightly_smiling_face:
Comments definitely work inside code blocks - you just need to make sure that each code block starts and ends with a line with three backticks ``` on it, and that each # is properly enclosed by these.

Anyway, as far as your original question - this is a great exercise for practicing listening skills :grinning_face_with_smiling_eyes: notice that in the video you posted, the melody is composed of a single repeating phrase. Both times, the pitch of the melody mostly gets progressively higher as the phrase progresses.
However, when listening carefully to your code, you’ll notice several notes sound completely out of place compared to the video. This is because they are in the wrong octave.
Have a go at changing these, and the notes that follow them where needed, and as you compare each change with the video, you’ll notice it sounds more and more the same :grinning_face_with_smiling_eyes:

How can I do that. Is there a good tutorial for this. You mean to say some are not in middle c.

There is, and correct (in as far as the C is the beginning of the notes in the wrong octave).
See Tutorial chapter 2.1 in the help section of the app - or https://sonic-pi.net/tutorial#section-2-1, for a good introduction to synths, notes and melodies :slightly_smiling_face:
Let us know if you have any further questions after that :grinning_face_with_smiling_eyes:

Hi @vinodv

To set the pitch of a note you have to add a number after the english note name.
Note that sonic pi understands :c as :C4
the octave number changes at the c note.

play :b3 the b from the 3rd octave is higher than the c3
sleep 1
play :c3 # the c from the 3rd octave
sleep 4

play :b3 # the b from the 3rd octave is lower than the c4
sleep 1
play :c4
sleep 1

is it ok ?