Jump to content

Musings in the Logic Environment


Neil Parfitt

Recommended Posts

Hi All!

 

This is probably a total nerdorama post - but felt it was worth sharing.

 

This is the most complex environment I've designed to date and solved a huge number of hurdles to make it work.

 

Feb1.jpg.17122f62461cd5ebc8e0efa4c1d24b84.jpg

 

Basically it's a realtime MIDI guitar re-tuner with some added goodies:

 

-128 slot preset memory

-learn notes via MIDI controller keyswitch

-learn notes via sequential note entry

-preview the built chord as you go

-advance the preset position via sustain pedal tap for to record in a part from start to finish

-offline crunching of the preset data for inserting a preset or deleting a preset and sliding over the data accordingly

 

THE CHALLENGES:

 

1) fully interactive GUI that *behaves* like a real computer interface.

 

-Flip flop button behaviour. 2 buttons in a group, only one can be active at a given time. Clicking the other button disables the other button. If you repeatably click the same button, the modes still flip.

 

-Nested Flip Flop button behaviour. Same as above, but the inner 'child' buttons only work if the master 'Parent' switch is enabled. This also updates status displays accordingly. "Tri-state'.

 

-auto-updating status displays / select buttons etc.

 

-Buttons as *fully disabled* when not involved in a current mode. This means the on/off doesn't work, and no midi from that button goes anywhere.

 

2) Preset Memory

 

-128 memory positions for each strings. Read/write using maps.

-up / down ping system to increase/decrease current position with a single button press (no on/off button required).

 

3) Learn modes for above:

 

-Ability to learn notes via selecting strings via a keyswitch and writing to the memory system accordingly

-Ability to learn notes by press 6 notes on a MIDI keyboard and writing to the memory system sequentially

-Ability to preview the chord being built as you enter each note

 

4) Re-tuning

 

-taking incoming MIDI guitar data, re-mapping to notes read from Map Memory

-tracking additional frets pressed on the controller and applying this to the read note memory. IE: If the E string is tuned to a C, and you press the first fret, it'll tune that note to a C#.

 

5) Offline processing

 

-Insert and Delete presets. Sounds simple right? However, as the environment is a real-time system...

 

I had to design a pseudo computer to execute an exact number processing operations to crunch the preset data like code. This involved many of the bits from #2. The processor involves a controlled feedback delay line that creates a steady pulse. That pulse drives a 128 step counter circuit that continuously rolls over (Variable X). Upon roll over, it increases a nested counter (variable Y). With this in mind, there's 128 steps of processing per operation. So, to insert and delete data, each processor stage is fed from a switcher controlled by Y.

 

Step 1: Disconnect memory system from real-time processor and disable MIDI out of Macro.

Step 2: Copy all preset data to temporary 'clipboard' memory maps

Step 3: Read from Presets and Slide data from current preset position +/- depending on insert/delete.

Step 4: Zero out preset position+1 if insert (creates the blank gap).

Step 5: Copy Data from Clipboard and overwrite Preset memory

Step 6: Reconnect memory system from processor and re-enable MIDI out of Macro

 

In BASIC it would sort of look like below - but remember, there's no code in the environment to pull off these array number crunch operations. There is a way to go the whole thing in an single 128 step process, but it was proving un-reliable as MIDI would sometimes get lost on a cable switchover.

 

ON INSERT BUTTON PRESS:

FOR Y = 0 to 3 'Y is reprsented by the Process Position switch.

 

IF Y = 0 THEN 'COPY MAP PRESET DATA TO CLIPBOARDMEMORY (dark green wires)

FOR X = 0 to 127

CLIPBOARDMEMORYP (X) = PRESETMEMORY (X)

NEXT X

ELSE IF Y = 1 THEN 'SLIDE DATA UP ONE ARRAY POSITION AFTER CURRENT PRESET POSITION (orange wires)

FOR X = (CURRENTPRESETNUMBER + 1) to 127

CLIPBOARDMEMORY(X) = PRESETMEMORY (X-1)

NEXT

'INITIALIZE 'the gap'

PRESETMEMORY(CURRENTPRESETNUMBER + 1) = 0

ELSE IF Y = 2 THEN ' COPY CLIPBOARD DATA BACK TO PRESET MEMORY (blue wires)

FOR X = 0 to 127

PRESETMEMORY (X) = CLIPBOARDMEMORY (X)

NEXT X

ELSE IF Y = 3 THEN 'ALL DONE

STOP PLAYBACK: END PROCESS

END IF

NEXT Y

TURN OFF INSERT BUTTON: RESET INTERNAL SWITCHES: RETURN ALL POINTERS TO 0 (red wires)

 

The catch? For this insert/delete process, Logic must be in playback. It's not too bad though, as the entire process takes a split second and a 'stop playback meta' is triggered when it's complete. I WISH there was a start playback meta :(

 

This is the full guts of the entire macro:

 

10931617_10155127987720007_5694621885086500531_o.thumb.jpg.7fa74abbf317646bd4d1c2f863a210b5.jpg

The guts of the full macro

 

I have since added the delete functionality.

 

Anyway - there you have it!

 

Here's a video from mid-January of it in action before I added the offline processing: (the vid cuts off at the end - but it took about 14 hours to figure out the main system, and another 8 for the offline number cruncher.

 

http://www.neilparfitt.com/neilsguitarthingy.mp4

 

And here is a video showing the offline processor working:

 

http://www.neilparfitt.com/neilsguitarprocessorjan28insert.mp4

 

 

I really hope this spawns some ideas with controlled calculations - the sky's the limit! I'm tempted to try and code pong using 2 vertical faders for the paddles, and the X/Y vector pad as the 'ball'!! :D Anyone?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...