Jump to content


Photo

New Tool (3.1): ScaleMate

scale pattern editor midi command

  • Please log in to reply
28 replies to this topic

#1 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 28 May 2017 - 11:28

- "managed to put this together in a little hacking session last night"
 
v0.2-dialog.png
 
Download most recent version (tool page) 
Source code and documentation (github)


Edited by danoise, 30 May 2017 - 16:29.

  • Djeroek, TheBellows, Akiz and 1 other like this

Tracking with Stuff. API wishlist | Soundcloud


#2 Circe

Circe

    Member

  • Normal Members
  • PipPip
  • 51 posts
  • Gender:Male
  • Location:Spain
  • Interests:Visual Basic 6.0 Music Programing
    Piano Chords

Posted 28 May 2017 - 11:59

Simply great and usefull ! Thanks a lot.

#3 Djeroek

Djeroek

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6721 posts
  • Gender:Male
  • Location:Borneo

Posted 28 May 2017 - 12:11

Got this after playing with it, closing down the gui and booting it up again from the tool menu;

 

'C:\Users\pluge\AppData\Roaming\Renoise\V3.1.0\Scripts\Tools\com.renoise.ScaleMate.xrnx\' failed to execute in one of its menu entry functions.

 
Please contact the author (danoise [bjorn.nesby@gmail.com]) for assistance...
 
std::logic_error: 'trying to access an already closed dialog. the object is no longer available.'
stack traceback:
  [C]: in function 'show'
  .\source/ScaleMate_UI.lua:66: in function 'show'
  main.lua:155: in function 'show'
  main.lua:61: in function <main.lua:60>


#4 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 28 May 2017 - 12:19

Got this 

 

Thanks! Fixed and uploaded a new version...


Tracking with Stuff. API wishlist | Soundcloud


#5 BpZ

BpZ

    Advanced Member

  • Normal Members
  • PipPipPip
  • 114 posts
  • Gender:Male

Posted 28 May 2017 - 16:41

Very nice

Thaks 



#6 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1036 posts
  • Gender:Male
  • Location:Spain

Posted 28 May 2017 - 17:39

Hi Danoise

 

I think it's missing filtering for the type: track (sequence). For "group", "master" and "send" give back a error for not having note columns.

.\source/xLib/classes/xLinePattern.lua:422: attempt to index local 'note_col' (a nil value)
stack traceback:
  .\source/xLib/classes/xLinePattern.lua:422: in function 'set_midi_command'
  .\source/ScaleMate.lua:92: in function 'write_scale'
  .\source/ScaleMate.lua:55: in function 'set_scale'
  .\source/ScaleMate_UI.lua:146: in function <.\source/ScaleMate_UI.lua:145>

Thanks for your tools! ^_^  I will certainly look at the code for some details for my tool.


:excl: Development of my tool: GT16-Colors

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#7 Meef Chaloin

Meef Chaloin

    Big GrandDaddy Member

  • Normal Members
  • PipPipPipPipPipPipPipPip
  • 478 posts
  • Gender:Male

Posted 28 May 2017 - 20:43


It will also listen for the selected scale and show it in the UI.

 

What do you mean by this exactly?



#8 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 29 May 2017 - 14:18

I think it's missing filtering for the type: track (sequence). For "group", "master" and "send" give back a error 

 

Oh, I completely overlooked this detail. Thanks!

 

Edit: uploaded a new version (0.12) that fixes this problem.

This release also adds key-handling for the tool dialog - basically, the most fundamental pattern shortcuts: arrow keys, tab etc. 


Edited by danoise, 29 May 2017 - 17:37.

Tracking with Stuff. API wishlist | Soundcloud


#9 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 29 May 2017 - 17:47

What do you mean by this exactly?

 

The tool is nothing more than a breakout console for quickly showing/selecting instrument scales. 

And of course, a quicker way to enter those pesky scale commands into the pattern (MIDI command - CC command #15). 

 

I guess you were hoping for something like analyzing the pattern contents and guessing what scale(s) you're working in? 

Sorry, nothing that fancy yet. Might have to get laffik on board to solve that riddle  ;)


Tracking with Stuff. API wishlist | Soundcloud


#10 Akiz

Akiz

    Guruh Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 970 posts
  • Gender:Male

Posted 29 May 2017 - 19:21

Somebody should hack it to the "scale transposer tool" :]



#11 Meef Chaloin

Meef Chaloin

    Big GrandDaddy Member

  • Normal Members
  • PipPipPipPipPipPipPipPip
  • 478 posts
  • Gender:Male

Posted 29 May 2017 - 20:33


I guess you were hoping for something like analyzing the pattern contents and guessing what scale(s) you're working in? 

Sorry, nothing that fancy yet. Might have to get laffik on board to solve that riddle  ;)

Ah yes, that is what I thought you meant originally.

Nevermind, still a handy tool, thanks.



#12 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1507 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 30 May 2017 - 09:10

I guess you were hoping for something like analyzing the pattern contents and guessing what scale(s) you're working in? 

Sorry, nothing that fancy yet. Might have to get laffik on board to solve that riddle  ;)

 

It's a simple brute force operation of just using a scales table and find the best match (top ratio of matching notes vs non-matching notes = most probable scale).

 

Some scales do have the same notes, and you will "never" be able to distinguish them with an algorithm. You could show a list sorted on note matching ratio. Also, if the match is 100% for two scales, it should prefer the scale with fewer pitch classes.


Edited by joule, 30 May 2017 - 09:13.


#13 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 30 May 2017 - 09:46

It's a simple brute force operation

 

I believe it could work, but only in ideal circumstances - imagine that you're going through a chord progression? There could be a *lot* of notes to choose from.

Then, suddenly, the likeliness of a given chord vs. another chord becomes an important factor as well.

But perhaps you are right and a brute-force, statistics-based approach could be a powerful ally too. Let it crunch some numbers and offer you a few choices.

 

What I would like to do next is to introduce a feature to fit/remap existing notes to a scale. It's such a basic thing that you'd expect from a tool like this. 

Oh, and a small piano keyboard at the top, indicating the current key just like we have the scales. 


Tracking with Stuff. API wishlist | Soundcloud


#14 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1507 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 30 May 2017 - 09:57

1) You should analyze a chord progression. The more notes, the more reliable the top match will be. The most optimal is to analyze the whole song except for atonal sounds (percs).

 

2) Are you planning on doing some more elaborate reharmonization, or just a simple "snap to closest note in new scale"? (Renoise already does that natively, right?)


Edited by joule, 30 May 2017 - 09:58.


#15 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 30 May 2017 - 10:27


just a simple "snap to closest note in new scale"?

 
Yes, it would be simple - as in, "what you hear is what you get". If you switch to a scale and like what you hear, you should get the same result by applying the scale.
The advanced thing about the implementation would be to make the tool examine all tracks as it applies the scale - as there can only ever be one active scale at a time, it could still be defined across tracks.
 

(Renoise already does that natively, right?)

 
Yes and no. The instrument scale is a trigger option - meaning, it's applied when you live play/record notes, but not in playback/editing. 
There is an exception to this, however: when you're using phrases, Renoise will snap to notes (in the phrase) in realtime. Standalone notes in the pattern are still played back as-is. 
 
So this tool would obviously affect the standalone notes, but not necessarily have an affect on notes that trigger phrases.

The most optimal is to analyze the whole song except for atonal sounds (percs).

 
I dunno, what would be the best way to separate melodic and percussive/atonal material anyway - short of analyzing the actual samples ?
IMO, you managed to demonstrate just how big a can of worms it *could* become. All for the sake of telling you which chord you might be using  ^_^

Tracking with Stuff. API wishlist | Soundcloud


#16 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1507 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 30 May 2017 - 10:39

Yes, it would be simple - as in, "what you hear is what you get". If you switch to a scale and like what you hear, you should get the same result by applying the scale.
The advanced thing about the implementation would be to make the tool examine all tracks as it applies the scale - as there can only ever be one active scale at a time, it could still be defined across tracks.
 
 
Yes and no. The instrument scale is a trigger option - meaning, it's applied when you live play/record notes, but not in playback/editing. 
There is an exception to this, however: when you're using phrases, Renoise will snap to notes (in the phrase) in realtime. Standalone notes in the pattern are still played back as-is. 
 
So this tool would obviously affect the standalone notes, but not necessarily have an affect on notes that trigger phrases.


Ah.. Big picture: I'm not sure how musically useful this kind of "reharmonization" really is. It doesn't seem too interesting to me, but I haven't tried it so I can't say for sure. To me, the Renoise scale feature seems like a real cheapo that makes more harm than good, so I probably shouldn't say too much in this matter and in this thread :)
 

I dunno, what would be the best way to separate melodic and percussive/atonal material anyway - short of analyzing the actual samples ?
IMO, you managed to demonstrate just how big a can of worms it *could* become. All for the sake of telling you which chord you might be using  ^_^


Yeah, you have to someway define what track you want to analyze. But a patterntrack with 4 chords will in many cases be enough to make a good guess on what key/scale that is being used. So analyzing a couple of patterns in selected_track_index should be enough imo. For melody, I would imagine that typically it would require just a little bit more scope to make the guess (depending on song of course). The user would have to take responsibility for selecting a harmonic/chord/melody track.
 

All for the sake of telling you which chord you might be using


This is not a matter of chords, I think? Chord recognition is a different beast where you don't absolutely have to know what key you're in. That's also just simple search & match, with a table defining interval structures (e g, 0, 4, 7 = major - 0, 4, 7, 11 = maj7, + all inversions).

Edited by joule, 30 May 2017 - 10:50.


#17 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 30 May 2017 - 10:58

To me, the Renoise scale feature seems like a real cheapo that makes more harm than good

 

Well, yes. This tool can't solve a fundamental problem that the scale implementation has. For that, you'd have to have something like an interval-based input method instead of fixed notes.
I mean, from a guitarists point of view you are strumming the strings and applying scales with the other hand. So here, each string is not representing a particular note - this is fundamentally different from playing on a piano.

Edit: and this would also be the reason why isomorphic layouts have become so popular. They fit better with this fluid scale concept than a piano ever could. 

 

But on a more practical level, I think part of the problem with the scale feature is that has been so out of reach - a gap that this tool aims to fill.


Edited by danoise, 30 May 2017 - 11:58.

Tracking with Stuff. API wishlist | Soundcloud


#18 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 30 May 2017 - 12:19

New release, v0.2

 

I added a small piano that visualizes the scale/key arrangement. 

Also detects changes to, and allows recording of scale-key in exactly the same way as the scale-mode. 

 

Going to put this one on the tool page if no more issues are discovered: 


Tracking with Stuff. API wishlist | Soundcloud


#19 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1507 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 30 May 2017 - 12:33

Some minors:

 

1) I installed the tool, set the shortcut and opened it while in master track. The tool didn't work correctly until Renoise was restarted (nothing in the GUI really selectable).

2) The button next to the scale names is not quite wide enough to hide the 'radio box' in vb:chooser (1 pixel too narrow). Maybe it's dependant on theme setting, or I changed some font in the Renoise settings.

 

(PS. Technically, I think you can tie a vb:checkbox to a label for label-click support. Then adding a normal button on top of that seems like a slightly cleaner hack)



#20 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1036 posts
  • Gender:Male
  • Location:Spain

Posted 30 May 2017 - 12:49

@Danoise, are the 12 piano keys buttons?

  1. How do you get that they only have 1 pixel of separation between them???
  2. Is it possible to remove 1 pixel box around each button or similar element???

I could substantially improve the GUI of my tool with these details...

 

...

 

1) I installed the tool, set the shortcut and opened it while in master track. The tool didn't work correctly until Renoise was restarted (nothing in the GUI really selectable).

 

...

 

Apparently some tools do not work well after installing. Need to restart Renoise or restart tools (Reload all Tools). Possibly have to see that before had an earlier version of the tool already installed, without removing. Maybe?


:excl: Development of my tool: GT16-Colors

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#21 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 30 May 2017 - 13:43

Some minors:
 
1) I installed the tool, set the shortcut and opened it while in master track. The tool didn't work correctly until Renoise was restarted (nothing in the GUI really selectable).
2) The button next to the scale names is not quite wide enough to hide the 'radio box' in vb:chooser (1 pixel too narrow). Maybe it's dependant on theme setting, or I changed some font in the Renoise settings.
 
(PS. Technically, I think you can tie a vb:checkbox to a label for label-click support. Then adding a normal button on top of that seems like a slightly cleaner hack)

 
1. Thanks. I'll add an additional "attach_to_song" call when initializing the tool. Won't hurt. 
(To answer Raul:) I think tools don't receive the "new_document" notification when when first installed. And some tools (including this one, heh) could expect/rely on this to work properly. 
 
2. I'm already tying the checkbox to a text field - there is no "chooser". This allows you to style the text - something which is not possible with buttons. 
I simply forgot that the tying of checkbox <-> text works fine when the checkbox is set to "visible = false" - using this approach in vLib too. 
 
 

How do you get that they only have 1 pixel of separation between them???
Is it possible to remove 1 pixel box around each button or similar element???

 
Yes, they are buttons. Everything you ask should be possible by using negative margin/spacing. I'm specifying a spacing of -3 to get them to line up perfectly. 
And I guess you could encapsulate buttons in a rack (row/column) with a negative margin too, to remove the border. Haven't tried this myself but it should work.

Tracking with Stuff. API wishlist | Soundcloud


#22 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1036 posts
  • Gender:Male
  • Location:Spain

Posted 30 May 2017 - 14:01

 
Yes, they are buttons. Everything you ask should be possible by using negative margin/spacing. I'm specifying a spacing of -3 to get them to line up perfectly. 
And I guess you could encapsulate buttons in a rack (row/column) with a negative margin too, to remove the border. Haven't tried this myself but it should work.

 

I remember reading something related in a forum long ago (negative values in margins and things like that), but I did not know exactly how to do it. Ok, with this method it is possible to compact the tools more, or the buttons are a little wider, and the GUI cleaner. I like it!  :D

 

 

 
1. Thanks. I'll add an additional "attach_to_song" call when initializing the tool. Won't hurt. 
(To answer Raul:) I think tools don't receive the "new_document" notification when when first installed. And some tools (including this one, heh) could expect/rely on this to work properly. 

 

Ok, this is a detail that I have not even tried on my tool :o. I will have to check it out.

 

Thanks!!!

 

...

 

Side note: Yesterday I managed to use a 6-second timer to add a status foot that covers all the functions of a tool. It is very similar to the foot of Renoise, to the left side of the logo "Renoise". I find this very useful for tools that do several things, informing the user of the operation just made with the tool. Whenever it may be useful, I invite you to use it in the tools, instead of "renoise.app():show_status( "status" )". I love that the tools are compact. But sometimes it's hard to understand, given the complexity of some functions.


:excl: Development of my tool: GT16-Colors

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#23 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 30 May 2017 - 14:54

 
1. Thanks. I'll add an additional "attach_to_song" call when initializing the tool. Won't hurt. 
(To answer Raul:) I think tools don't receive the "new_document" notification when when first installed. And some tools (including this one, heh) could expect/rely on this to work properly. 
 
2. I'm already tying the checkbox to a text field - there is no "chooser". This allows you to style the text - something which is not possible with buttons. 
I simply forgot that the tying of checkbox <-> text works fine when the checkbox is set to "visible = false" - using this approach in vLib too. 

 

Both are done and uploaded to tool page: 

http://www.renoise.com/tools/scalemate


Tracking with Stuff. API wishlist | Soundcloud


#24 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1507 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 31 October 2017 - 10:30

I have a feature request that might fit into this tool.

 

A search mode that works in reverse (perhaps in a separate dialogue?), finding scales by clicking/toggling the keys on/off on the keyboard.

 

1) Click the keyboard buttons to toggle them on/off

2) A search result of matching key-scales is presented. (It's "one-way exclusive", so the chromatic scale will appear no matter what you search for.)

3) Some kind of mini-keyboard next to each search result would be nice, to quickly get a feel for how much that is matching the search.

 

Other than being a simple search-for-scale feature, this is harmonically helpful to quickly identify when a harmony/melody is ambiguous. Or for finding how to make it ambiguous on purpose.


Edited by joule, 31 October 2017 - 10:31.


#25 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6471 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 31 October 2017 - 15:52

Wait, so you're basically looking for a way to locate matching scales by inputting notes, one by one. 

I guess it could be implemented exactly as that, labelled either "filter" or "search". 

 

Something to think about. 


Tracking with Stuff. API wishlist | Soundcloud






Also tagged with one or more of these keywords: scale, pattern editor, midi command