capellan wrote: ↑Wed Feb 10, 2021 4:31 am
Hi Paul,
Many Thanks for creating all Midi utilities!
Do you have a step by step tutorial for the
install order and configuring on Mac?
Al
My pleasure! Installing LCB extensions is done with the extension builder in the tools menu of the LC IDE, same as any other LiveCode Builder project. There are tutorials from the mothership so I won't try to reinvent the wheel here. Once Installed in the IDE, most of my LCB is documented and should show up in the Dictionary.
There are several different libraries, depending on what you want to do, note that I have done basically zero testing on iOS, but I have tested these on macOS v10.10.x,10.12.x, and 10.14.x:
By far, the easiest to use on macOS is AVMIDIPlayer
https://github.com/PaulMcClernan/LCB_AppleAVMidiPlayer which is very simple API that basically takes a path to a MIDI file and a path to a soundFont or DLS sound bank (there's one included with macOS, buried deep inside the CoreAudio.framework bundle, which I use as the default sound bank), and then plays the music. This should also work on iOS but iOS does not provide any DLS SoundBank so you would have to include one with your iOS standalone build (there's lots of free SoundFonts to use on the web, I've found some some full GM sound sets as small as 2MB).
If you want to do realtime triggering of notes using SoundFonts or DLS on macOS/iOS you would use the AVAudioSampler:
https://github.com/PaulMcClernan/LCB_Ap ... dioSampler. With this you load a SoundFont (passing a Path) into memory and then you can send it commands such as noteOn/noteOff along with parameters for note pitch number (1-127), velocity (translates to loudness 1-127), you can also send it other MIDI commands, pitchbend, modulation, etc. Apple's sampler can also load arbitrary sound files (which if you name them with a note name like "C4.aif" or "60.wav" would be assigned to note# 60/middle-C), and Apple Sampler .aupreset files (which is basically XML). This is a single channel virtual instrument (mono-trimble) so you can only use one sample-sound-set at a time.
If you want to get adventurous about realtime software instruments on Mac/iOS there's AppleAudioUnitMIDIInstrument, very much a crash-prone work in progress:
https://github.com/PaulMcClernan/LCB_Ap ... Instrument This one can (at least try to) load ANY AudioUnit Software Instrument, including Apple's AUSampler, AppleDLSSynth (similar to the Sampler, but multichannel), Native Instruments like Kontakt (pretty much instant crash), and lots of synthesizer plugins like Yamaha DX7 emulations and such found on the internet. This is a bit more complicated to use, and I wrote an associated LCB wrapper library that goes along with it called AVAudioUnitComponentManager
https://github.com/PaulMcClernan/LCB_AV ... entManager that is helpful for getting the information needed to load various AU Effects Plug-ins / Instruments you have installed in your system (again, there are some that come with Apple's OSes).
If you want to send (and receive, although that is a bit crash-prone) MIDI Data to / from other Applications (such as GarageBand or Logic Pro) or External MIDI hardware (Keyboard, Drum Machine, etc) you would use my CoreMIDI library
https://github.com/PaulMcClernan/LCB_CoreMIDI. This produces no sound on it's own. It's purely for using MIDI data on macOS / iOS. CoreMIDI is the oldest MIDI API on macOS/iOS (OSX 10.0/iOS4).
If you want something cross-platform music capabilities, I've recently been working on a wrapper for FluidSynth:
https://github.com/PaulMcClernan/lcb_fluidSynth. I've tested this on macOS and Windows 10, but includes the library binaries for Linux and Android as well (making the whole thing rather large). This can do playback of MIDI files via SoundFonts/DLS soundbanks, as well as RealTime triggering of notes/MIDI parameters. It includes two built-in effects (reverb & chorus) and can render MIDI files to flat sound file format (such as .wav). It can also receive incoming MIDI data, although like the CoreMIDI-In, this is also crash prone (which I'm pretty sure is due to threading issues with the engine), it's not quite as crash-prone as the lcb_CoreMIDI-lib's MIDI-in, which is strange because I'm sure it taps into CoreMIDI when running on macOS.
Lastly there's a library called GMIDI
https://github.com/PaulMcClernan/LCB_GMIDILib which is just a collection of functions useful for working with General MIDI (GM) / General Standard (Roland GS), such as getting a list of Standard GM Sound Names, or translating Note Numbers to Names (examp. 61 = "C#4/Db4") or Drum Note Names (36 = "Bass Drum 1"), that sort of thing. Also useful is the GUI element Piano Widget:
https://github.com/PaulMcClernan/LCB_PianoWidget which sends noteOn/noteOff messages to the engine which you can then pass to the associated commands in some of these other libraries above and it can do some other tricks too.