Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #colorblock keyframe("shape, scale, fill_color, xOffset, yOffset") 1216x640
- ##Kickdrums
- colorblocks = "3744:(circle, 1, #000000, -500, -300), 3762:(circle, 1, #000000, 0, -300),3780:(circle, 1, #000000, 500, -300),"
- colorblocks += "3789:(circle, 1, #222222, -500, -300), 3798:(circle, 1, #222222, 0, -300),3810:(circle, 1, #222222, 500, -300),"
- colorblocks += "3814:(circle, 1, #000000, -500, -300), 3833:(circle, 1, #000000, 0, -300),3851:(circle, 1, #000000, 500, -300),"
- colorblocks += "3869:(circle, 1, #222222, -500, -300), 3887:(circle, 1, #222222, 0, -300),3905:(circle, 1, #222222, 500, -300),"
- colorblocks += "3923:(circle, 1, #000000, -500, -300), 3940:(circle, 1, #000000, 0, -300),3958:(circle, 1, #000000, 500, -300),"
- colorblocks += "3976:(circle, 1, #222222, -500, -300), 3993:(circle, 1, #222222, 0, -300),4011:(circle, 1, #222222, 500, -300),"
- colorblocks += "4029:(circle, 1, #000000, -500, -300), 4034:(circle, 1, #000000, 0, -300),4036:(circle, 1, #000000, 500, -300),"
- colorblocks += "4038:(circle, 1, #222222, -500, -300), 4047:(circle, 1, #222222, 0, -300),4065:(circle, 1, #222222, 500, -300),"
- colorblocks += "4074:(circle, 1, #000000, -500, -300), 4083:(circle, 1, #000000, 0, -300),4092:(circle, 1, #000000, 500, -300),"
- colorblocks += "4100:(circle, 1, #222222, -500, -300), 4119:(circle, 1, #222222, 0, -300),4136:(circle, 1, #222222, 500, -300),"
- colorblocks += "4154:(circle, 1, #000000, -500, -300), 4172:(circle, 1, #000000, 0, -300),4190:(circle, 1, #000000, 500, -300),"
- colorblocks += "4207:(circle, 1, #222222, -500, -300), 4225:(circle, 1, #222222, 0, -300),4243:(circle, 1, #222222, 500, -300),"
- colorblocks += "4259:(circle, 1, #000000, -500, -300), 4263:(circle, 1, #000000, 0, -300),4278:(circle, 1, #000000, 500, -300),"
- colorblocks += "4296:(circle, 1, #222222, -500, -300), 4314:(circle, 1, #222222, 0, -300),"
- #Snare hits
- colorblocks += "3753:(square, 1, #FFFFFF, -500, 300), 3770:(square, 1, #FFFFFF, 500, 300),"
- colorblocks += "3806:(square, 1, #DDDDDD, -500, 300), 3824:(square, 1, #DDDDDD, 500, 300),"
- colorblocks += "3842:(square, 1, #FFFFFF, -500, 300), 3860:(square, 1, #FFFFFF, 500, 300),"
- colorblocks += "3877:(square, 1, #DDDDDD, -500, 300), 3913:(square, 1, #DDDDDD, 500, 300),"
- colorblocks += "3931:(square, 1, #FFFFFF, -500, 300), 3949:(square, 1, #FFFFFF, 500, 300),"
- colorblocks += "3967:(square, 1, #DDDDDD, -500, 300), 3985:(square, 1, #DDDDDD, 500, 300),"
- colorblocks += "4003:(square, 1, #FFFFFF, -500, 300), 4020:(square, 1, #FFFFFF, 500, 300),"
- colorblocks += "4038:(square, 1, #DDDDDD, -500, 300), 4055:(square, 1, #DDDDDD, 500, 300),"
- colorblocks += "4109:(square, 1, #FFFFFF, -500, 300), 4127:(square, 1, #FFFFFF, 500, 300),"
- colorblocks += "4145:(square, 1, #DDDDDD, -500, 300), 4163:(square, 1, #DDDDDD, 500, 300),"
- colorblocks += "4180:(square, 1, #FFFFFF, -500, 300), 4198:(square, 1, #FFFFFF, 500, 300),"
- colorblocks += "4216:(square, 1, #DDDDDD, -500, 300), 4234:(square, 1, #DDDDDD, 500, 300),"
- colorblocks += "4252:(square, 1, #FFFFFF, -500, 300), 4269:(square, 1, #FFFFFF, 500, 300),"
- colorblocks += "4287:(square, 1, #DDDDDD, -500, 300), 4305:(square, 1, #DDDDDD, 500, 300),"
- colorblocks += "4313:(square, 1, #FFFFFF, -500, 300),"
- #keyframe("text,xoffset,yoffset,pointsize")
- lyric_text_keyframes = parse_key_frames(lyric_texts)
- #keyframe("shape, scale, fill_color, xOffset, yOffset")
- beat_colorblocks_keyframes = parse_key_frames(colorblocks)
- ### Added by Mark
- from PIL import Image, ImageDraw, ImageFont
- import PIL
- def checkBonusKeyframes(frameNum):
- if frameNum in lyric_text_keyframes:
- addLyricToImage(lyric_text_keyframes[frameNum])
- elif frameNum in colorblock_keyframes:
- addColorBeatToImage(colorblock_keyframes[frameNum])
- return
- def addLyricToImage(keyframe):
- text, xoffset, yoffset, pointsize = keyframe.split(',')
- text_color = (255, 255, 255)
- stroke_color = (0, 0, 0)
- img = PIL.Image.open("./prevFrame.png")
- width, height = img.size
- font = ImageFont.truetype('//wsl.localhost/Ubuntu/usr/share/fonts/truetype/ElegantTypewriterBold-BWnYG.ttf', int(pointsize))
- draw = ImageDraw.Draw(img)
- draw.text((width/2 + int(xoffset), height/2 - int(yoffset)), text, font=font, fill=text_color , stroke_width=4, stroke_fill=stroke_color, anchor="mm")
- img.save('prevFrame.png')
- return
- def addColorBeatToImage(keyframe):
- shapeType, scale, fill_color, xOffset, yOffset = keyframe.split(',')
- img = PIL.Image.open("./prevFrame.png")
- draw = ImageDraw.Draw(img)
- scale = int(scale)
- xOffset = int(xOffset)
- yOffset = int(yOffset)
- stroke_color_circle = (255,255,255)
- stroke_color_square = (0,0,0)
- width, height = img.size
- pos1 = (width / 2 + 50 * scale + xOffset, height / 2 + 50 * scale - yOffset)
- pos2 = (width / 2 - 50 * scale + xOffset, height / 2 - 50 * scale - yOffset)
- shape = [pos2, pos1]
- print(pos1, pos2)
- if shapeType == "circle":
- draw.ellipse(shape, fill=fill_color.strip(), outline=stroke_color_circle, width=7)
- print('drew circle')
- else: #shapeType == "square":
- draw.rectangle(shape, fill=fill_color.strip(), outline=stroke_color_square, width=7)
- img.save('prevFrame.png')
- return
- ###
Advertisement
Add Comment
Please, Sign In to add comment