rualark / MGen

MGen: Windows PC C++ music generation and analysis laboratory, playing into MIDI port and exporting MIDI
http://arkhipenko.weebly.com
GNU Affero General Public License v3.0
45 stars 11 forks source link

CP3: SWA often does not return rpenalty=0 results #993

Closed rualark closed 7 years ago

rualark commented 7 years ago

Ideas:

  1. Optimize performance (find hot code, put blocking code up)
  2. Allow SWA to increase rpenalty by 200 if stuck if original violations are at least partially fixed.
  3. Shift correct range for very high and very low notes (increase inbound, decrease outbound) - done (fixed min_cc/max_cc correct range in CA2)
  4. Check which violations cannot be optimized without higher swa levels. Different.
  5. Implement SWA with incremental window scan inside each SWA run (#488) after fixing s_len=1 issues - done
  6. Consider using swa_inrange (#1003) - low priority, because this helps only CP1, not CA2
  7. Consider using correct_inrange (#1004) - implemented

image

rualark commented 7 years ago

SWA5 is more effective, but very slow:

00:29:44 Finished SWA5 #68: rp 0 from 10000000, dp 10000000, cnum 18 (in 2014246 ms): 2 Constrained local range (13 notes <m6), 00:49:24 Finished SWA5 #59: rp 0 from 10000000, dp 10000000, cnum 9 (in 1179676 ms): 1 Constrained local range (13 notes <m6), 00:50:00 Finished SWA4 #77: rp 0 from 10000000, dp 10000000, cnum 3 (in 36416 ms): 1 No + close MDC (4th), 00:53:20 Finished SWA4 #62: rp 0 from 10000000, dp 10000000, cnum 4 (in 199738 ms): 3 Constrained local range (13 notes <m6), 2 No melody direction (10 notes <16), 01:08:33 Finished SWA5 #76: rp 0 from 10000000, dp 10000000, cnum 12 (in 913462 ms): 1 No + close MDC (4th), 1 Altered neighbour (VI<->VI#), 01:29:21 Finished SWA5 #56: rp 31 from 10000000, dp 10000000, cnum 5 (in 1247506 ms): 1 Altered far neighbour (VI<->VI#), 01:29:30 Finished SWA3 #69: rp 0 from 10000000, dp 10000000, cnum 3 (in 9439 ms): 1 No melody direction (10 notes <16), 01:34:42 Finished SWA4 #60: rp 0 from 10000000, dp 10000000, cnum 5 (in 311330 ms): 1 No close MDC (precomp. | comp.) (4th), 01:34:56 Finished SWA3 #63: rp 0 from 10000000, dp 10000000, cnum 6 (in 13972 ms): 1 Tonic note (>2 within 9), 01:35:14 Finished SWA3 #57: rp 0 from 10000000, dp 10000000, cnum 6 (in 18195 ms): 1 Tonic note (>2 within 9), 02:02:39 Finished SWA5 #72: rp 31 from 10000000, dp 10000000, cnum 7 (in 1645578 ms): 1 Leap down size (m7), 02:03:28 Finished SWA4 #72: rp 0 from 10000000, dp 10000000, cnum 5 (in 48777 ms): 1 No + close MDC (4th), 02:03:50 Finished SWA3 #67: rp 0 from 10000000, dp 10000000, cnum 5 (in 21804 ms): 1 Constrained local range (13 notes <m6), 02:04:03 Finished SWA3 #68: rp 0 from 10000000, dp 10000000, cnum 6 (in 12650 ms): 1 Notes repeat (2 sym. in 5), 02:04:15 Finished SWA3 #50: rp 0 from 10000000, dp 10000000, cnum 6 (in 12680 ms): 1 Altered interval (VII#<->III), 02:09:24 Finished SWA4 #62: rp 0 from 10000000, dp 10000000, cnum 8 (in 308374 ms): 1 Slurs within 10 notes (2), 02:13:18 Finished SWA4 #53: rp 0 from 10000000, dp 10000000, cnum 7 (in 234475 ms): 1 Far + far1 MDC (3rd), 1 Constrained local range (13 notes <m6), 02:45:23 Finished SWA5 #70: rp 75 from 10000000, dp 10000000, cnum 10 (in 1924539 ms): 1 Out of range (voice >M9), 02:45:28 Finished SWA3 #61: rp 0 from 10000000, dp 10000000, cnum 5 (in 5613 ms): 1 Slurs within 10 notes (2), 03:30:25 Finished SWA5 #67: rp 0 from 10000000, dp 10000000, cnum 9 (in 2697116 ms): 1 No close MDC (precomp. | comp.) (3rd), 03:30:30 Finished SWA2 #55: rp 0 from 10000000, dp 10000000, cnum 5 (in 4179 ms): 1 Slurs within 10 notes (2), 1 Leap up size (m7), 03:30:30 Reached t_cnt steps. Generation stopped 03:30:30 Reached t_cnt steps. Generation stopped

rualark commented 7 years ago

SWA4 with correct range 5 does not give much good results: image

rualark commented 7 years ago

Species 2 - SWA4 - correct range 12 - 5 sec/result - 10% fail Species 3 - SWA4 - correct range 12 - 1,5 min/result - 15% fail Species 4 - SWA4 - correct range 12 - 3 min/result - 90% fail Species 5 - SWA4 - correct range 12 - no positive results yet

rualark commented 7 years ago

Species 2: image

11:58:10 Finished SWA3 #34: rp 0 from 10000000, dp 10000000, cnum 9 (in 3126 ms): 1 Tonic note (>2 within 9), 11:58:10 Finished SWA2 #28: rp 0 from 10000000, dp 10000000, cnum 7 (in 585 ms): 1 Dissonance (downbeat), 1 No close MDC (precomp. | comp.) (4th), 11:58:11 Finished SWA2 #34: rp 0 from 10000000, dp 10000000, cnum 6 (in 601 ms): 1 Direct leaping movement (5 cadence), 11:58:32 Finished SWA4 #34: rp 0 from 10000000, dp 10000000, cnum 5 (in 21475 ms): 1 Far + far1 MDC (3rd), 11:58:33 Finished SWA2 #28: rp 0 from 10000000, dp 10000000, cnum 9 (in 296 ms): 1 Slurs within 10 notes (2), 11:58:35 Finished SWA3 #35: rp 0 from 10000000, dp 10000000, cnum 5 (in 2305 ms): 1 No + close MDC (4th), 1 Altered interval (VII#<->III), 11:58:35 Finished SWA2 #22: rp 0 from 10000000, dp 10000000, cnum 4 (in 324 ms): 1 Far + far1 MDC (3rd), 1 Tonic note (>2 within 9), 11:58:40 Finished SWA3 #34: rp 0 from 10000000, dp 10000000, cnum 6 (in 4543 ms): 2 Constrained local range (13 notes <m6), 1 Notes repeat (2 sym. in 5), 11:58:40 Finished SWA2 #33: rp 0 from 10000000, dp 10000000, cnum 3 (in 311 ms): 1 Close + no MDC (4th), 11:58:41 Finished SWA3 #32: rp 0 from 10000000, dp 10000000, cnum 5 (in 859 ms): 1 No close MDC (precomp. | comp.) (3rd), 11:58:43 Finished SWA3 #31: rp 0 from 10000000, dp 10000000, cnum 4 (in 2068 ms): 1 No melody direction (10 notes <16), 11:59:11 Finished SWA4 #40: rp 31 from 10000000, dp 10000000, cnum 4 (in 27758 ms): 1 2nd to last measure (no B), 11:59:12 Finished SWA2 #33: rp 0 from 10000000, dp 10000000, cnum 4 (in 594 ms): 1 No close MDC (precomp. | comp.) (4th), 11:59:15 Finished SWA3 #36: rp 0 from 10000000, dp 10000000, cnum 7 (in 3895 ms): 1 No close MDC (precomp. | comp.) (3rd), 11:59:16 Finished SWA2 #28: rp 0 from 10000000, dp 10000000, cnum 4 (in 263 ms): 1 No melody direction (10 notes <16), 11:59:16 Finished SWA2 #34: rp 0 from 10000000, dp 10000000, cnum 5 (in 293 ms): 1 No + close MDC (4th), 11:59:24 Finished SWA4 #33: rp 0 from 10000000, dp 10000000, cnum 3 (in 8166 ms): 1 Altered neighbour (VI<->VI#), 11:59:24 Finished SWA2 #34: rp 0 from 10000000, dp 10000000, cnum 3 (in 208 ms): 1 Altered interval (VII#<->III), 11:59:47 Finished SWA4 #29: rp 31 from 10000000, dp 10000000, cnum 3 (in 22656 ms): 1 Altered interval (VII#<->III), 11:59:49 Finished SWA3 #33: rp 0 from 10000000, dp 10000000, cnum 7 (in 1539 ms): 1 2nd to last measure (no B), 12:00:08 Finished SWA4 #27: rp 0 from 10000000, dp 10000000, cnum 6 (in 19029 ms): 1 Direct leaping movement (5 cadence), 12:00:08 Finished SWA2 #36: rp 0 from 10000000, dp 10000000, cnum 5 (in 420 ms): 2 No melody direction (13 notes <20), 1 Uncompensated leap (5th), 12:00:12 Finished SWA4 #28: rp 0 from 10000000, dp 10000000, cnum 5 (in 3941 ms): 1 No close MDC (precomp. | comp.) (3rd), 12:00:15 Finished SWA3 #34: rp 0 from 10000000, dp 10000000, cnum 4 (in 3022 ms): 2 Constrained local range (13 notes <m6), 12:00:16 Finished SWA3 #34: rp 0 from 10000000, dp 10000000, cnum 6 (in 1077 ms): 1 Dissonance upbeat (leap), 12:00:17 Finished SWA2 #31: rp 0 from 10000000, dp 10000000, cnum 5 (in 638 ms): 1 Parallel imperfect consonances (3), 1 Altered neighbour (VI<->VI#), 12:00:17 Finished SWA2 #29: rp 0 from 10000000, dp 10000000, cnum 7 (in 728 ms): 1 No close MDC (precomp. | comp.) (3rd), 12:00:36 Finished SWA4 #46: rp 0 from 10000000, dp 10000000, cnum 5 (in 18113 ms): 1 No close MDC (precomp. | comp.) (3rd), 12:00:36 Finished SWA2 #34: rp 0 from 10000000, dp 10000000, cnum 4 (in 561 ms): 1 No close MDC (precomp. | comp.) (3rd), 12:00:55 Finished SWA4 #23: rp 62 from 10000000, dp 10000000, cnum 2 (in 18562 ms): 1 2nd to last measure (no B), 1 Altered interval (VI<->VII#),

rualark commented 7 years ago

Species 5: image