Guest User

HX Stomp Reaper Controller

a guest
Dec 14th, 2025
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. desc:HX Stomp CC Controller
  2. author:Rymix
  3. version:1.0
  4. about:
  5. Converts MIDI notes to CC messages for HX Stomp control.
  6.  
  7. CC Control Notes (draw blocks to show effect duration):
  8. C3 (note 60) -> CC101
  9. C#3 (note 61) -> CC102
  10. D3 (note 62) -> CC103
  11. D#3 (note 63) -> CC104
  12. E3 (note 64) -> CC105
  13. F3 (note 65) -> CC106
  14. F#3 (note 66) -> CC107
  15. G3 (note 67) -> CC108
  16.  
  17. Note-on sends CC value 127 (effect ON)
  18. Note-off sends CC value 0 (effect OFF)
  19.  
  20. Program Change:
  21. B2 (note 59) -> Program Change
  22. Velocity determines program number (0-127)
  23.  
  24. slider1:1<1,16,1>MIDI Output Channel
  25. slider2:10<1,100,1>Sample Spacing (anti-congestion)
  26.  
  27. @init
  28. msg_count = 0;
  29.  
  30. @block
  31. msg_count = 0;
  32.  
  33. while (midirecv(offset, msg1, msg2, msg3)) (
  34. status = msg1 & 0xF0;
  35. note = msg2;
  36. velocity = msg3;
  37. out_channel = slider1 - 1;
  38.  
  39. handled = 0;
  40.  
  41. // Note on with velocity > 0
  42. (status == 0x90 && velocity > 0) ? (
  43.  
  44. // CC control notes: C3 (60) to G3 (67) -> CC101-108
  45. (note >= 60 && note <= 67) ? (
  46. cc_num = 101 + (note - 60);
  47. out_offset = offset + (msg_count * slider2);
  48. midisend(out_offset, 0xB0 + out_channel, cc_num, 127);
  49. msg_count += 1;
  50. handled = 1;
  51. );
  52.  
  53. // Program change: B2 (59), velocity = program number
  54. (note == 59) ? (
  55. out_offset = offset + (msg_count * slider2);
  56. midisend(out_offset, 0xC0 + out_channel, velocity, 0);
  57. msg_count += 1;
  58. handled = 1;
  59. );
  60. );
  61.  
  62. // Note off (status 0x80 or note-on with velocity 0)
  63. ((status == 0x80) || (status == 0x90 && velocity == 0)) ? (
  64.  
  65. // CC control notes: send CC value 0 (effect OFF)
  66. (note >= 60 && note <= 67) ? (
  67. cc_num = 101 + (note - 60);
  68. out_offset = offset + (msg_count * slider2);
  69. midisend(out_offset, 0xB0 + out_channel, cc_num, 0);
  70. msg_count += 1;
  71. handled = 1;
  72. );
  73.  
  74. // Ignore note-off for PC note (program change is momentary)
  75. (note == 59) ? (
  76. handled = 1;
  77. );
  78. );
  79.  
  80. // Pass through any unhandled MIDI messages
  81. !handled ? midisend(offset, msg1, msg2, msg3);
  82. );
  83.  
Advertisement
Add Comment
Please, Sign In to add comment