|
| 1 | +''' |
| 2 | +Specific chart generator for each songs |
| 3 | +This is going to be removed when 'Game maker' is developed! |
| 4 | +
|
| 5 | +0. Copy the template (entire chart_H2O.py file) and rename filename & class name properly. |
| 6 | +1. Add self.song_name. This should be same with the sound file name in /CC_music/ folder! |
| 7 | +2. define build_chart function and add patterns as you want! |
| 8 | +It must include: (every thing should be safely converted to integer) |
| 9 | +- song length [milliseconds] |
| 10 | +- song_bpm (calculate it from the online sites!) |
| 11 | +- song_difficulty (as you wish ^^) |
| 12 | +- total_points or # of nodes (as you wish ^^) |
| 13 | +
|
| 14 | +''' |
| 15 | + |
| 16 | +from chart_patterns import * |
| 17 | + |
| 18 | +class Chart_DropsOfH2O(): |
| 19 | + def __init__(self): |
| 20 | + self.song_name = 'Drops of H2O' |
| 21 | + |
| 22 | + def build_chart(self,full_path): |
| 23 | + ##################################### fill in |
| 24 | + song_length = 315*1000 |
| 25 | + song_bpm = 108 |
| 26 | + cycle = 4 |
| 27 | + song_mpb = ((1000 * 60 / song_bpm)/cycle) # 215 # milli-seconds per beat |
| 28 | + song_difficulty = 1 |
| 29 | + number_of_nodes = int((song_length / 1000) * (song_bpm / 60)) - 4 |
| 30 | + #################################### |
| 31 | + |
| 32 | + with open("%s" % full_path, "w") as f: |
| 33 | + f.write('%d,%d,%d,%d\n' % (song_length, song_bpm, song_difficulty, number_of_nodes)) |
| 34 | + ################################## fill in |
| 35 | + beats = 0 |
| 36 | + switch = True |
| 37 | + while number_of_nodes > 0: |
| 38 | + if beats % cycle == 1: |
| 39 | + pattern = '' |
| 40 | + if switch: |
| 41 | + pattern = basic_strike(beats, song_mpb, 1, 1) |
| 42 | + number_of_nodes -= 1 |
| 43 | + else: |
| 44 | + pattern = basic_hold(beats, song_mpb, 4, 1, 500) |
| 45 | + number_of_nodes -= 1 |
| 46 | + f.write(pattern) |
| 47 | + switch = not switch |
| 48 | + beats += 1 |
| 49 | + ################################## |
| 50 | + |
0 commit comments