repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
7eggert/L293_shield_v1
L293_shield_v1.h
// Simple Motor Shield sketch // ----------------------------------- // // by <NAME> <<EMAIL>>, August 2016 // // Open Source / Public Domain // // Inspired by a work from arduino.cc user "Krodal". // June 2012 // Open Source / Public Domain // // Using Arduino 1.16.10 // // A simple sketch for the motor shield, // wi...
cimeq/amazon-freertos
lib/cbor/src/aws_cbor_mem.c
/* * Amazon FreeRTOS CBOR Library V1.0.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restric...
cimeq/amazon-freertos
lib/FreeRTOS-Plus-TCP/source/portable/NetworkInterface/pic32mzef/NetworkInterface_eth.c
<gh_stars>1-10 /******************************************************************************* * Network Interface file * * Summary: * Network Interface file for FreeRTOS-Plus-TCP stack * * Description: * - Interfaces PIC32 to the FreeRTOS TCP/IP stack ***********************************************************...
cimeq/amazon-freertos
lib/defender/test/unit_tests/test_aws_defender_report.c
/* * Amazon FreeRTOS Device Defender Agent V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software withou...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor_acc.c
/* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restric...
cimeq/amazon-freertos
lib/defender/test/unit_tests/test_aws_defender_report_uptime.c
<reponame>cimeq/amazon-freertos /* * Amazon FreeRTOS Device Defender Agent V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), t...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor_map.c
/* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restric...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor_string.c
<filename>lib/cbor/test/test_aws_cbor_string.c /* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Softwar...
cimeq/amazon-freertos
lib/FreeRTOS/portable/ThirdParty/GCC/Xtensa_ESP32/port.c
<reponame>cimeq/amazon-freertos<filename>lib/FreeRTOS/portable/ThirdParty/GCC/Xtensa_ESP32/port.c /* FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. This file is part of the FreeRTOS distributio...
cimeq/amazon-freertos
lib/cbor/src/aws_cbor_int.c
<gh_stars>0 /* * Amazon FreeRTOS CBOR Library V1.0.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software wit...
cimeq/amazon-freertos
demos/common/ota/bootloader/include/aws_boot_log.h
/* * Amazon FreeRTOS Demo Bootloader V1.4.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without rest...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor_mem.c
/* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restric...
cimeq/amazon-freertos
lib/FreeRTOS/portable/GCC/ARM_CM4F_MPU/port.c
<reponame>cimeq/amazon-freertos /** * @file port.c * @brief FreeRTOS Cortex M4F core * @author Dr. <NAME> <EMAIL> * @mainpage * <b>MPU plus FPU port for the ARM Cortex M4F Microcontroller</b> * * - MPU and FPU used * - FPU context saved and restored on demand when switching to and from tasks using the FPU...
cimeq/amazon-freertos
lib/cbor/src/aws_cbor.c
<reponame>cimeq/amazon-freertos /* * Amazon FreeRTOS CBOR Library V1.0.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor.c
/* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restric...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor_iter.c
/* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restric...
cimeq/amazon-freertos
lib/cbor/src/aws_cbor_map.h
/* * Amazon FreeRTOS * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including with...
cimeq/amazon-freertos
lib/include/FreeRTOS_POSIX/time.h
<filename>lib/include/FreeRTOS_POSIX/time.h /* * Amazon FreeRTOS POSIX V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to de...
cimeq/amazon-freertos
lib/defender/test/unit_tests/test_aws_defender_report_cpu.c
<reponame>cimeq/amazon-freertos /* * Amazon FreeRTOS Device Defender Agent V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), t...
cimeq/amazon-freertos
lib/defender/src/aws_defender.c
/* * Amazon FreeRTOS Device Defender Agent V1.0.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software withou...
cimeq/amazon-freertos
lib/defender/src/report/aws_defender_report.c
<filename>lib/defender/src/report/aws_defender_report.c /* * Amazon FreeRTOS Device Defender Agent V1.0.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation f...
cimeq/amazon-freertos
lib/cbor/src/aws_cbor_mem.h
/* * Amazon FreeRTOS * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including with...
cimeq/amazon-freertos
lib/wifi/portable/microchip/curiosity_pic32mzef/aws_wifi.c
/******************************************************************************* * Network Interface file * * Summary: * Network Interface file for FreeRTOS-Plus-TCP stack * * Description: * - Interfaces PIC32 to the FreeRTOS TCP/IP stack **************************************************************************...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor_int.c
<filename>lib/cbor/test/test_aws_cbor_int.c /* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software")...
cimeq/amazon-freertos
lib/cbor/test/test_aws_cbor_print.c
<gh_stars>0 /* * Amazon FreeRTOS CBOR Library V1.0.0 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software wit...
cimeq/amazon-freertos
demos/common/ota/bootloader/crypto/tinycrypt/aws_boot_crypto.c
/* * Amazon FreeRTOS Demo Bootloader V1.4.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without rest...
cimeq/amazon-freertos
lib/cbor/src/aws_cbor_print.c
<reponame>cimeq/amazon-freertos<filename>lib/cbor/src/aws_cbor_print.c<gh_stars>0 /* * Amazon FreeRTOS CBOR Library V1.0.1 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associate...
EnderXenocide/DailyWork
src/main.h
/********************************************************************* * Name: main.h * Purpose: Declares simple wxWidgets application with GUI * created using wxFormBuilder. * Author: * Created: * Copyright: * License: wxWidgets license (www.wxwidgets.org) * * Notes: Note that all GU...
EnderXenocide/DailyWork
src/gui2.h
#ifndef __GUI_H__ #define __GUI_H__ #define USE_RICH_EDIT TRUE //#define HOTKEYS_ADD_TOMORROW = "\tCtrl++" //#define HOTKEYS_ADD_YESTERDAY = "\tCtrl+-" //#define HOTKEYS_GO_NEXT_AVAILABLE = "\tCtrl+Up" //#define HOTKEYS_GO_PREV_AVAILABLE = "\tCtrl+Down" #include <wx/filedlg.h> #include <wx/statbox.h> #include <w...
EnderXenocide/DailyWork
src/dailyworkparser.h
#ifndef DAILYWORKPARSER_H #define DAILYWORKPARSER_H #include <string> #include <functional> #include <set> #include <rapidjson/document.h> #include <rapidjson/filewritestream.h> #include <rapidjson/writer.h> #include <wx/treectrl.h> #include "dwitemdata.h" #include "results.h" #include "excludeddays.h" #define JSON_...
EnderXenocide/DailyWork
src/dwitemdata.h
#ifndef DWITEMDATA_H #define DWITEMDATA_H #include <wx/treectrl.h> #include <rapidjson/document.h> class DWItemData : public wxTreeItemData { public: DWItemData (const wxDateTime& date, bool empty) : wxTreeItemData() { m_date = date; m_empty = empty; }; ~DWItemData() {}; wxDateTi...
EnderXenocide/DailyWork
src/excludeddays.h
#ifndef EXCLUDEDDAYS_H #define EXCLUDEDDAYS_H #include <wx/string.h> #include <wx/datetime.h> //enum WeekDays {monday,tuesday,wednesday,thursday,friday, saturday,sunday}; class ExcludedDays { public: bool monday,tuesday,wednesday,thursday,friday, saturday,sunday; ExcludedDays(); ExcludedDays(const Exclud...
EnderXenocide/DailyWork
src/gui.h
<reponame>EnderXenocide/DailyWork /////////////////////////////////////////////////////////////////////////// // C++ code generated with wxFormBuilder (version Jun 17 2015) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// ...
EnderXenocide/DailyWork
src/CurrentDates.h
<gh_stars>0 #ifndef CURRENTDATES_H #define CURRENTDATES_H #include <wx/string.h> #include <set> #include <algorithm> class CurrentDates { public : CurrentDates() { Init(); } ~CurrentDates() { } std::set<wxDateTime> dates; // stock les dates de la plus vieille à la plus rece...
EnderXenocide/DailyWork
src/results.h
<gh_stars>0 #ifndef RESULTS_H #define RESULTS_H struct Result { wxDateTime date; wxString text; Result( wxDateTime d, wxString t) : date( d ), text( t ) {}; }; struct ResultComp { bool operator()(const Result& lhs, const Result& rhs) { return lhs.date > rhs.date; //de la plus recente à la plus vie...
EnderXenocide/DailyWork
src/myrichtext.h
<filename>src/myrichtext.h ///////////////////////////////////////////////////////////////////////////// // Name: richtext/richtext.h // Purpose: wxWidgets rich text editor sample // Author: <NAME> // Modified by: // Created: 2005-10-02 // Copyright: (c) <NAME> // Licence: wxWindows licence //...
koshkin-sergey/ukernel
examples/basic/arch/cortex-m/eval_aducm320/src/include/system_ADuCM320.h
/** @file system_ADUCM320.h @brief: CMSIS Cortex-M3 Device Peripheral Access Layer Header File for the ADuCM320 @version v0.1 @date February 18th 2013 @section disclaimer Disclaimer THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUD...
koshkin-sergey/ukernel
src/include/os_lib.h
<gh_stars>0 /* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0 * * Unless requ...
koshkin-sergey/ukernel
src/kernel/delay.c
/* * Copyright (C) 2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
koshkin-sergey/ukernel
src/include/ukernel.h
<gh_stars>0 /* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0 * * Unless requ...
koshkin-sergey/ukernel
src/kernel/kernel.c
<filename>src/kernel/kernel.c /* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0...
koshkin-sergey/ukernel
src/kernel/semaphore.c
/* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0 * * Unless required by appl...
koshkin-sergey/ukernel
src/Config/RTOS_Config.c
<reponame>koshkin-sergey/ukernel<gh_stars>0 /* * Copyright (C) 2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LI...
koshkin-sergey/ukernel
examples/basic/arch/cortex-m/eval_aducm320/src/tn_eval_aducm320_example_blink.c
/* * Copyright (C) 2016 <NAME> <<EMAIL>> * All rights reserved * * File Name : tn_eval_aducm320_example_blink.c * Description: tn_eval_aducm320_blink */ /******************************************************************************* * includes ****************************************************************...
koshkin-sergey/ukernel
src/kernel/event.c
<reponame>koshkin-sergey/ukernel<gh_stars>0 /* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licens...
koshkin-sergey/ukernel
examples/basic/arch/cortex-m/eval_aducm320/src/include/ADuCM320.h
/****************************************************************************************************//** * @file ADUCM320.h * * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File for * default ADUCM320 Device Series * * @version v1.1 * @date Monday September 22 2014 14:...
koshkin-sergey/ukernel
src/kernel/timer.c
/* * Copyright (C) 2011-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0 * * Unless required by appl...
koshkin-sergey/ukernel
src/kernel/mempool.c
<filename>src/kernel/mempool.c /* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2....
koshkin-sergey/ukernel
examples/basic/arch/cortex-m/stm32f0-discovery/src/stm32f0_example_basic.c
<filename>examples/basic/arch/cortex-m/stm32f0-discovery/src/stm32f0_example_basic.c /* * Copyright (C) 2015 <NAME> <<EMAIL>> * All rights reserved * * File Name : tn_stm32f0_example_basic.c * Description: tn_stm32f0_example_basic */ /*********************************************************************...
koshkin-sergey/ukernel
src/include/arch.h
<reponame>koshkin-sergey/ukernel /* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-...
koshkin-sergey/ukernel
src/Config/RTOS_Config.h
<filename>src/Config/RTOS_Config.h /* * Copyright (C) 2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0...
koshkin-sergey/ukernel
src/kernel/message_que.c
/* * Copyright (C) 2013-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-2.0 * * Unless required by appl...
koshkin-sergey/ukernel
examples/basic/arch/cortex-m/eval_aducm320/src/init/system_ADuCM320.c
<reponame>koshkin-sergey/ukernel /** @file system_ADUCM320.c @brief: CMSIS Device System Source File for Analog Devices ADUCM320 @version v0.1 @date June 6th 2014 @section disclaimer Disclaimer THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANT...
koshkin-sergey/ukernel
examples/timers/cortex_m/stm32f0-discovery/src/stm32f0_example_timers.c
/* * Copyright (C) 2019 <NAME> <<EMAIL>> * All rights reserved * * File Name : stm32f0_example_timers.c * Description: stm32f0_example_timers */ /******************************************************************************* * includes ************************************************************************...
koshkin-sergey/ukernel
src/kernel/thread.c
<reponame>koshkin-sergey/ukernel /* * Copyright (C) 2017-2019 <NAME> <<EMAIL>> * All rights reserved * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * www.apache.org/licenses/LICENSE-...
jimd1989/boar
src/wavetables/saw.h
/* A basic saw wave, intended for both playback and linear scaling. */ #pragma once #include "../constants/defaults.h" static const float WAVE_SAW_000[DEFAULT_WAVELEN] = { -1, -0.921422, -0.947433, -0.942619, -0.932586, -0.947691, -0.928308, -0.944872, -0.929868, -0.938172, -0.933392, -0.931289, -0.93559...
jimd1989/boar
src/velocity.h
#pragma once #include <stdint.h> #include "wave.h" float applyVelocityCurve(const Wave *, const uint16_t); unsigned int getNote(const uint16_t);
jimd1989/boar
src/voice.c
/* The procedures in this file handle the lifespans of notes. They tell * new notes to play and kill off old ones. The Voice struct tracks an * individual note in a polyphonic performance. You can read more about it * in "voice.h". */ #include <err.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #i...
jimd1989/boar
src/wavetables/flat.h
/* A flat signal. Wasteful, but an easy envelope solution. */ #pragma once #include "../constants/defaults.h" static const float WAVE_FLAT_000[DEFAULT_WAVELEN] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
jimd1989/boar
src/amplitude.c
<reponame>jimd1989/boar<gh_stars>1-10 /* Functions for the Amplitude type, which provides independent * channel volumes on the master audio output. */ #include <math.h> #include "amplitude.h" #include "numerical.h" Amplitude makeAmplitude(void) { /* Initialize an Amplitude struct with default channel volumes. */ ...
jimd1989/boar
src/repl.h
<gh_stars>1-10 #pragma once #include <stdint.h> #include "audio-init.h" #include "constants/defaults.h" #include "parse.h" typedef struct Repl { /* A struct containing everything needed for a user-facing loop. During every * cycle of the REPL, user input is read with read() into Repl.Buffer. This * string is then...
jimd1989/boar
src/buffers.h
#pragma once #include <stdint.h> #include <stdlib.h> #include "audio-settings.h" #include "constants/defaults.h" typedef struct Buffer { /* Two buffers: Mix is always DEFAULT_BUFSIZE frames long, and holds floating * point sample data. This is for mixing synthesis data generated by each of the * voices. It is k...
jimd1989/boar
src/synthesis.c
/* These functions contain the actual mathematics that create sound. */ #include <limits.h> #include <math.h> #include <stdlib.h> #include "synthesis.h" #include "constants/defaults.h" #include "envelope.h" #include "noise.h" #include "numerical.h" #include "wave.h" static void fillModulatorBuffer(Operator *); stat...
jimd1989/boar
src/wave.c
<gh_stars>1-10 /*Functions for selecting wave types and reading wavetables. */ #include <err.h> #include <stdlib.h> #include "wave.h" #include "constants/defaults.h" #include "constants/errors.h" #include "constants/maximums.h" #include "noise.h" #include "numerical.h" #include "wavetables/exponential.h" #include "w...
jimd1989/boar
src/audio-init.h
#pragma once #include "amplitude.h" #include "audio-settings.h" #include "buffers.h" #include "voice.h" typedef struct Audio { /* During an audio playback cycle, all synthesis takes place in Audio.Voices. * The sample values of individual Voices are summed up in Audio.MixingBuffer. * The samples in the MixingBuff...
jimd1989/boar
src/constants/errors.h
/* Defines return codes for errors */ #pragma once typedef enum Error { /* Nothing wrong */ ERROR_OK = 0, /* Error parsing commands line arguments */ ERROR_ARG, /* Error allocating memory */ ERROR_ALLOC, /* Error interfacting with sndio */ ERROR_SIO, /* Error parsing user input */ ERROR_INPUT, /...
jimd1989/boar
src/audio-init.c
<reponame>jimd1989/boar<filename>src/audio-init.c /* Initialization functions for the Audio type, which serves as the link * between the program and sndio, using the audio settings provided by the user * in command-line parameters. Most functions are of the void type, since * initialization errors are fatal anyway. ...
jimd1989/boar
src/velocity.c
<filename>src/velocity.c #include <stdint.h> #include "velocity.h" #include "constants/maximums.h" #include "numerical.h" #include "wave.h" float applyVelocityCurve(const Wave *vw, const uint16_t note) { /* Note is a set of two bytes. The lower byte is a value between 0 ... 127 * representing the actual MIDI note,...
jimd1989/boar
src/constants/defaults.h
/* Defines a set of default numerical constants, which are considered sane * audio settings. Some of these are constant throughout the lifespan of the * program. Others are overwritten by user-specified flags. */ #pragma once #include <math.h> #include <stdbool.h> /* Bit depth of an individual sample */ #define DE...
jimd1989/boar
src/wavetables/logarithmic.h
/* A wave of ln x ∈ [0,π]. Intended for envelope use, but can be played. */ #pragma once #include "../constants/defaults.h" static const float WAVE_LOGARITHMIC_000[DEFAULT_WAVELEN] = { -1, -0.551116, -0.453189, -0.368782, -0.290314, -0.24818, -0.220709, -0.182361, -0.14899, -0.13118, -0.111258, -0.0852653, ...
jimd1989/boar
src/wavetables/square.h
/* A series of tables representing a square wave. */ #pragma once #include "../constants/defaults.h" static const float WAVE_SQUARE_000[DEFAULT_WAVELEN] = { 4.88498e-15, 1, 0.922301, 0.949382, 0.945294, 0.936383, 0.952245, 0.933884, 0.951352, 0.937203, 0.946568, 0.942523, 0.941543, 0.946588, 0.938883, 0....
jimd1989/boar
src/constants/maximums.h
/* Defines constant maximum values of various variables, used to bound * certain operations */ #pragma once /* The maximum sample rate allowed */ #define MAX_RATE 384000 /* The maximum polyphony allowed */ #define MAX_POLYPHONY 128 /* The maximum command line flag length (currently "polyphony") */ #define MAX_FLA...
jimd1989/boar
src/audio-settings.h
<reponame>jimd1989/boar #pragma once #include "constants/errors.h" typedef struct AudioSettings { /* Contains all the constant settings that govern audio playback. Some * fields in this struct do not have to be referenced after initializing the * handle to the soundcard, but they are kept here in case future itera...
jimd1989/boar
src/parse.c
<filename>src/parse.c /* Parses text from stdin into proper boar commands and their arguments. boar * functions are always monadic or niladic, and expect an argument of a * specific type. Numerical parameters can be cast from ints to floats, and * vice-versa. Please read "types.h" for more information. */ #include ...
jimd1989/boar
src/synthesis.h
<gh_stars>1-10 #pragma once #include "envelope.h" #include "wave.h" typedef struct Osc { /* The primitive sound generating type. For every sound sample value generated, * Osc.Phase is incremented by Osc.Pitch, which serves as the index of * WAVE_SINE where the sample resides. Osc.Amplitude governs the depth of * ...
jimd1989/boar
src/wave.h
<reponame>jimd1989/boar #pragma once #include "noise.h" typedef enum WaveType { /* The type of a wave. */ WAVE_TYPE_FLAT = 0, WAVE_TYPE_SINE, WAVE_TYPE_SQUARE, WAVE_TYPE_TRIANGLE, WAVE_TYPE_SAW, WAVE_TYPE_EXPONENTIAL, WAVE_TYPE_LOGARITHMIC, WAVE_TYPE_NOISE } WaveType; typedef struct Wave { /* A wr...
jimd1989/boar
src/buffers.c
/* Functions that initialize, fill, and clear buffer types. Initialization * errors are fatal. */ #include <err.h> #include <stdlib.h> #include "buffers.h" #include "constants/defaults.h" #include "constants/errors.h" Buffer makeBuffer(const size_t size) { /* Sets Buffer size constants, and allocates Output array...
jimd1989/boar
src/main.c
/* Initializes the Audio struct, then starts a REPL to accept user input. */ #include "audio-init.h" #include "audio-output.h" #include "repl.h" int main(int argc, char **argv) { Audio a = {{0}}; Repl r = {{0}}; makeAudio(&a, argc, argv); r.Audio = &a; repl(&r); killAudio(&a); return 0; }
jimd1989/boar
src/amplitude.h
#pragma once typedef struct Amplitude { /* Amplitudes for master output, as well as left/right channel balance. */ float L; float Master; float R; } Amplitude; Amplitude makeAmplitude(void); void setBalance(Amplitude *, const float); void setVolume(Amplitude *, const float);
jimd1989/boar
src/audio-settings.c
<gh_stars>1-10 /* Functions for parsing command-line flags and assigning them to the * AudioSettings type, which serves as a read-only record of playback * information. */ #include <err.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include "audio-settings.h" #include "constants/defaults.h" #inc...
jimd1989/boar
src/constants/types.h
# pragma once /* TYPE_FLAG_* is an individual bit that is set when parsing a string of user * input. This input can have multiple attributes, such as being negative and * a floating point number, so different combinations of engaged bits will * describe the full nature of the input's type. */ /* Engaged when a num...
jimd1989/boar
src/wavetables/triangle.h
<filename>src/wavetables/triangle.h<gh_stars>1-10 /* A triangle wave. */ #pragma once #include "../constants/defaults.h" static const float WAVE_TRIANGLE_000[DEFAULT_WAVELEN] = { 0, 0.00195338, 0.00390682, 0.00586014, 0.00781363, 0.00976693, 0.0117204, 0.0136738, 0.0156271, 0.0175806, 0.0195339, 0.0214874, ...
jimd1989/boar
src/audio-output.h
#pragma once #include "audio-init.h" void play(Audio *);
jimd1989/boar
src/repl.c
<reponame>jimd1989/boar /* The REPL is the user-facing interface for the program. It reads commands * from stdin and passes them to sndio thread via the Audio struct. */ #include <err.h> #include <poll.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <unistd.h> #include "repl.h" #include "am...
jimd1989/boar
src/key.c
/* Functions that calculate the pitch, phase, tuning offset, velocity, and * key follow values of individual notes on the keyboard. These values are * assigned to Osc.KeyMod, which is applied during the synthesis process. */ #include <err.h> #include <stdint.h> #include "key.h" #include "constants/maximums.h" #i...
jimd1989/boar
src/wavetables/exponential.h
/* A wave of e^x ∈ [-π,π]. Intended for envelope use, but can be played. */ #pragma once #include "../constants/defaults.h" static const float WAVE_EXPONENTIAL_000[DEFAULT_WAVELEN] = { -1, -0.977701, -0.955501, -0.94916, -0.945262, -0.936113, -0.952166, -0.933655, -0.951164, -0.937045, -0.946275, -0.942402, ...
jimd1989/boar
src/audio-output.c
<filename>src/audio-output.c /* Functions related to audio output, including the main playback function. */ #include <err.h> #include <limits.h> #include <math.h> #include <sndio.h> #include <stdint.h> #include <string.h> #include "audio-output.h" #include "amplitude.h" #include "audio-init.h" #include "buffers.h" #...
jimd1989/boar
src/voice.h
#pragma once #include <stdbool.h> #include <stdint.h> #include "audio-settings.h" #include "constants/defaults.h" #include "key.h" #include "synthesis.h" #include "wave.h" typedef struct Voice { /* A voice plays back an individual note in a polyphonic performance. To do * this, it manages a carrier:modulator pair ...
jimd1989/boar
src/noise.c
/* Functions related to the Noise type. Consult "noise.h" for more info. */ #include <stdlib.h> #include "noise.h" #include "constants/defaults.h" #include "math.h" float readNoise(Noise *n, const float pitch) { /* Returns a random sample from a Noise unit. */ n->Phase += pitch; if (n->Phase > DEFAULT_WAVELEN...
jimd1989/boar
src/numerical.h
#pragma once /* Return the lesser of two values. */ #define LESSER(x, y) (x > y ? y : x) float truncateFloat(const float, const float); float liftFloat(const float, const float); float clip(const float); float expCurve(const float); float unipolar(const float); float interpolate(const float *, const int, const float)...
jimd1989/boar
src/envelope.c
<filename>src/envelope.c /* Functions related to management of Env types. For more detailed information, * consult "envelope.h". */ #include <stdbool.h> #include "envelope.h" #include "constants/defaults.h" #include "constants/maximums.h" #include "numerical.h" #include "synthesis.h" #include "wave.h" static float...
jimd1989/boar
src/parse.h
# pragma once #include <stdint.h> #include "constants/errors.h" typedef union Arg { /* A union where textual user input is parsed to. Can be an int, float, or a * string. */ int32_t I; float F; char * S; } Arg; typedef struct Cmd { /* The representation of a single boar command. Cmd.F...
jimd1989/boar
src/wavetables/sine.h
/* Array representing one cycle of a sine wave. A tone of an arbitrary pitch * is derived from interpolated lookups to this table. */ #pragma once #include "../constants/defaults.h" static const float WAVE_SINE_000[DEFAULT_WAVELEN] = { 0, 0.00306796, 0.00613588, 0.00920375, 0.0122715, 0.0153392, 0.0184067, ...
jimd1989/boar
src/envelope.h
<gh_stars>1-10 /* Defines the enums and structs used to manage envelope state. */ #pragma once #include <stdbool.h> #include "wave.h" typedef enum EnvStage { /* Marks which stage of A/D/S/R an envelope is currently in. */ ENV_ATTACK = 0, ENV_DECAY, ENV_SUSTAIN, ENV_RELEASE, ENV_FINISHED } EnvStage; t...
jimd1989/boar
src/numerical.c
/* Defines miscellaneous numerical functions for use in multiple locations * throughout the program. The procedures here should ideally be terse and * referentially transparent, since they are decoupled from the types, enums, * etc. in other files that give functions proper context. */ #include <stdbool.h> #inc...
jimd1989/boar
src/noise.h
#pragma once typedef struct Noise { /* A unit for generating random signals. On every sampling instance, the Phase * is incremented by the Oscillator's pitch. If the Phase is greater than * DEFAULT_WAVELEN, Amplitude is set to a random value ∈ [-1,1] and the Phase * is reset. The Oscillator's buffer will be popula...
jimd1989/boar
src/constants/funcs.h
# pragma once #include "defaults.h" #include "types.h" /* This file contains enum values for every function defined in boar. */ /* Assigns a function name and type to a character pair. */ #define FUNC_DEF(X, TYPE) (((unsigned int)(X) - DEFAULT_ASCII_A) | (TYPE)) /* (a) sets attack */ #define FUNC_ATTACK FUNC_DEF('a...
jimd1989/boar
src/key.h
<filename>src/key.h<gh_stars>1-10 # pragma once #include "constants/defaults.h" #include "synthesis.h" #include "velocity.h" #include "wave.h" typedef struct KeyboardLayer { /* A KeyboardLayer is holds all tuning, velocity, and key follow information * for a carrier or modulator. */ float Tunings[DEFAULT_K...
ratulKabir/depth_clustering
src/visualization/visualizer.h
<reponame>ratulKabir/depth_clustering // Copyright (C) 2020 <NAME>, <NAME> // // GNU-GPL licence that follows one of libQGLViewer. #ifndef SRC_VISUALIZATION_VISUALIZER_H_ #define SRC_VISUALIZATION_VISUALIZER_H_ #include <QGLViewer/qglviewer.h> #include <map> #include <mutex> #include <string> #include <thread> #inc...
zhusonghe/PaddleClas-1
deploy/cpp/include/cls_config.h
// Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required...