|
Post by tomlj on Sept 27, 2018 11:05:58 GMT
Hello, so I've read the Midifire manual, done some learning up about hexidecimal and binary. The main thing I want to achieve with Midifire is to essentially replicate the scenes and crossfading between scenes on the Elektron Octatrack Here;s what those functions are. Any parameter on the OT can be locked to a scene. There are 16 scenes available on slot A and 16 scenes on Slot B. The crossfader glides between (portamento I presume?) the scenes loaded in the two slots.
The crossfader transmits its value on CC 48,
CC's 55 and 56 transmit values 0-15 when scenes are selected for Scene slots a and b respectively.
I want to create a midi processor that will store 32 states of lets say 12 parameters on arious iOS apps and to be able to switch between these states using CCs 55 and 56 and glide between the states using the OT crossfader on CC 48. I want to have a go at figuring this out myself, but I'd really appreciate some directions, advice on what to concentrate on and perhaps some suggestions of Midifire scenes in the Sandbox which would be applicable to the pocessor I want to set up. Thanks!
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 27, 2018 15:05:37 GMT
Hi tomlj, Hmm, that might be somewhat tricky for a starting project, but where there is a will... Since you have so much data I suggest breaking down the problem and laying out the MidiFire canvas so that there is one Stream Byter per app+parameter combination. You would then connect the Octatrack to each Stream Byter in parallel and each StreamByter to the relevant app. In each Stream Byter module, set the block name to the name of the app + parameter so you know what is what. eg: 'Animoog Reso'. Now, let's assume that CC16 on channel 1 controls Animoog's Resonance value, and setup the 2 x 16 parameter values for A and B inside an IF LOAD: IF LOAD # K0 = param type/channel # K1 = number ASS K0 = B0 0A # CC16 channel 1
# CC values # L00-0F = scene 0 to 15 A ASS L00 = 00 00 00 00 10 10 10 10 30 30 30 30 7F 7F 7F 7F ASS L10 = 7F 60 50 40 20 30 40 60 00 10 30 40 60 40 20 00
# internal variables # L80 = current 'A' scene number (preserved) # L81 = current 'B' scene number+16 (preserved) # L82 = current xfade value (preserved) ASS L80 = 0 10 40 +P ENDSo, we are storing the CC values for A in array L0 to LF (scene 0 to 15) and the CC values for B in array L10 to L1F (scene 0 to 15). That's the static data that defines the various A and B values for each scene and also the MIDI message which will be used to send the parameters. Internally, we will use array variable L80 and L81 to decide which scene is currently selected for A and B. And L82 will retain the current value of the xfade setting. So, on to the logic part. Let's write the code that handles the A and B scene selection CCs coming in (I have assumed they come in on channel 1): # handle scene select CCs IF M0 == B0 37 ASS L80 = M2 END IF M0 == B0 38 MAT L81 = M2 + 10
# when scene B is selected, # rewrite this event to a # 'fake' xfade event to init # the values (see comments) ASS M0 = B0 30 L82 ENDNow, the scene number for A will always be retained in variable L80 and the scene number for B (but indexed) will be retained inside variable L81 Next, we handle the crossfade CC (48, hex 30) which I am going to assume is also on channel 0: # handle xfade CC IF M0 == B0 30 # NB. our A value is available in LL80 # and our B value is available in LL81
# determine the xfade direction into I0 # 0 = up, 1 = down and the A/B range into I1 ASS I0 = 0 MAT I1 = LL81 - LL80 IF LL80 > LL81 ASS I0 = 1 MAT I1 = LL80 - LL81 END # scale the parameter value in A/B range # according to xfade position into I1 MAT I1 = M2 * I1 MAT I1 = I1 / 7F IF I0 == 0 MAT I1 = I1 + LL80 END IF I0 == 1 MAT I1 = LL80 - I1 END
# send the parameter SND K0 K1 I1
# retain new xfade value in L82 ASS L82 = M2 ENDI have set this up, so that when you select a new 'B' scene, it uses the current position of the cross fader to initialise the parameter to match the (new) B and A. Finally, a disclaimer - I have not tested any of this for syntax/logic errors; I just typed out my thoughts - the up/down scaling is especially tricky. Hopefully this will get you going. My advice is to start with just controlling one app+parameter combination and once that works, you can replicate that module (save to scene and merge) for all the other app+param combos and just change the title and stuff at the top. Regards, Nic.
|
|
|
Post by tomlj on Sept 28, 2018 8:34:55 GMT
Hi Nic, thank you so much. Your explanation is crystal clear. Now I have to digest the technicalities and familiarize myself with the language and decimal hex conversion!
|
|
|
Post by tomlj on Oct 1, 2018 13:30:14 GMT
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 1, 2018 14:48:17 GMT
Hi tomlj, Just change everything back to what it was except the very first change (ASS K0 = B8). That will make the CC71 go out on channel 9, and take into account that the octatrack itself is still operting on channel 1. Regards, Nic.
|
|
|
Post by tomlj on Oct 2, 2018 10:46:59 GMT
Hi Nic, I recopied the code you originally posted into SB and only changed the one byte as you said. However, I made a mistake in my description of the OT. In fact it has 16 scenes or variations, not 32, (per preset or "part" on the OT), any one of which can be loaded into either scene slot A and Scene Slot B. Otherwise the cc's for xfader, scene selection and their values I noted in my 1st post are correct.
With the code you wrote I noted the following in the event monitor: Upon selecting Scene A (OT transmits CC55 values 0-15) SB outputs only CC55 on CH1 (thrus input only) Upon selecting Scene B (OT transmits CC56 values 0-15) SB outpits CC 48 (not 56) on CH1 + CC71 on CH9 Xfader movement SB thrus original CC48 on CH1 + CC71 on CC9
Despite CB outputting CC71 values, the iOS app patameter mapped to CC71 is not responding. It does however respond to CC71 transmitted from a knob on the OT and passed through the above SB scene with Midifire as the only connection between soundcard Midi port IN and AUM.
I really appreciate your support with this! If this can work, I'll go about making multple configurations for various apps and share them. I'm sure quite a few OT users would take interest once its demonstrated to work. Implementation of scenes for the 8 Midi tracks on the OT is pretty much top of the list of feature requests on the OT forum, but it's 99% sure Elektron won't do this.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 3, 2018 10:15:24 GMT
Hi tomlj , OK, well we can leave the code that has 16 values for A and B in any case. If you want to emulate the OT behaviour, then you can make both preset lines identical. I just loaded up the code into MidiFire myself and remapped my own controller to the OT CCs and everything is working fine, but I had to add this at the end: XX = XX +BWithout it you will be seeing both the generated CC as well as the original OT CCs which might be what is causing undue hassle! Also, to aid with my debugging I added two lines (marked in red) to show the A and B values in the block labels: # handle scene select CCs IF M0 == B0 37 ASS L80 = M2 SET LB0 LL80 +D END IF M0 == B0 38 MAT L81 = M2 + 10 SET LB1 LL81 +D
# when scene B is selected, # rewrite this event to a # 'fake' xfade event to init # the values (see comments) ASS M0 = B0 30 L82 ENDI now see only the generated (and correct) CC scaled between the A/B values when I move my (remapped) cross fade control. > Despite CB outputting CC71 values, the iOS app patameter mapped to CC71 is not responding. It does however respond to CC71 transmitted from a knob on the OT and passed through the above SB scene with Midifire as the only connection between soundcard Midi port IN and AUM. I reckon this is because since we know the OT is transmitting on channel 1, the app is seeing CC71/CH1 when you turn the knob on the OT. The module is sending CC71/CH9 and maybe the receiving app is configured for channel 1? Regards, Nic.
|
|
|
Post by tomlj on Oct 4, 2018 9:58:23 GMT
Hi Nic. Bingo. This is magic Thank you soooo much! I previously had the app to receive on CH9, I think the prob was I had the app set to receive Midifire, not AUM dest. Can't believe my OT can now do midi scenes! This is way more powerful than anything else I've looked into. Many thanls again.
NB: Scene A is not outputting values upon scene select, while Scene B outputs 16 values. I have the same values set for A and B.
NBB: With me at least, the script is now filtering out note, clock and p-locked cc values and only outputting the processed scene and xfade cc values. OT is sending on CH 9. AU App in AUM set to CH9, I can solve this with a channel strip in parallel, but how to do this in your script? It would be more compact to include this in the main bloc.
NBBB: I see the currently selected CC values for scenes A and B are displayed respectively in the SB bloc's left and right displays - that's super useful!
|
|
|
Post by tomlj on Oct 11, 2018 10:20:30 GMT
Hi Nic, Excuse my persistence and thanks again for this great script. I've tried entering both the same and different cc values for Scenes A+B. I haven't changed anything in the code!
The only snag is that when Scene A is selected, holding down Scene A button and swithching between the 16 slots / variations (with X-fader to the left), the corresponding cc values are not transmitted (verified in Event Monitor) despite showing in the SB left display. With Scene B this works a treat and the xfader transitions to the value of the slot/variation selected in Scene A as long as the selection of slot/variation for Scene A is made with the crossfader to the right! Could you please, please look into this? Best, Tom
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Oct 11, 2018 10:55:27 GMT
Hi tomlj , Yes, I did it that way on purpose, thinking it would be more useful to init the values only when you select the 'B' scene. To make it do the same on the 'A' scene, consider this (modified) part of the code: # handle scene select CCs IF M0 == B0 37 ASS L80 = M2 ASS M0 = B0 30 L82 END IF M0 == B0 38 MAT L81 = M2 + 10
# when scene B is selected, # rewrite this event to a # 'fake' xfade event to init # the values (see comments) ASS M0 = B0 30 L82 ENDI have added in one extra line in red. Put that into your copy and it will init on A also. Regards, Nic.
|
|