meniere
0.0.7About meniere
Collection of incudine dsps and helpers. Depends on CM.
cm.lisp
Common Music helpers that provide constructors for patterns that mimic the (make-*)
that Common Music 3 has.
> (next (make-cycle '(c d e)) 6)
(C D E C D E)
> (next (make-weighting '(c (d .1))) 6)
(C C C C D C)
> (next (make-line '(1 2 3 4)) 6)
(1 2 3 4 4 4)
> (next (make-graph `((c 3) (g 3) (e ,(make-cycle '(1 2))))) 6)
(C E C E G E)
buffers.lisp
Helpers to handle incudine buffer objects. They are all build around caching and reusing buffers when possible. Default buffer dsp! has some filters build-in.
(bbufer-load "/home/user/song.wav")
(bbplay "song.wav" :lpf 200 :pan .1)
You can manually create subsets of a buffer, to let's say play a word
from dialogue sample.
(bbufer-load "/home/user/speech.wav")
(put-phrase "welcome" "speech.wav" 1 2)
(put-phrase "change" "speech.wav" 9 4)
(word-play "welcome")
You can make an instrument which will interpolate the note filling the blanks for notes missing.
(make-instrument 'drum "/home/sendai/Downloads/sample/OH/")
(push-note 'drum 32 "kick_OH_F_9.wav")
(play-instrument 'drum 39)
fluidsynth.lisp
Shortcuts to control and use fluidsynth with incudine. Including (p)
and (pa)
, helpers to play a note/chord or arpeggio, useful on a temporal recursion scenario.
Examples
> (fload "/home/user/myfont.sf2")
> (p (now) :c4 60 1 0)
> (p (now) '(60 63 67) 60 1 0)
> (pa (now) '(60 58) 60 1 4 '(0 .25))
> (pa (now) 60 60 1 4 '(0 .25))
midifile.lisp
Helpers to retrieve midi notes
and rhythms
from midi files using incudine's midifile package.
General Midi Info
Midi Tempo
As with partitures, there is a tempo on .mid files. And the tempo can change a lot in the score. So far I haven't seen it change the time returned though.
Midi Tracks
Starting from 0 there can be many tracks. Either one per stave or more.
Midi Events
List of midi events in hexadecimal (from www.onicos.com)
144 - 0x90 - Chan 1 Note on
176 - 0xB0 - Chan 1 Control mode change
192 - 0xC0 - Chan 1 Program change
255 - 0xFF - Sys real time sys reset
Midi Notes
There are no explicit silence/rests on the midi format
About (group-by-measure-pair)
In order to use the (group-measures-pair) function you need to know the midi song bar length. Ex: 4/4 or 6/8. Then provide the MEASURE-LENGTH. It varies depending the UNIT you use.
Example
(defparameter *notes* nil)
(setf *notes* (subseq (get-measures-pair *mf* 10 2 1) 6))
(let ((measures (make-heap *notes*)))
(defun f (time)
(let* ((measure (next measures))
(notes (first measure))
(durations (second measure)))
(play-midi-arp time notes 50 durations 0 (d2o durations)))
(aat (+ time #[2 b]) #'f it)))
System Information
Definition Index
-
MENIERE
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *SETTINGS*
No documentation provided. -
EXTERNAL SPECIAL-VARIABLE *SYNTH*
No documentation provided. -
EXTERNAL FUNCTION ALL-PAN
- &OPTIONAL
- PAN
- MAX-CHANNELS
Set PAN on all channels
-
EXTERNAL FUNCTION ALL-PIANO
- &OPTIONAL
- PROGRAM
- MAX-CHANNELS
set all the midi channels to PROGRAM
-
EXTERNAL FUNCTION BBPLAY
- BUF
- &KEY
- RATE
- RPITCH
- BEAT-LENGTH
- START-POS
- LOOP-P
- AMP
- ID
- LPF
- HPF
- BPF
- LEFT
- RIGHT
- DOWNSAMP
- PAN
- LPR
- HPR
- BPR
- RESON
- RESONQ
- SET
plays the provided buffer either by PAN value between 0f0 and 1f0 RATE plays the buffer to play at rate RPITCH bends the whole buffer rate to play to the new pitch offset BEAT-LENGTH stretch the whole buffer to play for N beats
-
EXTERNAL FUNCTION BPLAY
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION CLEAN-BUFFERS
No documentation provided. -
EXTERNAL FUNCTION CLEAN-INSTRUMENTS
No documentation provided. -
EXTERNAL FUNCTION DSP-BASS
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-GREEN
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-IXI-KICK
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-IXI-SNARE
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-KEEN
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-PLUCK
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-PROPHET
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-PULSE
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION DSP-SQUARE
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION FCHORUS
- &KEY
- NR
- LEVEL
- SPEED
- DEPTH
- MODE
No documentation provided. -
EXTERNAL FUNCTION FCHORUS-TOGGLE
No documentation provided. -
EXTERNAL FUNCTION FG
- GAIN
short-hand to set the gain on fluidsynth
-
EXTERNAL FUNCTION FLOAD
- PATH
Load given .sf2 soundfont
-
EXTERNAL FUNCTION FP
- CHANNEL
- PROGRAM
- &OPTIONAL
- BANK
short-hand to set the fluidsynth channel to program
-
EXTERNAL FUNCTION FPAN
- CHANNEL
- PAN
No documentation provided. -
EXTERNAL FUNCTION FPITCH
- CHANNEL
- BEND
Set the MIDI pitch bend controller value on a MIDI channel. 0>=bend>=16383
-
EXTERNAL FUNCTION FPRESS
- CHANNEL
- PRESSURE
Set the MIDI channel pressure controllre value. a.k.a wibbly-woobly 0>=pressure>=127
-
EXTERNAL FUNCTION FREVERB
- &KEY
- ROOMSIZE
- DAMP
- WIDTH
- LEVEL
No documentation provided. -
EXTERNAL FUNCTION FREVERB-PRESET
- PRESET
No documentation provided. -
EXTERNAL FUNCTION FREVERB-TOGGLE
No documentation provided. -
EXTERNAL FUNCTION FSENS
- CHANNEL
- SENS
Set MIDI pitch wheel (aka sensitivity) on a MIDI channel. 0>=sens>=72
-
EXTERNAL FUNCTION FSTART
- &OPTIONAL
- ID
starts fluidsynth dsp! on given ID
-
EXTERNAL FUNCTION GET-MEASURES-PAIR
- MF
- &OPTIONAL
- N-MEASURES
- MEASURE-LENGTH
- TRACK-NUMBER
- UNIT
- SILENCE
Returns a list of pairs of notes and durations of the midi file MF and TRACK-NUMBER. Up to N-MEASURES measure by MEASURE-LENGTH. Re-arrange output of group-by-measure to make it easier to shuffle measures around. > (get-measures-pair *mf* 2 2 1) (((40 42 43 47) (0.49895832 0.49895835 0.49895835 0.49895835)) ((45 43 38) (0.49895835 0.49895835 0.99895835)))
-
EXTERNAL FUNCTION GET-NOTES
- FILENAME
- &OPTIONAL
- TRACK-NUMBER
Just return the midi notes, useful with bars without chords. > (get-notes *mf*) (60 64 69 34 59 30 49 59 29)
-
EXTERNAL FUNCTION GET-NOTES-CHORDS
- FILENAME
- &OPTIONAL
- TRACK-NUMBER
- UNIT
get notes grouped by time they were triggered > (get-notes-list *mf*) ((60 62 65) (60 62 69) (79)
-
EXTERNAL FUNCTION GET-NOTES-DURATIONS
- FILENAME
- &OPTIONAL
- TRACK-NUMBER
- START-TIME-P
- COERCE
- UNIT
get notes and duration as pairs, useful for bars with only one note > (get-notes-duration *mf*) ((50 .2) (60 .2) (90 1.3))
-
EXTERNAL FUNCTION GET-NOTES-DURATIONS-CHORDS
- FILENAME
- &OPTIONAL
- TRACK-NUMBER
- START-TIME-P
- COERCE
- UNIT
sorts and groups (get-notes-duration) to get the notes grouped in chords > (meniere:get-notes-durations-chords *mf* 1) (((41 48 53) (0.23645833 0.23645833 0.23645833)) ((41 48 53) (0.23645833 0.23645833 0.23645833)))
-
EXTERNAL FUNCTION GET-NOTES-DURATIONS-CHORDS-SILENCES
- FILENAME
- &OPTIONAL
- TRACK-NUMBER
- START-TIME-P
- COERCE
- UNIT
Returns pais of notes/durations on the current TRACK-NUMBER. Including any silence period. As a pair with 0 as the midi-note and the duration of the silence. > (get-notes-durations-chords-silences *mf*) ((40 0.49895832) (42 0.49895835) (43 0.49895835) (47 0.49895835) (45 0.49895835) (43 0.49895835) (38 0.99895835) (40 0.4989581))
-
EXTERNAL FUNCTION GROUP-BY-MEASURE
- MF
- &OPTIONAL
- MEASURE-LENGTH
- TRACK-NUMBER
- UNIT
- SILENCE
returns 2 values as lists. First list of values are the notes per measure. Second list of values is for the durations. > (group-by-measure *mf* 2 1) ((40 42 43 47) (45 43) (40 42)) ((0.49895832 0.49895835 0.49895835 0.49895835) ((0.9989586 0.9989586) (0.9989586 0.9989586)))
-
EXTERNAL FUNCTION LIST-INSTRUMENTS
No documentation provided. -
EXTERNAL FUNCTION LIST-WORDS
No documentation provided. -
EXTERNAL FUNCTION MAKE-INSTRUMENT
- NAME
- DIRECTORY
No documentation provided. -
EXTERNAL FUNCTION NODE-ALIVE
- ID
No documentation provided. -
EXTERNAL FUNCTION PLAY-INSTRUMENT
- NAME
- NKEYNUM
- &KEY
- DUR
- AMP
- RPITCH
- ID
- DOWNSAMP
- RESON
- LEFT
- RIGHT
- LPF
- HPF
- BPF
- LPR
- HPR
- BPR
No documentation provided. -
EXTERNAL FUNCTION PLAY-LSAMPLE-F
- &REST
- OPTIONAL-KEYWORDS
No documentation provided. -
EXTERNAL FUNCTION PUT-PHRASE
- WORD
- FILENAME
- START-AT
- DUR
creates a reference on global hash for WORD in FILENAME begining at START-AT for DUR (put-phrase "nothing" "furi-better-cc.wav" 1.7 1.9)
-
EXTERNAL FUNCTION TRY-SOUNDS
- TIME
- CHAN
- SF
- &OPTIONAL
- BEATS
- BANK
helper to iterate over programs on a soundfont to test sounds
-
EXTERNAL FUNCTION WORD-PLAY
- PHRASE
- &KEY
- RATE
- RPITCH
- BEAT-LENGTH
- LOOP-P
- AMP
- ID
- CORRUPT
- DOWNSAMP
- LEFT
- RIGHT
- PAN
- LPF
- HPF
- BPF
- LPR
- HPR
- BPR
- CORRUPT-CENTER
- CORRUPT-RADIUS
- CORRUPT-PERIOD
bplay wrapper to play the phrase provided (word-play "time") (word-play "time" :rate 2) (word-play "time" :rpitch 7) (word-play "time" :beat-length 4)
-
EXTERNAL GENERIC-FUNCTION P
- TIME
- PITCH
- VELOCITY
- DURATION
- CHANNEL
- &KEY
- PAN
No documentation provided. -
EXTERNAL GENERIC-FUNCTION PA
- TIME
- NOTES
- VELOCITY
- DURATION
- CHANNEL
- OFFSET
- &KEY
- PAN
Play the given notes as an arpeggio
-