Genetic Algorithm in Python generates Music (code included)

  Рет қаралды 83,849

Kie Codes

Kie Codes

Күн бұрын

Пікірлер: 259
@KieCodes
@KieCodes 4 жыл бұрын
Hello Coders! I hope you liked the video! *What else do you want to see me try to generate using a genetic algorithm?* 🙀 If you want to learn more about genetic algorithms and how to program with them yourself, check out my playlist: kzbin.info/aero/PLuZkwckxno0qjTQcrfaQ3INlCkM4bn5fk
@evelynreigh
@evelynreigh 3 жыл бұрын
How close are topology optimization and genetic algorithms? I would love to see a series using genetic algorithms in generative design.
@KieCodes
@KieCodes 3 жыл бұрын
The problem in all things subjective is the fitness function. How can you determine the fitness of a design? If the design has function, like designing a bridge, thats a whole different story, but if it is just aesthetics, its harder. That’s why I used the fallback in this video.
@gurjotsingh8763
@gurjotsingh8763 3 жыл бұрын
WOWWWWWW WHAT AN IDEA SIRRRRRRRRR
@WittyAi
@WittyAi 2 жыл бұрын
I love it 😍
@KieCodes
@KieCodes 2 жыл бұрын
Thank you. 🙏
@oglothenerd
@oglothenerd 22 күн бұрын
I found this while looking for reference material for my scripting language for making music, and I loved this video! Great work! It wasn't what I needed, but it was still so worth the watch!
@KieCodes
@KieCodes 17 күн бұрын
Awesome! Thank you!
@romakii7601
@romakii7601 3 жыл бұрын
I'm a pianist that just graduated from a conservatory and im learning how to program.. im currently getting a minor in CS but damn this is my goal!!!
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@picosdrivethru
@picosdrivethru 2 жыл бұрын
awesome goal! I'm a visual artist, similar goals
@joeyda3rd
@joeyda3rd 4 жыл бұрын
Interesting concept. You could put all the pieces of the algorithm together, create a web interface, and crowd-source the fitness functions. Maybe even create a genetic algorithm for an entire produced song? Talk about a complicated project, but that would be an interesting experiment if it went viral and you had loads of input from a variety of music tastes.
@KieCodes
@KieCodes 4 жыл бұрын
Hey Joey, thanks for commenting! Yes that is an interesting idea. I will keep this idea for a future video. I was thinking about that for this video as well, but my audience is too little to get some meaningful results in a practical amount of time.
@mikeg6988
@mikeg6988 3 жыл бұрын
@@KieCodes Consider presenting it as a 'Twitch makes music' sort of approach? Like how Twitch Plays Pokemon crowdsourced game inputs?
@TheCurlyCoder
@TheCurlyCoder 2 жыл бұрын
I am a fulltime programmer and "ask Google" is about 60 % of what I do. :D But I loved this video, it was an awesome example for creating genetic algorithms. Thumbs up!
@KieCodes
@KieCodes 2 жыл бұрын
Thank you. 🙏
@jewpcabra666
@jewpcabra666 4 жыл бұрын
Just found this channel while looking up genetic algorithms.. you are awesome! Keep up the sweet work - you helped me re-learn typing in python and get a better understanding/dig deeper into using partial functions which are really cool! You def got a subscription from me!
@KieCodes
@KieCodes 4 жыл бұрын
Thanks for subscribing. 🙏
@pemadechen9901
@pemadechen9901 5 ай бұрын
Crazyyyy you just ignited my desire to work more on Genetic Algorithm. Love Loveee
@olegsafronov9936
@olegsafronov9936 4 жыл бұрын
Incredible finished project. From A to Z. With aesthetic visual and audio touch. Insane amount of efforts and dedication to narrate complicated story with simple rhythmic words. I salute your commitment and skills Daniel! @Kie Codes
@KieCodes
@KieCodes 4 жыл бұрын
Thank you. 🙏
@michaelrawson9100
@michaelrawson9100 3 жыл бұрын
Man, I'm seriously impressed. Going from zero to that is a real achievement. When the video started I wondered if you were going to use the GA to splice existing music together in unexpected ways. Maybe a genetic algorithm DJ? Give it a bank of music and get it to mix them.
@KieCodes
@KieCodes 3 жыл бұрын
Thank you! It was a lot of work, but s great project. 🙏
@NikhilSandella
@NikhilSandella 4 жыл бұрын
Such quality content and truly a masterpiece in the end. You deserve more!!!
@KieCodes
@KieCodes 4 жыл бұрын
Thank you. 🙏
@KieCodes
@KieCodes 3 жыл бұрын
⭐ THIS VIDEO IS SUPPORTED BY KITE ⭐ lvi.re/kiecodes-kite​ (affiliate link) Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for over 12 months whenever I write Python code and I love it!
@Astrovic1
@Astrovic1 3 жыл бұрын
I love the idea of programming with python combined with songwriting! Great Video Greetings from Germany to Germany
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@CyberTeach
@CyberTeach 7 ай бұрын
I love this idea! ever since I saw the website that py can make music I thought what an incredible idea! So many avenues for innovative music development here.
@calumvaughan8690
@calumvaughan8690 2 жыл бұрын
I've been creating algorithmic music for years using Max/MSP and some other live coding software, and I've just started learning Python - this is exactly the content I was hoping to find! It's great to see the Pyphon applications for music, and you made it v. fun. Hope to see you doing more videos like this :)
@KieCodes
@KieCodes 2 жыл бұрын
Thank you. 🙏
@devinderkaur9811
@devinderkaur9811 4 жыл бұрын
wow...that's the new generation of music..never knew this side of GA. Really like the strategic approach you used to get this melodious global optimal solution.
@KieCodes
@KieCodes 4 жыл бұрын
Thanks Devinder! It was a really project to play around with!
@torieldreemurr5102
@torieldreemurr5102 Жыл бұрын
i hope u continue making such content, it is just so good bro, soo good..
@szymonstepniak
@szymonstepniak 4 жыл бұрын
Awesome video, Kie! I just watched all your genetic algorithm videos and I enjoyed every one of them. Well done, love your channel! 👍
@KieCodes
@KieCodes 4 жыл бұрын
Thank you so much for your kind words . Your channel is amazing as well. Well produced videos with good content! I just subbed!
@szymonstepniak
@szymonstepniak 4 жыл бұрын
@@KieCodes Woohoo, thanks! Btw, do you think that a generic algorithm could be used to e.g. generate text jokes? It's not only about the randomness, because words have to be used in the specific context to be funny, but I guess it might be similar to notes and scales in music. I wonder if a computer could have a good sense of humor :)
@KieCodes
@KieCodes 4 жыл бұрын
Ohh I think that's a hard one. Like I had to impose some limitations and intelligence what a melody needs by adding scales and rhythm, with jokes you need to do the same for grammar and, I guess, the structure of a joke. Additionally how would you rate if a joke is funny? You could, of course, do a fitness function which asks you if you find that funny, but could you really rate it on a scale between one and five? The problem with jokes, in my opinion is, that they are either funny, or the are not.And without a slope for the GA to climb to get better iteratively, it is just pure randomness. (I hope that makes sense)
@szymonstepniak
@szymonstepniak 4 жыл бұрын
@Kie Codes Yeah, that makes sense. Even with one-liners, a few words might sound funny next to each other but may lose their meaning when put next to a few other funny words, so it gets even less and less deterministic. Even if we put the grammar aside, it doesn't make the problem simpler. I can't wait next Monday to see your upcoming video, they are very educational! 👍
@KieCodes
@KieCodes 4 жыл бұрын
Thanks Szymon. I am not sure I will go back to weekly uploads. I rather upload once every other week or less but increase the production value a little. So there will no video next monday. Maybe the monday after that.
@ngocvo9058
@ngocvo9058 4 жыл бұрын
Your content is amazing!!! I'm sure your channel will get popular very soon. Subscribed!
@KieCodes
@KieCodes 4 жыл бұрын
Thanks for your kind words! 🙏🙏🙏
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
When can I expect to find this on Spotify?
@KieCodes
@KieCodes 4 жыл бұрын
The algorithm is still figuring out how to sign a contract with a record label. 😆 Let's hope for the best.
@eljangoolak
@eljangoolak 3 жыл бұрын
the way you implemented this is basically deep learning/gradient decent done manually. by giving weight's to the parts that you liked better and the algorithm going towards what sound better to you step by step. but pretty cool tunes
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@suga4all
@suga4all 6 ай бұрын
4:32 Some super posh jazz licks right there! 😂🔥
@sohiniroy8126
@sohiniroy8126 3 жыл бұрын
And i did what the other programmer does,Google!😂such a relatable and great content.Good one
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@WaynaPicchu05
@WaynaPicchu05 4 жыл бұрын
This was fun to watch. I found your three-part series on GAs after trying a GA project of my own and running into an issue that the algorithm kept converging on "fittest" members of the population that were doing something I know cannot be the best solution. Briefly, my first project was encoding strategy for the AKQ game (a toy game that isn't serious, but is used to test concepts). One thing that it self-evident is that no strategy should *ever* fold an A, the strongest card, but some of the supposedly fittest members were doing that. So there's something wrong either with my fitness function (which was basically having every member of the population play all the others a few hundred times and seeing how many times they won), or maybe my mutation rate. Or maybe because there are only 64 possible alleles the search space is too small?
@KieCodes
@KieCodes 4 жыл бұрын
Hey Stan, thanks for your kind words. Regarding your problem: It is hard to tell where the problem lies without knowing the code. But I will give it a try. Of course there could be a problem with your fitness function, like you already mentioned. Another problem could be the encoding of your genome. How do you encode the game strategy into the genome? Another problem with the fitness might be, that 100 plays is not enough data to really distinguish bad from good startegy, have you tried to increase the number of games per genome? The mutation rate can be problem, when you see your average fitness per generation not really converge towards a minimum/maximum. If that happens,m there is too much chaos in the system. A small search space is only a problem, if the the fitness valus between each possible solution is too narrow. This also known as the "no hill to climb problem". If you solutions are all equally "good" in terms of fitness it is hard to tell a better genome from a worse one. If the increase in number of games per genome to determine the fitniss is not enough, you have to add more gaem knowledge to the firness value. For instance you could punish the genomes that fold an A and therefor decrease their fitness. I hope that makes sense and helps. Have a great day!
@WaynaPicchu05
@WaynaPicchu05 4 жыл бұрын
@@KieCodes Thanks for your response. The current algorithm plays each allele in the population against all the other 2000 times (each matchup plays 1000 times as player 1 and 1000 times as player 2). The top two winners are the fittest. The current version only crosses over by swapping one bit. Earlier versions crossed over entire swaths at random points, but with only 6 bits in each allele I thought that might too easily destroy good alleges. Here's the github link: github.com/shthompson/AKQ_genetic_algorithm.git
@GentleMannOfHats
@GentleMannOfHats 3 жыл бұрын
I didn't think that was possible! that's so cool!
@KieCodes
@KieCodes 3 жыл бұрын
Haha. Thank you!
@gh0s1wav
@gh0s1wav 3 жыл бұрын
This is exactly how synplant works but with sounds. Great experimental synth. Great experiment for melodies and rythums.
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@debd.9220
@debd.9220 4 жыл бұрын
Awesome. 💞 Smiling all the way at the end 😍
@KieCodes
@KieCodes 4 жыл бұрын
Glad you had a great time. 🙏
@diegarno
@diegarno 3 жыл бұрын
Wow, really interesting video, I loved it! I tried to run the code in a jupyter notebook to play and try to make a song but I did not know how to make it work, anyways, thanks a lot for your video, you got a new subscriber! :)
@KieCodes
@KieCodes 3 жыл бұрын
You are more than welcome my friend. 🙏 Rock on! 🚀
@JohnCrawford1979
@JohnCrawford1979 2 жыл бұрын
An interesting concept. Music is very algorithmic based already. From the basic octave scale to twelve-tone, as well as chords and chord progression. Even tone pitch, length, and other variables have numeric values. As it is, many composers practically play mathematical games to consider all these things, similar to how you did it with Python. Others, it's more of a feeling around to how things fit and what direction the music goes. So this process was basically put into the program to come up with themes and variations that you decided work best. An interesting way to help generate the ideas.
@dhruvgupta2542
@dhruvgupta2542 3 жыл бұрын
Thank You so much, sir!!! Very informative video(Love from India🙌❤).
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@alisalloum629
@alisalloum629 2 жыл бұрын
wow bro, great video! thanks
@KieCodes
@KieCodes 2 жыл бұрын
Thank you. 🙏
@javadsafarli
@javadsafarli 3 жыл бұрын
Great job! I am using GA to optimise coverage of UAVs but this is something crazy.
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@leesweets4110
@leesweets4110 2 жыл бұрын
You should find a way to get the general public to rate these sound clips to evolve the music much more quickly.
@KieCodes
@KieCodes 2 жыл бұрын
Haha. That‘s true.
@batuhanbulut153
@batuhanbulut153 4 жыл бұрын
"You say yes or new, together we generate" :D cool
@KieCodes
@KieCodes 4 жыл бұрын
🤩
@Mauricio-q1j3b
@Mauricio-q1j3b Жыл бұрын
Excelent!! Thanks for sharing!
@KieCodes
@KieCodes Жыл бұрын
Thank you. You are welcome. 🙏
@thepylama
@thepylama 2 жыл бұрын
this is the coolest thing i have ever seen
@jincho6034
@jincho6034 4 жыл бұрын
"time for cofee" that was unexpected but made me laugh!
@KieCodes
@KieCodes 4 жыл бұрын
Haha. Great to hear that! 😅🙏
@ATDP1
@ATDP1 Жыл бұрын
Thats a good one bro
@evelynreigh
@evelynreigh 3 жыл бұрын
Glad I’m not the only one with a temperature controlled kettle
@KieCodes
@KieCodes 3 жыл бұрын
Me too. 😅
@evelynreigh
@evelynreigh 3 жыл бұрын
I get some strange looks when I ask people about their favorite brewing temp 😅 my favorite is 185° throughout the brew, but some really interesting things happen if you vary the temperature. The real fun comes when you combine temperature and pressure profiling, to pull a shot of espresso that tastes like caramel coated pears. Coffee geek, born and raised!
@arcmode
@arcmode 3 жыл бұрын
Idea: build a program that upload videos with the generated songs and then derives the fitness from the likes, every day the most liked songs reproduce.
@KieCodes
@KieCodes 3 жыл бұрын
Love it!
@numericalcode
@numericalcode 2 жыл бұрын
That’s a cool song!
@masterrohit6905
@masterrohit6905 3 жыл бұрын
Beautiful ❤️ Thank You !!
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. ❤️
@momodoubjallow2585
@momodoubjallow2585 4 жыл бұрын
Perhaps you may try a playlist where you explain a series of step to formulate a problem for genetic algorithms try different types of problems such as influences maximization problems in social networks, graph neural networks etc. thank for your time spend to share your knowledge.
@KieCodes
@KieCodes 4 жыл бұрын
I will come back to genetic algorithms very soon. And with that hopefully show some more creative solutions how to use them for different problems. I have such a long video backlog by now already. 😅
@earthlover1871
@earthlover1871 3 жыл бұрын
Nice one dude
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@tezlashock
@tezlashock 3 жыл бұрын
you could totally encode the 256 bits of data into fewer by assigning the bar to one full rotation of a circle. At every pi/8 rotations reference a separate function which represent the note pitch and another separate function which represents "pause" or "play". In effect, encode volume and pitch separately and all notes should still hit on a beat!
@Chick0714
@Chick0714 2 жыл бұрын
Wonderful song forever and ever 🤩🤩🤩
@KieCodes
@KieCodes 2 жыл бұрын
Thank you. 🙏
@СтудентУниверситета-я6п
@СтудентУниверситета-я6п 3 жыл бұрын
It's very very very cool, thank you so much for such a brilliant content!!!
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@周暘恩
@周暘恩 3 жыл бұрын
This is so cool Love It !!!
@KieCodes
@KieCodes 3 жыл бұрын
Thank you!
@walkdead94
@walkdead94 3 жыл бұрын
Amazing!! That was a Great job!!
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@priyakalashi7420
@priyakalashi7420 3 жыл бұрын
Very Insightful
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@sophialawal7306
@sophialawal7306 3 жыл бұрын
This is brilliant!!!
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@joseraymondnn
@joseraymondnn 3 жыл бұрын
Thanks for your content! The genetic algorithm is super amazing, could you show us how to implement it on a basic video game developed with pygame, that'll be really cool. Thank you again for your videos and your excellent explanation.
@KieCodes
@KieCodes 3 жыл бұрын
Do you mean to use a GA to train an AI that plays the game? I actually have started a project like this couple of months ago, but didn't come around to finish it, yet.
@ronaldlundbohm815
@ronaldlundbohm815 3 жыл бұрын
The time was worth it NICE!!!!!
@gustavosalmeron2013
@gustavosalmeron2013 3 жыл бұрын
It was all chiptune jazz before you added these godamn scales
@KieCodes
@KieCodes 3 жыл бұрын
I am sorry mate. 😅 feel free to fork the project and to bring the soul of jazz back into it.
@gustavosalmeron2013
@gustavosalmeron2013 3 жыл бұрын
@@KieCodes I would love to! =]] I have a thought about these music making alghorithms: most of them aren't trained to learn music as a language(for example, how to communicate sadness, happiness and so on), they're more linear(sounds good or not). that would make an interesting topic, teaching the computer the melodic phrases according to what he wants to express
@watson8087
@watson8087 3 жыл бұрын
Together we generate. lol. Great video Kie. Thanks.
@KieCodes
@KieCodes 3 жыл бұрын
Thanks mate. 🙏
@Perqd
@Perqd 3 жыл бұрын
would be very interersting to combine NN and genetic algorithms for such a case. Like learning from existing music. Dope video!
@kakamoora7874
@kakamoora7874 11 ай бұрын
Thank you ❤
@KieCodes
@KieCodes 11 ай бұрын
You are very welcome 🙏
@ThankYouESM
@ThankYouESM 4 жыл бұрын
I have now subscribed, thank you
@KieCodes
@KieCodes 4 жыл бұрын
Thank you for being here! 🙏
@rushikeshshinde5807
@rushikeshshinde5807 4 жыл бұрын
Nice fusion 👌🏼👌🏼👌🏼
@KieCodes
@KieCodes 4 жыл бұрын
Thank you 🙏
@XTJ7
@XTJ7 4 жыл бұрын
Awesome video :) Maybe for arranging the song you could look at all the songs in "Axis of Awesome - Four Chord Song", as they rely on songs using the same chords, yet still creating a huge variety of popular songs. If you use MIDI files of these songs, limit the algorithm to the keyboard/rhythm guitar (you could check which instrument primarily contains the four chords and have it auto-select that one :D) and use that data to train the algorithm, you could teach it how to arrange songs. Not sure how successful that would be, but it might be a decent starting point.
@joeyda3rd
@joeyda3rd 4 жыл бұрын
I like this idea because it limits the samples to chord combinations we already know we like. Even if it had some variation from the 4 chords or was in a different key (not sure about music theory)
@XTJ7
@XTJ7 4 жыл бұрын
@@joeyda3rd absolutely. I think once the algorithm learned how to arrange these four chords, it might work for other chords as well - at least as long as they are on a specific scale. I smell a very interesting video series coming up :)
@KieCodes
@KieCodes 4 жыл бұрын
Thanks XTJ7. I will look into it, but I think my journey into the world of music generation is over for now to be honest. :)
@XTJ7
@XTJ7 4 жыл бұрын
@@KieCodes it was a short but pleasant journey!
@sualehalam4259
@sualehalam4259 3 жыл бұрын
Wow brother, this is some BAD-ASS content you are uploading. I'm totally in love with your content how you show the actual way to approach a problem and then solve it and also highlight all the steps. Could you please try developing a Crypto Trading Bot using Genetic Algorithm (it's a new concept which I had in mind after watching this video) ❤
@KieCodes
@KieCodes 3 жыл бұрын
Thank you so much! 🙏 Comments like this keep me going. Regarding your idea: I will put it on my topic list. But I have to read up on how trading bots could work with a GA. But it is totally something I want to try out. :)
@michaelmalzacher6018
@michaelmalzacher6018 Жыл бұрын
awesome video
@KieCodes
@KieCodes Жыл бұрын
Thank you! 🙏
@salimbenchekroun7543
@salimbenchekroun7543 4 жыл бұрын
Perhaps a nice application of genetic algorithms would be to create elegant landscapes in a video game. edit: or even some abstract art!
@KieCodes
@KieCodes 4 жыл бұрын
Totally possible Salim. The question is always how to determine the fitness. How can you tell if the GA is developing in the right direction?
@MattWer
@MattWer 3 жыл бұрын
This is amazing
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@shortlaker209
@shortlaker209 2 жыл бұрын
Algorithmic love 🎵🎶🎹~~~ 🤣🤣🤣 thanks for sharing!
@KieCodes
@KieCodes 2 жыл бұрын
You are welcome. I am glad you liked it! 🙌
@keeperofthelight9681
@keeperofthelight9681 2 жыл бұрын
Solid !!!!
@daeskk
@daeskk 3 жыл бұрын
I am just in love genetic algorithms thanks to you, could you try creating a video using GA with games ? would be interesting.
@KieCodes
@KieCodes 3 жыл бұрын
I have something planned! Thank you.
@lalaliri
@lalaliri 4 жыл бұрын
Very good content!!
@KieCodes
@KieCodes 4 жыл бұрын
Thank you Laura! 🙏
@wlockuz4467
@wlockuz4467 2 жыл бұрын
For a fitness function, would it be possible to have 5 of your favorite melodies, lets call them "base melodies" and every time the algorithm generates a new melody the fitness function will "compare" it with the base melodies and give a rating based on how similar they sound. This would eliminate the manual rating part and allow for the algorithm to evolve much faster.
@KieCodes
@KieCodes 2 жыл бұрын
Sure. The hard part would be to define something that compares the melodies without pushing the algo to exactly replicate your base melodies.
@wlockuz4467
@wlockuz4467 2 жыл бұрын
@@KieCodes Yeah I agree, The comparison function itself would be a project of its own lol
@gmggx8944
@gmggx8944 4 жыл бұрын
cool video can you make tutorial on topics like how to read doc, code... how to understand concepts and how you learn
@KieCodes
@KieCodes 4 жыл бұрын
Hey. Thanks for your kind words. I have one vidoe on how to learn programming faster. Great you like this meta topics. Cheers
@PepeTostado
@PepeTostado 2 жыл бұрын
Man, this is awesome! How did you learn all this?
@KieCodes
@KieCodes 2 жыл бұрын
Thank you.
@MehmetKoseDev
@MehmetKoseDev 2 жыл бұрын
that is amazing
@KieCodes
@KieCodes 2 жыл бұрын
Thank you. 🙏
@dellasrevenge8759
@dellasrevenge8759 2 жыл бұрын
in collab i'm getting this error in the '[Events]' line Error: no such option: -f An exception has occurred, use %tb to see the full traceback. SystemExit: 2 ---- def genome_to_events(genome: Genome, num_bars: int, num_notes: int, num_steps: int, pauses: bool, key: str, scale: str, root: int, bpm: int) ->[Events]: melody = genome_to_melody(genome, num_bars, num_notes, num_steps, pauses, key, scale, root)
@Faad3e
@Faad3e 3 жыл бұрын
great video!
@KieCodes
@KieCodes 3 жыл бұрын
Thank you!
@JahidulislamRuman
@JahidulislamRuman 7 ай бұрын
I have a musical instrument, I want to digitize its sound, like we can play guitar with software. Can you please help me how to start programming it.
@crysiscontained4421
@crysiscontained4421 2 жыл бұрын
I have noticed in your code that you have the flats and sharps as two different notes, which they are not. C# is the same as Db. Only matters what they are called if you are writing them in music notation. If you are ascending they are sharps and descending they are flats. B and E don't technically have sharps or flats, and to this day I still can't figure out why music labels them as such in certain cases.
@KieCodes
@KieCodes 2 жыл бұрын
Hey. Thank you for pointing that out.
@crysiscontained4421
@crysiscontained4421 2 жыл бұрын
@@KieCodes Welcome mate, Whilst it may be irrelevant as long as the computer can mathematically know that they are the same note but all the same I have noticed that the less data a computer has to process to get a result the better lol and the less code we have to write
@VidyaVaidyanathan
@VidyaVaidyanathan 2 жыл бұрын
Hello, I had some questions about GA, how can I reach you?
@SkateTube
@SkateTube Жыл бұрын
I am getting error - portaudio.h: No such file or directory when installing requerements.
@SkateTube
@SkateTube Жыл бұрын
I'm getting following output when I try to run mgen script - ALSA lib pcm_dsnoop.c:601:(snd_pcm_dsnoop_open) unable to open slave
@crankhere9849
@crankhere9849 4 жыл бұрын
It can have application in making sounds for some indie game. It's a good start though.
@KieCodes
@KieCodes 4 жыл бұрын
Yeah. Cool application. 🙌
@marklondon9004
@marklondon9004 3 жыл бұрын
Could you reverse this and use actual hit songs as the input and the output being a formula?
@shazamman6426
@shazamman6426 2 ай бұрын
there is an issue with installing the requirements.txt in my system. Plz help
@JujuChichi
@JujuChichi 2 жыл бұрын
this is precisely something similar to what I have been looking out for so long. although I was pretty curious to know and understand a thing. if you were to incorporate other trigger points to decide the data triggers for you (like the way you add details of the scale, modes, and tempo), can that be done through external sources like analyzing an image and using that RGB data as variables to feed into these? how easy or difficult could that be if it comes to implementing such a sort of a thing, to this code?
@dadadies
@dadadies 3 ай бұрын
How come you havent updated it since 4 years to include other possible features? Is there something else youd recommended over it? With other recent AI advancements it would be nice to see what you can accomplish.
@KieCodes
@KieCodes 17 күн бұрын
It was a just a small fun project. Nothing I wanted to keep moving forward. The code is on github for everyone to use and extend.
@saketnarendra8864
@saketnarendra8864 3 жыл бұрын
Hey could you also tell me how to work around with the fitness of the function because when i run the script nothing really happens
@KieCodes
@KieCodes 3 жыл бұрын
Hey. Sorry! I am not sure what you mean.
@e30mmaniac
@e30mmaniac 4 жыл бұрын
Cant wait...
@KieCodes
@KieCodes 4 жыл бұрын
How did you like it?
@user-ob9zo9cr4c
@user-ob9zo9cr4c 3 жыл бұрын
hi, I got question. I would like to make basic pixel art incl music.. but both things auto generate is that possible? or I need to do both things alone, then split em together.. ? ofc I talk about NFT project, anyone/anything? where I could start to read/listen/learn about it, I got kinda deadline and would like to make it real.
@KieCodes
@KieCodes 3 жыл бұрын
It really depends on what you want to do. If it is abstract pixel art, you can do it together. If you want to do pixel art style PFPs like crypto punks, I would do it separately.
@user-ob9zo9cr4c
@user-ob9zo9cr4c 3 жыл бұрын
@@KieCodes thanks for quick replay. it's about super basic cubes, and also just 2 colors. I have no IT background, I saw that Python could works, but where I could/how start? like level 0? appreciate any answers.
@Ahmed.Al-Hloul97
@Ahmed.Al-Hloul97 4 жыл бұрын
I need some algorithmic love in my life
@KieCodes
@KieCodes 4 жыл бұрын
I am sure you‘ll get it. 🙏
@timtensor6994
@timtensor6994 3 жыл бұрын
Really interesting content .Can one input any other algorithms to act as input to generate sequences of songs. What are your thoughts about super collider ? Is there a python wrapper on top of supercollider. Any other algorithm you are thinking of tinkering with ? is Pyo the best module , you have come across.
@KieCodes
@KieCodes 3 жыл бұрын
Hey Tim. Thank you 🙏. I am not sure what you mean with other algorithms as input. But there is a python interface to supercolider and you could use it for the sound synthesis after the GA has geberated a melody. supercollider.github.io/community/systems-interfacing-with-sc
@timtensor6994
@timtensor6994 3 жыл бұрын
@@KieCodes thanks for the reply. I meant if other algorithms could be used to generate music, similar to what you have generated . Great stuff already subscribed!
@KieCodes
@KieCodes 3 жыл бұрын
Thanks for subscribing! I am very sure there are a lot of different algorithmic approaches to generate melodies of chord progressions, but I haven't really looked into it. I was more curious about if a GA can tackle this problem.
@johnlimusicofficial220
@johnlimusicofficial220 Жыл бұрын
TOGETHER WE GENERATE! :)
@stephenjarrell3766
@stephenjarrell3766 4 жыл бұрын
GitHub? It’d be really helpful to learn from, even if you just go over some code a little bit in future videos. Cool GA :)
@KieCodes
@KieCodes 4 жыл бұрын
Hey Stephen. Thanks for your comment! I will clean everything up and publish it to github,
@KieCodes
@KieCodes 4 жыл бұрын
Enjoy! github.com/kiecodes/generate-music
@natalka9
@natalka9 Жыл бұрын
cool, could you create all the instruments in AI as Google's deleted one did?
@SkateTube
@SkateTube Жыл бұрын
You can't install requirements cause fatal error: portaudio.h: No such file or directory.
@simonyin9229
@simonyin9229 2 жыл бұрын
Its an interesting idea but i think your making the process to hard on you. The fundemental issue you ran into is that the quality of a melody is not easy to translate to a fitness function. But if you are going to sit there and judge quality yourself anyway you might as well start of with some melodies you already like. I think i could be interesting to have a setup where you feed in some musical ideas to start with and then the program mutates the melodies slighlty as you described changing some notes combining pieces. This way you could have a nice way of quckly iterating over new ideas to then put into a song. I feel you would achieve good results much quicker if you start with something good and just "sprinkle in" the randomness.
@KieCodes
@KieCodes 2 жыл бұрын
That‘s true. I wouldn‘t recommend my approach to anyone as well. 😅
@AlanAztec
@AlanAztec 3 жыл бұрын
Haha. The time for a coffee part really made me laugh. So true.
@KieCodes
@KieCodes 3 жыл бұрын
Coffee fueling my code generator. 😅
@SkateTube
@SkateTube Жыл бұрын
Literaly, installed fresh ubuntu 22.04, tried to install the thing on it, fails every time on virtual environment or real.
@shiooma
@shiooma 3 жыл бұрын
Can you introduce what is the best module to import in Python for music production?
@KieCodes
@KieCodes 3 жыл бұрын
Hey. Sorry. No idea. I found a few but only tried out pyo.
@dani_elu
@dani_elu 3 жыл бұрын
Lovely
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@animebattles7367
@animebattles7367 3 жыл бұрын
Dope
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. 🙏
@martinbielke8301
@martinbielke8301 3 жыл бұрын
Very nice. I've tried to run the code after installing the requierements. It says it can't finde de module "algorithms". Can anyone help me on this? Thanks
@KieCodes
@KieCodes 3 жыл бұрын
Thank you. The module "algorithms" is not an external dependency. It is a sub-module in the repository. So there should be a sub-folder called algorithms in your files. Is that the case?
@martinbielke8301
@martinbielke8301 3 жыл бұрын
@@KieCodes It would be great to be able to run the code... Thanks for the help.
@KieCodes
@KieCodes 3 жыл бұрын
The code should be able to run out of the box. Do you still get the error? How do you run it? What version of python are you using?
@martinbielke8301
@martinbielke8301 3 жыл бұрын
@@KieCodes Hey Thanks for your answer. I've been really busy but now back to this... I still get the error. I run the code through my Jupiter Notebook. I use Python 3.7.7. I use this code to load the genetic.py file: %load/Users/martinbielke/Desktop/generate-music-main/algorithms/genetic.py Then I use the following code to load the mgen.py file: %load/Users/martinbielke/Desktop/generate-music-main/mgen.py If you can help me with this I will appreciate it very much!
Genetic Algorithms Explained By Example
11:52
Kie Codes
Рет қаралды 360 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Genetic Algorithm from Scratch in Python (tutorial with code)
12:18
Using AI to Create the Perfect Keyboard
12:05
adumb
Рет қаралды 1,4 МЛН
Genetic Algorithm In Python Super Basic Example
17:42
The Builder
Рет қаралды 132 М.
Anna Wszeborowska - Processing music on the fly with Python
24:27
Epic Python Videos
Рет қаралды 69 М.
What if all the world's biggest problems have the same solution?
24:52
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 215 М.
Genetic Algorithms in Python - Evolution For Optimization
26:10
NeuralNine
Рет қаралды 22 М.
How to build a Synthesizer in Python!
7:57
Pao Coding Tutorials
Рет қаралды 37 М.
How I animate 3Blue1Brown | A Manim demo with Ben Sparks
53:41
3Blue1Brown
Рет қаралды 1,3 МЛН
How do non-euclidean games work? | Bitwise
14:19
DigiDigger
Рет қаралды 2,5 МЛН