Jump to content


Photo

New Tool (2.8): Scalefinder (Osc) 0.1Alpha


  • Please log in to reply
29 replies to this topic

#1 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 21 January 2012 - 17:50

So i've been hacking Suva's Scalefinder tool ... (again)

*UPDATE*
Converted the tool to use OSC, that means no more midi loopback needed!

Setup:
1. Enable OSC server under Preferences->OSC->Enable Server with default settings (UDP: 8000)
2. Load the tool and select "OSC" as playback method (will be saved)
Please notice that the tool will not throw an error if it can't connect to the OSC server, it will simply do nothing.

Chord Mode:
Posted Image

Scale filter mode:
Posted Image

2. Usage: 

- Tools adds a menu entry: Tools->ScaleFinder (OSC)
- Tool has three MODES:
(MODE can be switched with the button that shows "Chord" on startup (top-left) or with a key or midi mapping) 
	* Chord Mode: 
		MIDI Input: plays the corresponding scale chord for each triggered note, that fits the scale 
		(eg: Scale C major: C triggers C maj, C# is empty, D triggeres D minor, etc.)
		KEYS: keys 1 .. 7 trigger scale chords I .. vii (first press = note on, second press = note off)
	* Scale Mode:
		MIDI & KEYS: only notes that fit the scale will play
	* Bypass: gui closes, keys and midi input realeased (besides mappings)

- Tool adds a bunch of midi mappings (Global->Scalefinder) and key mappings (Preferences->Keys->Global->Scalefinder) which will work even when the tool is in "Bypass" mode
- When the tool is closed (not "bypassed") the last mode will work until instrument is switched
NOTE about the "use fake track/instrument" option:
- if the midi device selected as 'midi input' is activated in the renoise preferences please leave the option switched on (default), otherwise there will be empty note columns on record
- if the selected midi device is not activated in the preferences you can savely switch the option off

The coding is (still) rather "hackish" and i suppose there will be bugs and inconveniences, please report!
Happy chording .. :)

bugs:
-crash on incoming midi when bypassed

Attached File  com.renoise.ScaleFinderOSC.xrnx   11.87KB   306 downloads

Edited by ReDread, 30 January 2012 - 10:24.

  • Djeroek, Suva, hotelsinus and 3 others like this

#2 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 21 January 2012 - 18:19

what a tool :w00t:

first feature request:) define your own chords, miss some ninths:)

Scalefinder makes new track left of master ,is that correct?
also, but I'm not 100% sure about it , sometimes it uses full velocity on MIDI input
got that, was user error:)

got error
std::logic_error: 'the master track can not be deleted.'
stack traceback:
[C]: in function 'delete_track_at'
.\midi_in.lua:137: in function 'fakeTrack'
main.lua:528: in function 'setBypass'
.\key_bindings.lua:133: in function 'switchMode'
main.lua:348: in function <main.lua:347>



next one
std::runtime_error: 'notifier feedback loop detected. do not change values you are listening to within your notifiers.'
stack traceback:
[C]: in function 'delete_track_at'
.\midi_in.lua:137: in function 'fakeTrack'
main.lua:528: in function 'setBypass'
main.lua:542: in function 'updateInstrument'
main.lua:613: in function <main.lua:613>

I'm not using loopback btw

maybe there is some way to attach this tool to a single track only even if I set MIDI input?

Edited by gmm04e, 21 January 2012 - 18:45.


#3 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 21 January 2012 - 18:42

Scalefinder makes new track left of master ,is that correct?


ScaleFinder uses a fake track and instrument to capture the original midi input (otherwise the triggering note would be recorded in addition to the chord and the scale filter wouldn't work).
Can you maybe specify when the error occured? how many tracks did you have at the time, or did you maybe delete the Scalefinder track?

EDIT: that means you have a midi input selected but no loopback setup? .. cause you're not supposed to do that, i should disable the midi in option when no loopback is active.

Edited by ReDread, 21 January 2012 - 18:47.


#4 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 21 January 2012 - 18:54

gmm04e, i will make the fakeTrack and Instrument optional and see if i can get the midi input work without a loopback .. but actually, the whole tool design is based on the midi loopback. i suggest you try it with loopMIDI, cause imho it's well worth the additional setup time!

#5 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 21 January 2012 - 18:55

Can you maybe specify when the error occured? how many tracks did you have at the time, or did you maybe delete the Scalefinder track?

Hard to say ,1-2 tracks and generally messing with it, didn't delete SF track.

that means you have a midi input selected but no loopback setup?

Yes, but I'll try this loopback device later.

also,can you read velocity from midi keyboard? For now it's working on full velocity I suppose.

Edited by gmm04e, 21 January 2012 - 18:56.


#6 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 21 January 2012 - 19:04

also,can you read velocity from midi keyboard? For now it's working on full velocity I suppose.

It will use the velocity if the loopback is enabled.

#7 vV

vV

    God's or Borg's Chief and Ruler of All Species

  • Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 16855 posts
  • Gender:Male
  • Location:Netherlands

Posted 21 January 2012 - 19:08

gmm04e, i will make the fakeTrack and Instrument optional and see if i can get the midi input work without a loopback ..


You can do so through OSC, but the OSC server should then be enabled.
Vv....


cpu Intel Core i7-4820K @3.70GHz
chipset Intel X79 chipset
mem 32 Gb 2400Mhz
os Win 7 64-bit SP1, DirectX 11
audio ESI ESP1010e - > Driver rev:2.0.6.0
video nVidia Geforce GTX780 - > Driver rev:335.23


Renoise Official Manual

#8 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 21 January 2012 - 19:22

Installed loopback ,it is working better now

but got this
std::runtime_error: 'notifier feedback loop detected. do not change values you are listening to within your notifiers.'
stack traceback:
[C]: in function 'delete_track_at'
.\midi_in.lua:137: in function 'fakeTrack'
main.lua:528: in function 'setBypass'
main.lua:542: in function 'updateInstrument'
main.lua:613: in function <main.lua:613>

IIRC, it was changing track with diffirent instr when this occured



also there is this unclear situation when you
-close tool,
-change instrument (sf track deleted)
,then you open tool again, but to make it work again you must cycle through 'scale\chord' button (to make sf track again).

#9 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 21 January 2012 - 19:57

also there is this unclear situation when you
-close tool,
-change instrument (sf track deleted)
,then you open tool again, but to make it work again you must cycle through 'scale\chord' button (to make sf track again).

yup, you're right there, fixed it in my current version.

i can't replicate the "notifier feedback loop" here, and it's a bit wierd cause it comes from a function that should just setup a notifier on instrument change. can you maybe provide more information on this, os, 32/64 bit, exact order of things you did before the error got thrown, if possible :o

#10 vV

vV

    God's or Borg's Chief and Ruler of All Species

  • Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 16855 posts
  • Gender:Male
  • Location:Netherlands

Posted 21 January 2012 - 22:21

yup, you're right there, fixed it in my current version.

i can't replicate the "notifier feedback loop" here, and it's a bit wierd cause it comes from a function that should just setup a notifier on instrument change.


Notifier feedback loop can often also be caused by changing a GUI control value that is changed from a function, but is called by the GUI function notifier as well as soon as the control is tweaked.
Simply check the controls if they aren't calling a function that is also changing the value of that very same control.(What is setByPass doing?)
Vv....


cpu Intel Core i7-4820K @3.70GHz
chipset Intel X79 chipset
mem 32 Gb 2400Mhz
os Win 7 64-bit SP1, DirectX 11
audio ESI ESP1010e - > Driver rev:2.0.6.0
video nVidia Geforce GTX780 - > Driver rev:335.23


Renoise Official Manual

#11 phuture

phuture

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 158 posts
  • Gender:Male

Posted 22 January 2012 - 13:43

really nice .. <3

#12 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 22 January 2012 - 15:58

gmm04e, i updated the tool, there's a *certain* chance that the error is fixed now, if not can you maybe try to switch off the "Use fake instrument & track" option, see if that changes anything and report back?

Simply check the controls if they aren't calling a function that is also changing the value of that very same control.(What is setByPass doing?)

vV, the updateInstrument() notifier calls setBypass() if the gui is not visible, which calls a function to delete the fake instrument, which would cause a feedback loop, i guess. but the function which deletes the fake instrument only works once, and will do nothing the next time it gets called .. i could imagine that the feedback error could get thrown when the deleting of the instrument fails, but in this case there should be an error before the notifier loopback i think.

#13 vV

vV

    God's or Borg's Chief and Ruler of All Species

  • Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 16855 posts
  • Gender:Male
  • Location:Netherlands

Posted 22 January 2012 - 22:26

vV, the updateInstrument() notifier calls setBypass() if the gui is not visible, which calls a function to delete the fake instrument, which would cause a feedback loop, i guess. but the function which deletes the fake instrument only works once, and will do nothing the next time it gets called .. i could imagine that the feedback error could get thrown when the deleting of the instrument fails, but in this case there should be an error before the notifier loopback i think.

The error doesn't fire without reason, if the routine works only once, better remove the notifier when the routine has been called, in that case you know for sure it cannot be called a second time. If it is needed once more, then set the notifier again when appropriate.
Vv....


cpu Intel Core i7-4820K @3.70GHz
chipset Intel X79 chipset
mem 32 Gb 2400Mhz
os Win 7 64-bit SP1, DirectX 11
audio ESI ESP1010e - > Driver rev:2.0.6.0
video nVidia Geforce GTX780 - > Driver rev:335.23


Renoise Official Manual

#14 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 23 January 2012 - 15:53

Working really great, now:)
No script errors, only sometimes hanging notes when playing and at the same time changing chords or inversions (fake track disabled)
The blinking chord name then remains highlighted.

#15 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 24 January 2012 - 19:49

*updated to use OSC instead of a midi loopback*
thx vV and danoise for the idea :)
  • danoise, Suva and gmm04e like this

#16 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 25 January 2012 - 11:46

There is something wrong with 'use fake instrument & track' option


Play same note to hear chord and change periodically this option. The chord with checked and unchecked option doesn't sound the same.

also

In the pattern editor press ESC and record note. First note of the chord landed in first column, then second column is empty, and second note of the chord landed in third column and third note in fourth column.

#17 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 25 January 2012 - 15:01

In the pattern editor press ESC and record note. First note of the chord landed in first column, then second column is empty, and second note of the chord landed in third column and third note in fourth column.

This happens when the fake instrument/track option is turned off, right?
It looks like renoise (or OSC) has some kind of input filter for OSC/MIDI messages, that will detect identical, "doubled" notes and delete them, but doesn't delete the note column for the deleted note.
The doubled note is the one that comes in from the midi controller/keyboard. It would be possible to just "add" the chord to the played note from the controller, but that would make inversions (root note is transposed) impossible. As far as i can see there is nothing i can do against it.
The problem won't arise if you leave the "use fake track/instrument" option on tho (is default)!
For the different sound of chords:
"no fake track" enters: C4, [], D#4, G4 for example
"with fake track" overites: C4, D#4, G4
so that makes C4, D#4, D#4, G4 after switch, which might explain the slightly different sound.

Thanks for testing!

Edited by ReDread, 25 January 2012 - 15:03.


#18 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 25 January 2012 - 20:19

So maybe, in the light of those issues remove this option completely? Unless you can fix this.

#19 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 27 January 2012 - 23:58

-load vsti
-load scalefinder
-press [x] on scalefinder
-change instrument (fake track disapear)
-play some notes

to got this

.\midi_in.lua:88: variable 'midi_device' is not declared
stack traceback:
[C]: in function '_error'
[string "local mt = getmetatable(_G)..."]:29: in function <[string "local mt = getmetatable(_G)..."]:24>
.\midi_in.lua:88: in function <.\midi_in.lua:29>

#20 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 28 January 2012 - 19:03

.\midi_in.lua:88: variable 'midi_device' is not declared

thx, should be fixed by now.

#21 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 28 January 2012 - 23:05

Found another quirk:)

Shortcut for Initiate/Switch Mode stopped working after I changed scale on GUI.

#22 re.dread

re.dread

    Advanced Member

  • Normal Members
  • PipPipPip
  • 97 posts

Posted 30 January 2012 - 10:18

Shortcut for Initiate/Switch Mode stopped working after I changed scale on GUI.

Are you sure you did remap it after reinstalling the tool, all keybindings and midi mappings will have to be remapped after a tool update.
If not, moa information again please, cause switch mode key-binding is working fine for me here!

#23 gmm04e

gmm04e

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 186 posts
  • Gender:Male

Posted 30 January 2012 - 11:33

press shortcut once - shows SF in Chord Mode
press shortcut again - Scale Mode
again - bypass, tool dissapear.
ok
now
press shortcut again - shows SF in Chord Mode
change major to minor natural or whatever
press shortcut again - scale mode
press shortcut again - nothing happens, tool still here

#24 Ozego

Ozego

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 196 posts
  • Gender:Male
  • Location:Bangkok
  • Interests:Hip Hop, Dub, Rare Grooves, Library Music

Posted 05 February 2012 - 13:50

I have navigation issues while in OSC mode.
It seems that I am only able to navigate within the pattern while I am using the chord finder if I "initate" it by hitting a single note first, after that it works perfectly. It just took me forever to figure out how to "initiate" navigation while using the tool.

Great job though, both you and Suva, now renoise is easier to strum chords with than a ukulele. I can even play Django style gypsy jazz with this thing, I love it.

e// One suggestion too, maybe it could be made follow the octave specified so transposing won't be necessary.

Edited by Gooze, 05 February 2012 - 13:53.


#25 2 daze j

2 daze j

    Guruh Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 805 posts
  • Gender:Male
  • Interests:Ghosts, aliens, space, the afterlife, music, high energy music..

Posted 26 May 2012 - 00:39

Guys... Out of nowhere, I'm totally getting a crash with this babe of a tool... It sucks, cause I love.. erm, LOVE this thing.. I've uploaded a picture

https://www.box.com/...736073414214ae8

Help! SOS! Big time. I don't know what I did.. everything was working great until today.. Now it seems if I dial in a chord from column one, I get that message.. --windows 7 home prem..

:guitar:

Edited by 2 daze j, 26 May 2012 - 00:41.

I woke up with my mind on the floor...