crimsonnoise Posted February 21, 2019 Share Posted February 21, 2019 I'd like to have a second, independent click / metronome that doesn't respond to the click on/off global command but that's always playing. This is for sending to another output while printing stems. If I chain up another Metronome object to another Klopfgeist it always turns on/off with the global command. Would a solution be a simple Midi FX Script? I had a look at the Sequencer Scripter preset, but that seems to only play when it receives midi, and also only gives 1/4, 1/8 options, and doesn't automatically switch to 3/8 like the metronome does in 6/8 time signature for example. I'd like it to behave like the metronome, with bar and group clicks. Any suggestions would be hugely appreciated! (Logic 10.4.4) Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted February 21, 2019 Share Posted February 21, 2019 Two ideas come to mind, you could either program it on its own software instrument track, or you could use Ultrabeat's step sequencer. Quote Link to comment Share on other sites More sharing options...
crimsonnoise Posted February 21, 2019 Author Share Posted February 21, 2019 Great, but how would I get it to change automatically from 1/4 note click to a dotted 1/4 note click when changing to 6/8 time signature for example? Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted February 21, 2019 Share Posted February 21, 2019 Great, but how would I get it to change automatically from 1/4 note click to a dotted 1/4 note click when changing to 6/8 time signature for example? That would be tricky. I would just program the custom metronome onto its own track. Quote Link to comment Share on other sites More sharing options...
crimsonnoise Posted February 21, 2019 Author Share Posted February 21, 2019 That would work of course, but I'd like to make a kind of set and forget template where that independent click always automatically follows the time signatures, without having to program all time signature changes. Would a MidiFxScript work? Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted February 21, 2019 Share Posted February 21, 2019 I'd like to make a kind of set and forget template where that independent click always automatically follows the time signatures, without having to program all time signature changes. Would a MidiFxScript work? I'm not well versed in MIDI FX scripting so I'm afraid I can't help you there. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 21, 2019 Share Posted February 21, 2019 Yes it could be done with scripter. May not be trivial to deal with Meter changes though But if you only need it off for stems why not just change the audio routing of the metronome channel while making stems and leave metronome on all the time? Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 21, 2019 Share Posted February 21, 2019 If you are ok with one click per beat, regardless of the meter then it might not be too complicated in scripter. I’ll have a look later Quote Link to comment Share on other sites More sharing options...
crimsonnoise Posted February 21, 2019 Author Share Posted February 21, 2019 Oh thanks. I could also put a simple midi loop on the timeline, but again that would change with the meter. Do you think a script can l'listen' to the time signature? Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 21, 2019 Share Posted February 21, 2019 (edited) yes it can. here is a simple example that is just matching a midi note to whatever the built in metronome does, including meter changes. This script automatically detects the meter changes, you don't really need to do anything special, but its based simply on every time the beatPosition goes up to the next integer. (side note, internally LPX tracks beat as a fractional number and every time it passes x.0, then you can consider you're on a new "beat" according to what Logic thinks a beat is internally). This simple script seems to mirror the built in metronome no matter the meter changes... code deleted If you need the click track to be more complicated, and/or handle different meters with different notion of what a beat is, then you will have to add more code as desired... I notice that for example a 6/8 meter ends up sending the click on the 8th notes...not on the two 6/8 beats, for example. So what Logic internally thinks of as a "beat" is not what I would consider the musical description of a "beat". here is some more code added to show how to detect when the meter has changed, but you will need to add your own code and get more complicated to take that information and adjust how the click is played back. code deleted Edited February 25, 2019 by Dewdman42 Quote Link to comment Share on other sites More sharing options...
crimsonnoise Posted February 22, 2019 Author Share Posted February 22, 2019 Fab, that's genius, thanks! It works. On my system it stumbles for one beat at start of playback and at meter changes. Does it play smoothly at your end? Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 22, 2019 Share Posted February 22, 2019 Plays fine here. Do you have a lot of plugin latency. Make sure to enable pre roll maybe? Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 22, 2019 Share Posted February 22, 2019 Could be you need a bigger audio buffer too. Away from computer today but will try to think about why that might be Quote Link to comment Share on other sites More sharing options...
fuzzfilth Posted February 22, 2019 Share Posted February 22, 2019 A completely different approach would be to keep the click and thus Klopfgeist activated at all time, route Klopfgeist over a bus to two Auxes, one to Stereo Out and the other to whatever output you need. Then utilize any vacant MIDI message from your controller (unused MIDI note, Panel Switch, Drum Pad, Footswitch, etc.) and convert it in the Environment to a mute toggle acting on only that first Aux. This would replicate the old Click on/off functionality (albeit with a hardware key instead of a key command) and keep the click running on that other output. With slightly more effort you could tell an external key utility (Keyboard Maestro or even Automator w/Applescript) to send that MIDI command from the actual ASCII key that originally controlled Click on/off to make it completely seamless. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 22, 2019 Share Posted February 22, 2019 Fab, that's genius, thanks! It works. On my system it stumbles for one beat at start of playback and at meter changes. Does it play smoothly at your end? I think I know what the script needs to fix that issue, I will try to correct that for you sometime today. As much fun as it is to play around with Scripter, I tend to agree with Fuzzfilth here though, I think you can solve your issue with audio routing from the built in metronome, keep it out of the stems when you bounce and still hear it in another place. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 22, 2019 Share Posted February 22, 2019 (edited) Try this: (code deleted due to bugs in Scripter) Edited February 25, 2019 by Dewdman42 Quote Link to comment Share on other sites More sharing options...
crimsonnoise Posted February 22, 2019 Author Share Posted February 22, 2019 Cool stuff. New script doesn't quite solve the issue, on my system at least, still a strange, but different, blip when changing from 4/4 to 6/8 for example, then when changing back to 4/4 it disappears altogether. But it's fascinating what can be done with these scripts! Where did you learn that Dewdman? Fuzzfilth - great idea. I'll see if there is a way to get it to unmute that channel automatically when in record, and mute again during playback. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 22, 2019 Share Posted February 22, 2019 Later tonight I will try to fix the script. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 23, 2019 Share Posted February 23, 2019 Alright looked at it some more. Its doable, but while I was hoping I could do something in a simple script, the truth is that its not that simple and I've spent too much time on it already...so...sorry...forget the above script... It would need to be a rather sophisticated script...especially to take into consideration cycle looping, meter changes, starting partway in the sequence, etc. There yet might be an elegant simple script solution, but I didn't figure that out yet and I don't want to spend any more time on it.. This much I can say, its probably a rather complicated script and you probably won't figure that out. I have a few more ideas about it, and after the weekend I might get a little time to experiment some more. I recommend you go with Fuzzfilth's suggestion to re-route the metronome output to avoid bouncing it to stems. There are also some 3rd party VST metronomes out there, that would probably work for you, but then you have to mess with running a VST on Logic..another topic...but google that for another possible solution. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 25, 2019 Share Posted February 25, 2019 Looking into scripter solution a bit more, I think I may have discovered bugs in scripter. The detected beat position number is jumping all over the place when there are meter changes. In my view that makes scripter entirely unusable for anything involving scheduling of midi events based on beat position, if there are any meter changes. I have filed a bug report to Apple. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted February 25, 2019 Share Posted February 25, 2019 Definitely there is some weirdness going on with Scripter and beat position when there are meter changes... Well I've filed a bug already. If they ever fix that bug, then this is the most simple script I could think of and I don't see any reason why it wouldn't work, but for now, it won't work due to the Scripter bugs. In the meantime, just route the audio output from Klopfgeist in order to bounce without metronome. var NeedsTimingInfo = true; var clickVelocity = 127; var clickChannel = 1; var clickPitch = 90; var clickDuration = 0.03125; // 1/32 duration function ProcessMIDI() { var info = GetTimingInfo(); if(!info.playing) { return; } var intStart = Math.trunc(info.blockStartBeat); var intEnd = Math.trunc(info.blockEndBeat); if(intStart == info.blockStartBeat) { playClick(intStart); return; } if(intStart != intEnd) { playClick(intEnd); return; } } var click = new NoteOn; click.channel = clickChannel; click.velocity = clickVelocity; click.pitch = clickPitch; function playClick(beat) { click.velocity = clickVelocity; click.sendAtBeat(beat); click.velocity = 0; click.sendAtBeat(beat + clickDuration); } Quote Link to comment Share on other sites More sharing options...
crimsonnoise Posted February 26, 2019 Author Share Posted February 26, 2019 Thanks so much for looking into it! It's enlightening to get some insight into scripting. I hope Apple will fix the bug. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.