Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Sparkle - Kimi no na wa #143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Sparkle - Kimi no na wa
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from midiutil import MIDIFile

# Create a MIDI file with one track
track = 0
time = 0 # Start at the beginning
channel = 0
volume = 100 # Max volume
tempo = 120 # Beats per minute

# Create a MIDIFile object with 1 track
midi = MIDIFile(1)
midi.addTempo(track, time, tempo)

# Define a sequence of notes and durations
melody = [
(60, 1), (62, 1), (64, 1), (65, 1),
(67, 1), (69, 1), (71, 1), (72, 2) # C, D, E, F, G, A, B, C (higher octave)
]

# Add the notes to the track
for note, duration in melody:
midi.addNote(track, channel, note, time, duration, volume)
time += duration # Move forward by the duration of the note

# Write the MIDI file to disk
with open("complex_melody.mid", "wb") as output_file:
midi.writeFile(output_file)

print("Complex MIDI file created successfully!")
2 changes: 2 additions & 0 deletions Uta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git clone https://github.com/your-username/my-midi-music.git
cd my-midi-music