Harp with pedals, keys and scales

So your zip file has 2 json files. Only 1 opens for me. Do we need to be able to load both of them?

@denisspycher wrote :

There are two files:
HARP.json is the session file.
harpScale.json is only a data file with the scales, but IMPORTANT (HARP.json is reading it)

You will have to create an virtual midi port called "osc" in the launcher window corresponding to your setup.

Important is, that the harpScale.json file is in the same folder, where you start the HARP.json file.

The Variable-Widget "variable_harpScale" is importing...

... the harpScale.json file to the value.

2 Likes

Thanks for the info. Will be uploading a version with some added scales in the near future ?

Programming is just a hobby of mine (With great support from @jean-emmanuel) and the community... need to get back to work first to earn a living. Difficult to say when I will get back to it.

2 Likes

Thank you very much for sharing. It’s definitely something I couldn’t have figured out on my own

@zig @Mike1 @Greenman
Here I have my newest Harp version.

  • Without Pedals.

You can set:

  • The slider for changing the octave range to play.
  • Button for choosing the basic keynote
  • Button for choosing the scale

On the playable matrix:

  • The red key in the matrix always shows the basic keynote you have set.
  • The octave adjusts to the scale that is selected.
  • The strings per octave dynamically adjust to the selected scale (egyptian = 5, major = 7, bebob = 8...)

HarpV2.zip (5.4 KB)

1 Like

The Last version of my harp:
Harp_v3.01.zip (5.0 KB)

1 Like

Thank you very much for sharing

Hey Denis,

I’m trying to get your mini keyboard display into a big midi controller. I’ve assigned all the proper OSC assignments and extended the keyboard to 46 keys. Is it possible to have the key and scale selection from your harp to display across all 46 keys as well? I can only manage to get the colours to show across 1 octave range

Hi @Mike1

in the keyboard/css you can replace the existing css with

JS{{
  var css = ''
  var k = (VAR{keyNoteNumber} || 0) + 1
  var scale = VAR{scaleJSON} || [0,2,4,5,7,9,11]
  var l = scale.length-1
  var octave = 4
  for (let j=0; j<=((octave-1)*12); j=j+12 ) { 
    css += ".key:nth-child(" + (k+j) + ") inner {background-color: #cc0000}\n"
    for ( let i=1; i<=l; i++ ) {
      var outside = (scale[i] + k)
      if (outside > 12) {
        outside = outside -12
      }
      css += ".key:nth-child(" + (outside+j) + ") inner {background-color: #336699}\n"
    }
  }
  css += ".key > inner { border: 1px solid #111}"
  return css
}}

than you can change the "var octave = 4" to the one you need.

1 Like

Perfect thanks. I’ll give that a try

1 Like

ok... with the input from @Mike1 i have added a keyboard to the harp.

I have added a keyboard/harp toggle button in the lower right corner.

I have made the following changes:

  • The lower three widgets (range, rootkey"red" and scale"blue") set the harp and the keyboard.
  • Harp: The velocity is 0 at the top and 127 at the bottom so it reacts the same as the keyboard.
  • The file "harp_scale.json" has now additional scale's.

I think that's about it....

Here is the download:
Harp_v3.02.zip (5.4 KB)

1 Like

Great work. I like the idea of a harp/piano toggle button. Much better than what I was using in separate tabs.

Thanks for adding the scales. I’m gonna try to edit your harp_scale file and place the scales in alphabetical order. Would it be possible to have the minor scales and the exotic scales highlighted in a different colour other than blue? Might be easier to select the scale quicker that way

1 Like

Go to the Keyboard/CSS properties:

JS{{
  var css = ''
  var k = (VAR{keyNoteNumber} || 0) + 1
  var scale = VAR{scaleJSON} || [0,2,4,5,7,9,11]
  var l = scale.length-1
  var octave = 7
  for (let j=0; j<=((octave-1)*12); j=j+12 ) { 
    css += ".key:nth-child(" + (k+j) + ") inner {background-color: #cc0000}\n"
    for ( let i=1; i<=l; i++ ) {
      var outside = (scale[i] + k)
      if (outside > 12) {
        outside = outside -12
      }
      css += '.key:nth-child(' + (outside+j) + ') inner {background-color: #336699}\n'
    }
  }
  css += ".key > inner { border: 1px solid #111}"
  return css
}}

Line 8: #cc0000 is the red color

css += ".key:nth-child(" + (k+j) + ") inner {background-color: #cc0000}\n"

and line 14: #336699 is the blue color

css += '.key:nth-child(' + (outside+j) + ') inner {background-color: #336699}\n'

change it as you like.

I meant this panel here not the actual keyboard

This i do not know at the moment... i only put the lines in.

Here is the "harp_scale.json" file in alphabetical order:
harp_scale.json.zip (1.0 KB)

1 Like

Perfect thanks. That alone makes it much easier to quickly select a scale

About the different colors in the menu you can try something in the css like

JS{{
var css = ''
var r=255, g=0,b=0
for (var i = 0; i < 3; i++) {
  css += ".item:nth-child(" + (i+1) + "){background:" + "rgb("+r+","+g+","+b+")" + ";}\n"
}
for (var i = 3; i < 6; i++) {
  css += ".item:nth-child(" + (i+1) + "){background:" + "green" + ";}\n"
}
for (var i = 6; i < 17; i++) {
  css += ".item:nth-child(" + (i+1) + "){background:" + "red" + ";}\n"
}
for (var i = 17; i < 25; i++) {
  css += ".item:nth-child(" + (i+1) + "){background:" + "orange" + ";}\n"
}
return css
}}

I haven't had enough time to look at it yet. It's not dynamic, you have to expand it by hand if new scalings are added.

1 Like

Thanks I’ll give that a try