Drum Machine with Python and Pygame – Full Project Course

preview_player
Показать описание
In this Python & Pygame project course you will learn how to create a drum kit machine / beat maker.

This course is for both beginners and experienced developers. It covers Python and Object Oriented Programming concepts including nested for loops, functions, using audio files for generating sound, and saving / reading data.

⭐️ Course Contents ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:00:31) Project Showcase
⌨️ (0:02:19) Setting Up the App
⌨️ (0:08:48) Drawing the Board
⌨️ (0:26:02) Turning Notes On and Off
⌨️ (0:40:04) Add A Moving Beat Tracker
⌨️ (0:48:52) Adding Sounds and Making them Play!
⌨️ (0:57:41) Add Play/Pause Functionality
⌨️ (1:05:06) Adjust Total Beats and Speed
⌨️ (1:19:57) Turn an Instrument On or Off
⌨️ (1:29:07) Epic Water Break Content
⌨️ (1:29:37) Drawing the Save and Load Buttons
⌨️ (1:32:57) Adding Clear/Reset Board Functionality
⌨️ (1:33:37) Drawing the Save and Load Menus
⌨️ (1:47:52) Saving Beat Information
⌨️ (2:06:10) Loading In Saved Beats
⌨️ (2:42:57) Clean Up and Final Troubleshooting!

🎉 Thanks to our Champion and Sponsor supporters:
👾 Raymond Odero
👾 Agustín Kussrow
👾 aldo ferretti
👾 Otis Morgan
👾 DeezMaster

--

Рекомендации по теме
Комментарии
Автор

Thanks for sharing!! Good luck making your own versions everybody!

lemastertech
Автор

34:42 - there was no clicks inside draw_grid - def draw_grid(). 
37:03 (when you added gold color) - hello, clicks! :) - def draw_grid(clicks)
really good editing and attention training :) or maybe you just forgot to tell about it when you add comments.
Anyway, it's a great work, Thank you so much for this video 🙏

xtech
Автор

if anyone got stuck on "Turning notes on and off" because clicks wasnt referenced, its because you need to write clicks inside def draw_grid(clicks): he did it outside the recorded screen so i figured someone might get stuck here

morgan
Автор

These types of projects are gold bro. Fun and educational

chesanducharika
Автор

This is one of the coolest projects I've ever seen.

rayankhan
Автор

Great tutorial!

A couple of things you can do to improve on this drum machine would be to have a volume and panning wheel, as well as being able to edit the velocities of each note of the drum hits.

qaisali
Автор

As a music boi this has been my favorite of these types of videos by far

Navybird
Автор

Just followed through with this tutorial with some minor changes, and as a beginner it's amazing how you're able to dissect errors so quickly. I'm pretty new to Python (have also been learning JavaScript) and I found this helpful in understanding a lot of the syntax and features.

tabswithjerry
Автор

Excellent tutorial!! Here are my fixes to two problems that I noticed. I hope they are useful

In order not get an error I had to make the following (the use of the with context manager is optional, I implemented it beacuse just because it is a better practice. The if is the important line):
saved_beats = []
with open('saved_beats.txt', 'r') as fh:
for line in fh:
if not len(line) < 10:
saved_beats.append(line)

Besides, the delete button was not functioning properly, since changes weren't being saved on the saved_beats.txt file. I fixed it in this way:
Firstly, I created this function so that code is not repeated in both delete and save operations
def refresh_saved_beats_file():
with open('saved_beats.txt', 'w') as f:
for i in range(len(saved_beats)):
f.write(str(saved_beats[i]))

Then, I modified the delete operation :
if
if 0 <= index < len(saved_beats):
saved_beats.pop(index)
refresh_saved_beats_file()

If you are curious, save operation ended up in this way:
if
saved_beats.append(f'\nname: {beat_name}, beats: {beats}, bpm: {bpm}, selected: {clicked}')
refresh_saved_beats_file()
save_menu = False
typing = False

There are many other things that can be improved, but that's up to you, these two respond to a failure in the functionality of the app

manuelducos
Автор

Nice work :-) Simple and clear interface!

Radu
Автор

Bro, that was awesome, just finished it. I had a weird snag where the file-writing function kept adding an "Enter" before the first line in the "saved_beats.txt"
I fixed it by adding just one line:
"for i in range(len(savedBeats)):
if i == 0:

else:
file.write("\n" + str(savedBeats[i]))"

flioink
Автор

I am a music producer who is curious about programming and was wondering what language to start with and now I’m sold on python ahahaha thank you so much for this

BenvelMusic
Автор

The only things missing are velocity adjustments, pan left and right knob, ability to load samples, and export as midi notes to import in a daw later on. Otherwise amazing

nickdesalvo
Автор

really appreciate u guys for this, I will buy soon after my exams

cotempire
Автор

wheeew one hell of a tutorial.. thanks for this

sparkscomputerprogramming
Автор

Amazing video. I love drums and programming projects. Your clear instructions and energy were the icing on the cake.

nightshadow
Автор

Damn that was fun to do :D Thank you for great course!

pauljj
Автор

240 bpm is not actual 240 bpm in DAWs like Ableton
Check bpm by placing bass drum on every 4th cell. It's actually 60 bpm

actual formula for pygame scene would be
beat_length = 800 / bpm
with this one you will take aprox. real bpm

oleksovd
Автор

but there's that problem, the little random gaps of time when Playing, it's not accurately constant.
please if you know something about it, tell me.

lonely_fficial
Автор

Cool Tutorial i liked it, thanks for sharing!

christobongende
visit shbcf.ru