-
Notifications
You must be signed in to change notification settings - Fork 70
Description
Hi! I'm experiencing issues while installing the Euterpea Haskell package on my macOS Sonoma 14.5 system with GHC 9.4.8 and Cabal 3.10.3.0.
The initial issue is a compilation error in the PortMidi 0.2.0.0 package, specifically in the portmidi/pm_mac/pmmacosxcm.c:60:22 file. The error is:
error: incompatible pointer to integer conversion initializing 'MIDIClientRef' (aka 'unsigned int') with an expression of type 'void *' [-Wint-conversion]
To resolve this, I followed the instructions in the PortMidi (https://github.com/PortMidi/portmidi/blob/8efac0cfe6c245aeb2ce5122aa2b82fb79e91463/pm_mac/pmmacosxcm.c#L187), downloaded the PortMidi-Haskell package, and added #define NULL 0 to the portmidi/pm_mac/pmmacosxcm.c file. After doing this, I was able to successfully install the PortMidi-Haskell and Euterpea using cabal v1-install.
However, when I try to import the Euterpea package in GHCi, I encounter a different issue:
λ> import Euterpea
<interactive>:1:1: error:
attempting to use module ‘main:Euterpea’ (./Euterpea.lhs) which is not loaded
λ> :l Euterpea.lhs
[ 1 of 18] Compiling Control.Arrow.ArrowP ( Control/Arrow/ArrowP.lhs, interpreted )
[ 2 of 18] Compiling Control.SF.SF ( Control/SF/SF.lhs, interpreted )
[ 3 of 18] Compiling Euterpea.IO.Audio.Types ( Euterpea/IO/Audio/Types.hs, interpreted )
[ 4 of 18] Compiling Euterpea.IO.Audio.IO ( Euterpea/IO/Audio/IO.hs, interpreted )
[ 5 of 18] Compiling Euterpea.IO.MIDI.ExportMidiFile ( Euterpea/IO/MIDI/ExportMidiFile.lhs, interpreted )
[ 6 of 18] Compiling Euterpea.IO.MIDI.MidiIO ( Euterpea/IO/MIDI/MidiIO.lhs, interpreted )
Euterpea/IO/MIDI/MidiIO.lhs:327:5: error:
parse error (possibly incorrect indentation or mismatched brackets)
|
327 | > case m of
| ^
[ 7 of 18] Compiling Euterpea.Music ( Euterpea/Music.lhs, interpreted )
[ 8 of 18] Compiling Euterpea.IO.MIDI.MEvent ( Euterpea/IO/MIDI/MEvent.lhs, interpreted )
[ 9 of 18] Compiling Euterpea.IO.MIDI.GeneralMidi ( Euterpea/IO/MIDI/GeneralMidi.hs, interpreted )
[14 of 18] Compiling Euterpea.IO.Audio.Basics ( Euterpea/IO/Audio/Basics.hs, interpreted )
[15 of 18] Compiling Euterpea.IO.Audio.Render ( Euterpea/IO/Audio/Render.hs, interpreted )
[16 of 18] Compiling Euterpea.IO.Audio.BasicSigFuns ( Euterpea/IO/Audio/BasicSigFuns.lhs, interpreted )
[17 of 18] Compiling Euterpea.IO.Audio ( Euterpea/IO/Audio.hs, interpreted )
Failed, 12 modules loaded.
> deliverMidiEvent :: OutputDeviceID -> MidiEvent -> IO ()
> deliverMidiEvent devId (t,m) = do
> (pChan, out, _stop) <- getOutDev devId
> now <- getTimeNow
> let deliver t m = do
> if t == 0
> then out (now,m)
> else push pChan (now+t) m
>
> case m of
> Std m -> deliver t m
> ANote c k v d -> do
> deliver t (NoteOn c k v)
> deliver (t+d) (NoteOff c k v)I'm new to Haskell and I found this parse error in the Euterpea/IO/MIDI/MidiIO.lhs file really confusing. Any advice or suggestions would be greatly appreciated.